git/list[1] front-page[2] threads[3] people[4] search[5] about
 

Re: Making submodules easier to work with (auto-update on checkout or merge, stash & restore submodules)

From
Avery Pennarun <apenwarr@gmail.com>
Date
Apr 30, 2008, 21:48 UTC
Message-ID
<32541b130804301448i537a0b98ta01cecc472e20aec@mail.gmail.com>
In-Reply-To
<EFEF26F9-D5D6-4BAC-9A8F-6D96E45AFAF7@gmail.com>
On 4/30/08, Tim Harper <timcharper@gmail.com> wrote:
Show 13 quoted lines
> > What about the following case:
> > - submodule matches the super module checkin
> > - make changes to submodule but to *not* commit them
> > - switch supermodule branches, which should checkout a different submodule
> > - submodule checkout causes a conflict with uncommitted files
> > [all of the above were meant to be steps in the same test case]
>
> Oooh - this could be a problem currently, especially if you're not on a
> branch.  If you have to resolve conflicts the way to resolve them is to
> commit, and you can't switch to a branch to commit unless you resolve your
> issues.  In which case, you'll probably want to resolve, commit, then create
> a new branch with your current HEAD, then merge it into a branch.  I'll
> visit that as issues arise.  This is bleeding edge experimentation here :)

I know how to deal with it manually, but I'm more concerned about what would happen in the automatic case, that is, the submodule is dirty and the supermodule tries to switch branches.

I guess the standard thing to do would be to just have git-checkout in the supermodule check all the submodules first, and if any of them are dirty, refuse to do anything at all.

Show 8 quoted lines
>  Here's a link to the bundle.  It's written in ruby.:
>  http://github.com/timcharper/git-tmbundle/
>
> What does it have to do with submodules?  It's essentially a "GUI" for git.
> It provides automation for a lot of common tasks also.  My team has a need
> for submodules, but unfortunately in their current state I couldn't
> recommend it to them, so I "smoothed over" the rough edges by automating a
> lot of the awkwardness.  So far, it's been working well for us.
Hmm, so the bad news is that it doesn't really help me then :(

It would be awesome if you could turn the fancy behaviour of this bundle into patches to git-submodule, for example, and then have your textmate macros call the modified git-submodule. It might be a bit of an uphill battle to get the patches accepted into the release, but I think it's worth the effort, as git-submodule in its current state is just a non-starter for my group at least.

Have fun,
Avery
Previous: Tim HarperNext: Roman Shaposhnik
Message 12 of 22 in “Making submodules easier to work with (auto-update on checkout or merge, stash & restore submodules)”
  1. Tim HarperApr 30, 2008
  2. Tim HarperApr 30, 2008
  3. Andreas EricssonApr 30, 2008
  4. Johannes SchindelinApr 30, 2008
  5. Avery PennarunApr 30, 2008
  6. Ping YinApr 30, 2008
  7. Roman ShaposhnikApr 30, 2008
  8. Avery PennarunApr 30, 2008
  9. Tim HarperApr 30, 2008
  10. Avery PennarunApr 30, 2008
  11. Tim HarperApr 30, 2008
  12. Avery PennarunApr 30, 2008
  13. Roman ShaposhnikApr 30, 2008
  14. Avery PennarunApr 30, 2008
  15. Finn Arne GangstadMay 1, 2008
  16. Avery PennarunMay 1, 2008
  17. Roman ShaposhnikMay 6, 2008
  18. Avery PennarunMay 7, 2008
  19. Ping YinMay 8, 2008
  20. Steven GrimmMay 1, 2008
  21. Roman ShaposhnikMay 6, 2008
  22. Ping YinMay 1, 2008

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.