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

Re: [PATCH] git-submodule: Remove duplicate entries during merge with conflict

From
Jens Lehmann <jens.lehmann@web.de>
Date
Mar 21, 2011, 22:01 UTC
Message-ID
<4D87CAC4.2010001@web.de>
In-Reply-To
<4D87C467.3090907@morey-chaisemartin.com>
Am 21.03.2011 22:34, schrieb Nicolas Morey-Chaisemartin:
Show 25 quoted lines
> On 21/03/2011 21:29, Jens Lehmann wrote:
>>
>>>  - Update should refrain from touching the submodule itself. It may want
>>>    to recurse into the submodule of the unmerged one, but people involved
>>>    in submodule work should think things through;
>>
>> I don't think recursing would make any sense here. It might be unknown
>> to what commit the sub-submodules should be updated to if their commits
>> differ in the unmerged branches. So I'd vote for not recursing at all in
>> this case (which is what your patch does).
>>
> 
> After a bit of thinking about the way we use git at my company, there is something that could be done here. It may be completely useless for most people (or maybe even stupid and feel free to enlighten me!)
> We work with continuous integration on two level of git (1 integration which only has submodules and lots of source repositories).
> The usual thing when a user want to push its diff is:
> - commit in the submodules on his branch
> - Update the submodules refs in the integration repo on his branch
> - Pull master 
> - See there are conflicts
> - Blindly pull master in all the conflicted submodules. Push the merge
> - Commit in the integration repo and pray it works !
> 
> Although in the scheme git submodule update by itself does not make much sense. What people actually do is pretty much a git submodule update --merge of the conflicting SHA1 for each submodule.
> 
> For the moment we used either ruby scripts or a list of commands that users blindly follows without understanding much of it, and seeing something like that (there's probably a nicest way to do it) in git would be great.

Hmm, I'm not sure if I fully understand your use case. Maybe being able to tell pull to run a "git merge <sha1-from-upstream>" in submodules where the superproject's merge produced conflicts would help you?

Show 14 quoted lines
>>>  - Status does not have anything to report for an unmerged submodule. It
>>>    may want to recurse into the submodule of the unmerged one, but people
>>>    involved in submodule work should think things through; and
>>
>> I do think status does have something to report here. First its job is to
>> list all submodules, so currently unmerged submodules should show up too,
>> and then it tells the user something about the state of the submodule. So
>> I would propose to print a line for the submodule starting with a special
>> character that tells the user the submodule has a merge conflict. We
>> could e.g. use a '*' here (additionally to '-' for uninitialized and '+'
>> for those submodules where the HEAD differs from the commit recorded in
>> the superproject).
>>
> Being a big user of __git_ps1, my brain now considers '*' has uncached diff and '+' has cached diff. I'd rather have something as 'U' that stands outs.

That is a good argument against '*'. I don't have strong feelings about that, I just came up with '*' because "git submodule status" already uses '-' and '+' in it's output. But anyways, 'U' is fine for me too.

Previous: Nicolas Morey-ChaisemartinNext: Nicolas Morey-Chaisemartin
Message 9 of 14 in “git-submodule: Remove duplicate entries during merge with conflict”
  1. git-submodule: Remove duplicate entries during merge with conflictNicolas Morey-Chaisemartin, Mar 17, 2011
  2. Junio C HamanoMar 17, 2011
  3. Junio C HamanoMar 17, 2011
  4. Nicolas Morey-ChaisemartinMar 21, 2011
  5. Jens LehmannMar 21, 2011
  6. Jens LehmannMar 21, 2011
  7. Junio C HamanoMar 21, 2011
  8. Nicolas Morey-ChaisemartinMar 21, 2011
  9. Jens LehmannMar 21, 2011
  10. Nicolas Morey-ChaisemartinMar 22, 2011
  11. funeeldyJul 14, 2011
  12. Jens LehmannJul 15, 2011
  13. Marlene CoteJul 15, 2011
  14. Jens LehmannJul 15, 2011

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.