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

Re: [PATCH v5 4/4] Accept tags in HEAD or MERGE_HEAD

From
Junio C Hamano <gitster@pobox.com>
Date
Sep 18, 2011, 21:51 UTC
Message-ID
<7vsjntbjto.fsf@alter.siamese.dyndns.org>
In-Reply-To
<1316260665-1728-4-git-send-email-pclouds@gmail.com>
Nguyễn Thái Ngọc Duy <pclouds@gmail.com> writes:
Show 9 quoted lines
> HEAD and MERGE_HEAD (among other branch tips) should never hold a
> tag. That can only be caused by broken tools and is cumbersome to fix
> by an end user with:
>
>   $ git update-ref HEAD $(git rev-parse HEAD^{commit})
>
> which may look like a magic to a new person.
> ...
> Signed-off-by: Nguyễn Thái Ngọc Duy <pclouds@gmail.com>
Nicely done.
Just a few micronits.
> diff --git a/commit.h b/commit.h
> ...
> +/*
> + * Look sha1 up for a commit, defer if needed. If dereference occurs,
That's s/defer/deref/;
Show 5 quoted lines
> + * update "sha1" for consistency with retval->object.sha1. Also warn
> + * users this case because it is expected that sha1 points directly to
> + * a commit.
> + */
> +struct commit *lookup_commit_or_die(const unsigned char *sha1, const char *ref_name);

This no longer updates sha1 now it is a pointer to a const arena. I'll update this part as follows, and queue the result.

/*
 * Look up object named by "sha1", dereference tag as necessary, 
 * get a commit and return it. If "sha1" does not dereference to
 * a commit, use ref_name to report an error and die.
 */
Thanks.
Previous: Nguyễn Thái Ngọc Duy
Message 5 of 5 in “merge: keep stash[] a local variable”
  1. 1/4 merge: keep stash[] a local variableNguyễn Thái Ngọc Duy, Sep 17, 2011
  2. 2/4 merge: use return value of resolve_ref() to determine if HEAD is invalidNguyễn Thái Ngọc Duy, Sep 17, 2011
  3. 3/4 merge: remove global variable head[]Nguyễn Thái Ngọc Duy, Sep 17, 2011
  4. 4/4 Accept tags in HEAD or MERGE_HEADNguyễn Thái Ngọc Duy, Sep 17, 2011
  5. Junio C HamanoSep 18, 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.