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

Re: [PATCH] fmt-merge-msg: use branch.$name.description

From
Michael J Gruber <git@drmicha.warpmail.net>
Date
Oct 7, 2011, 12:14 UTC
Message-ID
<4E8EED39.1060607@drmicha.warpmail.net>
In-Reply-To
<20111007100646.GA23193@elie.hsd1.il.comcast.net>
Jonathan Nieder venit, vidit, dixit 07.10.2011 12:06:
Show 10 quoted lines
> Michael J Gruber wrote:
> 
>> But my main point here is that we should discuss the pros and cons of
>> each approach in context (the context of the original thread), and I
>> haven't heard many pros and cons for either.
> 
> Ok, here are some thoughts (you can file them under the "pro" or "con"
> column according to your taste):
> 
> Branch names are local.

You can pull a branch only if you know its name, or using a wildcard refspec. In both cases you know the translation from what is local on the other side to your side. In the vast majority it will be the simple refs/heads/foo -> refs/remotes/bar/foo mapping.

> The same tip commit can belong to multiple branches, which would make
> using the tip commit as a key for the branch description problematic.
Sure, tip commit is a no-go.
That's why I propose notes tacked onto refnames.
> I don't think git notes are a good fit for this purpose.
Why not?

I really haven't seen any convincing argument against yet. The details (note attached to refname object, or literal refanmes in the notes tree as per Jeff) should be discussed further, of course, but if branch descriptions aren't "notesy" then I don't know what is.

Alternatively, one could store the description in a blob and refer to that directly, of course. I.e., have

refs/description/foo
point to a blob whose content is the description of the ref
ref/foo

That would be unversioned, and one could decide more easily which descriptions to share. (A notes tree you either push or don't.)

But it still has the advantage of being easily pushable and shareable. Heck, config is config and not metadata ;)

> I personally would prefer my branch descriptions to be non-versioned,
> though I realize that is a matter of taste.

Do you prefer you commit notes to be non-versioned? Probably, but still they are, and you don't need to care. Just don't run log on your notes ref.

Show 6 quoted lines
> Some other information about a branch (such as which upstream branch
> it pulls from) is stored in the [branch "<branchname>"] section of the
> git configuration, so it makes a certain kind of sense to put the
> branch description there, too.  On the other hand, the possibility of
> a [branch "<branchname>"] section in ~/.gitconfig has always been
> strange, and this is no exception.

Note that most use cases for branch descriptions that have been described so far (format-patch cover-letter, merge-msg, pull-request message) are about distributing that information. Not very local.

Show 8 quoted lines
>> I'd be surprised if we changed the protocol just to be able to share
>> some descriptions, when we have everything we need for sharing refs.
> 
> The impact of such a protocol change would not have to be as dramatic
> as you seem to be suggesting.  Virtual hosts and peeled ref values
> were added as backward-compatible extensions to the reference
> discovery protocol (see Documentation/technical/pack-protocol.txt)
> which can be taken as examples for inspiration.

I don't see how a protocol change could solve the perceived issue with localality of name, and indeed what it could solve that can't be solved with existing methods.

Show 6 quoted lines
> Here's some discussion of the implementation based on branchname-keyed
> notes that you mentioned [1].  It is nice to have multiple designs
> available for trying out, and I hope experience using each reveals
> potential improvements in the other.
> 
> [1] http://thread.gmane.org/gmane.comp.version-control.git/181953/focus=182000

Funny to point me at a thread I participated in, when I'm saying this thread should have continued there ;)

Michael
Previous: Jonathan NiederNext: Jonathan Nieder
Message 6 of 12 in “fmt-merge-msg: use branch.$name.description”
  1. fmt-merge-msg: use branch.$name.descriptionJunio C Hamano, Oct 7, 2011
  2. Michael J GruberOct 7, 2011
  3. Jonathan NiederOct 7, 2011
  4. Michael J GruberOct 7, 2011
  5. Jonathan NiederOct 7, 2011
  6. Michael J GruberOct 7, 2011
  7. Jonathan NiederOct 7, 2011
  8. Junio C HamanoOct 7, 2011
  9. Michael J GruberOct 7, 2011
  10. Jonathan NiederOct 7, 2011
  11. Junio C HamanoOct 7, 2011
  12. Jakub NarebskiOct 8, 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.