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

Re: [PATCH] git-submodule add: Record branch name in .gitmodules

From
NNahor <nahor.j+gmane@gmail.com>
Date
Oct 23, 2012, 21:45 UTC
Message-ID
<50871014.9060000@gmail.com>
In-Reply-To
<20121023194436.GD28592@odin.tremily.us>
On 2012-10-23 12:44, W. Trevor King wrote:
Show 12 quoted lines
> On Tue, Oct 23, 2012 at 12:16:22PM -0700, Nahor wrote:
>> On 2012-10-22 09:34, W. Trevor King wrote:
>> For instance, the module may later be updated to a commit in branch B
>> instead of branch A. Unless you remember to also update .gitmodule, you
>> have then inconsistent information.
>
> But you're explicitly *using* the configured setting in
>
>    git config --file $toplevel/.gitmodules submodule.$name.branch
>
> That should be a reminder that the configuration is important, and
> you'll remember to change it.
 From my experience with my colleagues at work, that's not going to 
happen. People are very good at forgetting to do something ;)
> Plus, the text from git-pull should
> clearly display the branch you are pulling, which gives you a second
> change to notice if something is going wrong.

That's assuming that the user knows the branch that should be pulled and that he's paying attention to the output and not just quick-scanning for errors/warnings. Again, from my experience, that's not going to be the case.

Plus, there isn't always a human being behind a git-pull, e.g. build bots.
Show 5 quoted lines
>> I think a better place to store that kind of information is using
>> git-notes. That way, if the branch is renamed or deleted, you can easily
>> update the old notes to use the new name instead.
>
> Interesting.  What would you attach the note too?
To the commits in the super-repo where a module branch is selected, i.e.:
- where a module was added
- where the module changed branch
- where a super-branch was merged and there was a conflict on the 
module's branch name
Previous: W. Trevor KingNext: Jens Lehmann
Message 4 of 12 in “git-submodule add: Record branch name in .gitmodules”
  1. git-submodule add: Record branch name in .gitmodulesW. Trevor King, Oct 22, 2012
  2. NahorOct 23, 2012
  3. W. Trevor KingOct 23, 2012
  4. NahorOct 23, 2012
  5. Jens LehmannOct 23, 2012
  6. W. Trevor KingOct 23, 2012
  7. NahorOct 23, 2012
  8. Jens LehmannOct 24, 2012
  9. W. Trevor KingOct 22, 2012
  10. Phil HordOct 24, 2012
  11. W. Trevor KingOct 25, 2012
  12. Jeff KingOct 26, 2012

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.