From: Eric Sunshine <sunshine@sunshineco.com>
To: "Nguyễn Thái Ngọc Duy" <pclouds@gmail.com>
Cc: Git List <git@vger.kernel.org>
Subject: Re: [PATCH/RFC] get_sha1: prefer 40-hex ref name over 40-hex SHA-1
Date: Tue, 30 Apr 2013 23:03:03 -0400 [thread overview]
Message-ID: <CAPig+cQMN56KfcgAu5EO39aGYwL_TO8CWuHSfcwAbruzw0a88A@mail.gmail.com> (raw)
In-Reply-To: <1367377282-9862-1-git-send-email-pclouds@gmail.com>
On Tue, Apr 30, 2013 at 11:01 PM, Nguyễn Thái Ngọc Duy
<pclouds@gmail.com> wrote:
> The current behavior is inconsistent when passing SHA-1 to get_sha1.
> If it's a short sha-1, refs take precedence. "git rev-parse 1234" will
> resolve refs/heads/1234 if exists even if there is an unambiguous
> SHA-1 starting with 1234. However if it's full SHA-1, the SHA-1 takes
> precedence and refs with the same name are ignored.
>
> The former makes more sense than the latter. This patch makes git
> check for 40-hex ref names before consider it SHA-1. In future, we may
> want to warn ambiguity between refs and SHA-1 (for both full and short
s/warn/warn about/
> SHA-1).
>
> Signed-off-by: Nguyễn Thái Ngọc Duy <pclouds@gmail.com>
next prev parent reply other threads:[~2013-05-01 3:03 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2013-05-01 3:01 [PATCH/RFC] get_sha1: prefer 40-hex ref name over 40-hex SHA-1 Nguyễn Thái Ngọc Duy
2013-05-01 3:03 ` Eric Sunshine [this message]
2013-05-01 18:43 ` Jonathan Nieder
2013-05-02 10:09 ` Duy Nguyen
2013-05-04 3:45 ` [PATCH] get_sha1: improve ambiguity warning regarding SHA-1 and ref names Nguyễn Thái Ngọc Duy
2013-05-07 16:09 ` Junio C Hamano
2013-05-29 12:12 ` [PATCH v2] get_sha1: warn about full or short object names that look like refs Nguyễn Thái Ngọc Duy
2013-05-02 8:55 ` [PATCH/RFC] get_sha1: prefer 40-hex ref name over 40-hex SHA-1 Thomas Rast
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=CAPig+cQMN56KfcgAu5EO39aGYwL_TO8CWuHSfcwAbruzw0a88A@mail.gmail.com \
--to=sunshine@sunshineco.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).