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

Re: [PATCH] Fix behavior with non-committish upstream references

From
Junio C Hamano <gitster@pobox.com>
Date
Apr 28, 2009, 07:30 UTC
Message-ID
<7vab61s0aq.fsf@gitster.siamese.dyndns.org>
In-Reply-To
<1240849603-26127-1-git-send-email-git@drmicha.warpmail.net>
Michael J Gruber <git@drmicha.warpmail.net> writes:
Show 14 quoted lines
> stat_tracking_info() assumes that upstream references (as specified by
> --track or set up automatically) are commits. By calling lookup_commit()
> on them, create_objects() creates objects for them with type commit no
> matter what their real type is; this disturbs lookup_tag() later on the
> call sequence, leading to git status, git branch -v  and git checkout
> erroring out.
>
> Fix this by using lookup_commit_reference() instead so that (annotated)
> tags can be used as upstream references.
>
> Signed-off-by: Michael J Gruber <git@drmicha.warpmail.net>
> ---
> I'm sorry I won't be able to write a test any more today. Please let me
> whether it's okay without a test.

I am sorry, but I simply do not see much point in this. I think you meant by the title "non-commit upstream ref", as a tag that eventually peels to a commit is a committish. Because a tag is meant to be immutable, forking from that mean your further "merges from upstream" won't do anything, so the current behaviour of returning without saying anything sounds like the right thing to do, even though I strongly suspect that it behaves this way by accident not by design.

Admittedly, I do not "fork and keep up-to-date with an upstream" that often, so I am in no way making a final decision here. It would be healthy for interested people to discuss this patch, but I'd appreciate it if it happens after 1.6.3 final.

Previous: Michael J GruberNext: Michael J Gruber
Message 3 of 4 in “tracking branch on a tag”
  1. Simon BraunschmidtApr 23, 2009
  2. Fix behavior with non-committish upstream referencesMichael J Gruber, Apr 27, 2009
  3. Junio C HamanoApr 28, 2009
  4. Michael J GruberApr 28, 2009

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.