Uploaded image for project: 'Sourcetree For Mac'
  1. Sourcetree For Mac
  2. SRCTREE-5276

No unpushed-submodule warning if submodule is in detached HEAD

    XMLWordPrintable

Details

    • Bug
    • Resolution: Unresolved
    • Medium
    • None
    • 2.7
    • Git
    • macOS 10.13.2 (but bug has been occurring for years)

    • Severity 3 - Minor

    Description

      The Push command very kindly warns you if a submodule has unpushed commits, and lets you push the submodule first. However, it doesn't do this if the submodule is in "detached HEAD" state, i.e. no branch is checked out. Unfortunately, submodules are very often in this state because the `git submodule update` command leaves them that way. The result is that SourceTree pushes the main repo without the dependent submodule commit, leaving the upstream/remote repo in a broken state, causing build failures and annoyed messages from co-workers.

      I cannot count how many times I've broken a build by forgetting to push a submodule that has new commits, because I tend to rely on SourceTree to remind me.

      This isn't a regression; it's been the case for years, I've just never gotten around to filing a bug report until now...

      Steps to reproduce:

      1. Open a repo that has a submodule, and open the submodule
      2. Make and commit (to master) a change in the submodule
      3. Commit the submodule change to the main repo's master branch.
      4. Check out an older commit in the main repo (resets the submodule to an older commit)
      5. Check out the master branch in the main repo (resets the submodule to the new commit, but does not check out the submodule's master branch)
      6. Push the main repo

      Expected Result:

      • Unpushed-submodules sheet opens and prompts me to push the submodule

      Actual Result:

      • Sheet does not open, and main repo is immediately pushed, without the dependent submodule commit (breaking the build on the remote of course)

      Attachments

        Activity

          People

            Unassigned Unassigned
            577661dfce82 snej
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

              Created:
              Updated: