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.