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

Re: [PATCH] contrib/subtree bugfix: Can't `add` annotated tag

From
James Denholm <nod.helm@gmail.com>
Date
May 9, 2014, 07:36 UTC
Message-ID
<CAHYYfeFfo=xVDezAGFyCvuhx=bkzMF6KyDCAjZNKNoGnytXDWA@mail.gmail.com>
In-Reply-To
<xmqqoaz841d3.fsf@gitster.dls.corp.google.com>
Junio C Hamano <gitster@pobox.com> wrote:
> The "rev" (not "revs") seems to be used by more things than the
> final commit-tree state.  Are we losing some useful information by
> peeling it too early like this patch does? (...)

You're not wrong, actually, peeling at the last minute (or at least later) would be a better choice. I'd suggest that we aren't losing currently-useful information (as it'd be rare-if-ever that a user would look at a hash in their commit logs and think "Oh, that's that tag!"), but certainly with future development in mind it's more ideal.

Show 5 quoted lines
> I see that add_msg does not use anything useful from latest_new, so
> with the current state of the code, it does not make that much
> difference (except that it says "from commit '$latest_new'", and by
> peeling, the fact that the user wanted to use a tag is lost from the
> result).

Yeah, that might be a worthy thing to porcelain-up in the future with logging the tag name rather than, or in addition to, the hash, as well as a similar change in add_squashed_msg.

Show 5 quoted lines
> Would it be sufficient to do
>
>         git commit-tree $tree $headp -p "$rev^0"
>
> in that "not squashing" codepath instead?
On line 561, sure. Do you want me to do a re-roll?
Previous: Junio C HamanoNext: James Denholm
Message 3 of 4 in “contrib/subtree bugfix: Can't `add` annotated tag”
  1. contrib/subtree bugfix: Can't `add` annotated tagJames Denholm, May 8, 2014
  2. Junio C HamanoMay 8, 2014
  3. James DenholmMay 9, 2014
  4. James DenholmMay 12, 2014

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.