From: Junio C Hamano <gitster@pobox.com>
To: "Nguyễn Thái Ngọc Duy" <pclouds@gmail.com>
Cc: git@vger.kernel.org
Subject: Re: [PATCH v5 4/4] Accept tags in HEAD or MERGE_HEAD
Date: Sun, 18 Sep 2011 14:51:31 -0700 [thread overview]
Message-ID: <7vsjntbjto.fsf@alter.siamese.dyndns.org> (raw)
In-Reply-To: 1316260665-1728-4-git-send-email-pclouds@gmail.com
Nguyễn Thái Ngọc Duy <pclouds@gmail.com> writes:
> 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/;
> + * 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.
prev parent reply other threads:[~2011-09-18 21:51 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2011-09-17 11:57 [PATCH v5 1/4] merge: keep stash[] a local variable Nguyễn Thái Ngọc Duy
2011-09-17 11:57 ` [PATCH v5 2/4] merge: use return value of resolve_ref() to determine if HEAD is invalid Nguyễn Thái Ngọc Duy
2011-09-17 11:57 ` [PATCH v5 3/4] merge: remove global variable head[] Nguyễn Thái Ngọc Duy
2011-09-17 11:57 ` [PATCH v5 4/4] Accept tags in HEAD or MERGE_HEAD Nguyễn Thái Ngọc Duy
2011-09-18 21:51 ` Junio C Hamano [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=7vsjntbjto.fsf@alter.siamese.dyndns.org \
--to=gitster@pobox.com \
--cc=git@vger.kernel.org \
--cc=pclouds@gmail.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).