git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Sam Vilain <sam@vilain.net>
To: Anders Melchiorsen <mail@cup.kalibalik.dk>
Cc: git@vger.kernel.org, jnareb@gmail.com, gitster@pobox.com
Subject: Re: [PATCH] gitweb: recognize six digit abbreviated SHA1
Date: Tue, 13 Jan 2009 15:00:55 +1300	[thread overview]
Message-ID: <496BF5D7.2090003@vilain.net> (raw)
In-Reply-To: <87mydw2hkb.fsf@cup.kalibalik.dk>

Anders Melchiorsen wrote:
> Anders Melchiorsen <mail@cup.kalibalik.dk> writes:
>
>   
>> +	if ($line =~ m/([0-9a-fA-F]{7,40})/) {
>>     
>
> I could not make up my mind between the seven digits from "git
> rev-parse --short" and the six digits currently used by gitk.
>
> So I put one option in the patch, and the other one in the subject.
>   

I think if you're going to go so short as 6 digits, it's probably worth
making sure that the really short SHA1s check commits only. eg, if
you've got a commit 'fa023473' and a tree 'fa023421', then 'fa0234'
should match the commit and not the tree. But I don't think there's a
plumbing way to do a query like that at the moment.

Even git.git isn't unique over 6 digits, even restricting to commits.
Not since b0a3de ;-).

Sam

  reply	other threads:[~2009-01-13  2:02 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-01-13  0:04 [PATCH] gitweb: recognize six digit abbreviated SHA1 Anders Melchiorsen
2009-01-13  0:08 ` Anders Melchiorsen
2009-01-13  2:00   ` Sam Vilain [this message]
2009-01-13  8:26     ` Junio C Hamano
2009-01-14  0:33       ` Sam Vilain

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=496BF5D7.2090003@vilain.net \
    --to=sam@vilain.net \
    --cc=git@vger.kernel.org \
    --cc=gitster@pobox.com \
    --cc=jnareb@gmail.com \
    --cc=mail@cup.kalibalik.dk \
    /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).