git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Linus Torvalds <torvalds@linux-foundation.org>
To: Junio C Hamano <junkio@cox.net>
Cc: "Shawn O. Pearce" <spearce@spearce.org>,
	"Randal L. Schwartz" <merlyn@stonehenge.com>,
	James Cloos <cloos@jhcloos.com>,
	git@vger.kernel.org, Peter Eriksen <s022018@student.dtu.dk>
Subject: Re: Distribution of longest common hash prefixes
Date: Tue, 3 Apr 2007 12:27:02 -0700 (PDT)	[thread overview]
Message-ID: <Pine.LNX.4.64.0704031219430.6730@woody.linux-foundation.org> (raw)
In-Reply-To: <7vhcrxz5a8.fsf@assigned-by-dhcp.cox.net>



On Tue, 3 Apr 2007, Junio C Hamano wrote:
> 
> Are you hinting to update sha1_name.c::get_sha1() so that we do
> not accept abbreviated non-commit object names?

No, but it might be nice if we had some fairly graceful way of handling 
abbreviated SHA1's that ended up being ambiguous (maybe they weren't 
ambiguous in the original context, but became ambiguous later).

Some way of just listing the alternatives, and sorting - and showing - by 
type (so that if you know it's supposed to be a commit, you can trivially 
pick it out from other objects that happen to collide in the first <n> 
digits).

Right now we can do it with

	git-rev-list --objects --all | grep '^<abbrev-sha1>'

but that's actually not even correct (maybe the reason sha1_name decided 
it was ambiguous was due to an _unreachable_ SHA1?), and it's also very 
inefficient.

We could have some helper that just looked things up (it's easy enough to 
look up all potential SHA1 matches both in the filesystem and in a 
pack-file - no need for any rev-list thing that lists all objects).

Is this a pressing concern? Absolutely not. I don't think we've ever had 
any real problems with this, and you *can* do it by hand with a bit of 
inefficient scripting right now..

			Linus

  reply	other threads:[~2007-04-03 19:27 UTC|newest]

Thread overview: 20+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2007-04-02 14:58 Distribution of longest common hash prefixes Peter Eriksen
2007-04-02 15:20 ` Linus Torvalds
2007-04-02 16:29   ` Randal L. Schwartz
2007-04-02 17:00     ` Linus Torvalds
2007-04-02 17:17       ` Randal L. Schwartz
2007-04-02 17:33         ` Randal L. Schwartz
2007-04-03 17:04           ` James Cloos
2007-04-03 17:11             ` Randal L. Schwartz
2007-04-03 17:21               ` Shawn O. Pearce
2007-04-03 17:50                 ` Linus Torvalds
2007-04-03 18:22                   ` Junio C Hamano
2007-04-03 19:27                     ` Linus Torvalds [this message]
2007-04-03 19:34                     ` Nicolas Pitre
2007-04-03 20:25                       ` Junio C Hamano
2007-04-03 20:39                         ` Nicolas Pitre
2007-04-03 23:08                           ` Olivier Galibert
2007-04-03 23:22                             ` Linus Torvalds
2007-04-04 21:03                   ` James Cloos
2007-04-02 17:18     ` James Cloos
2007-04-02 15:28 ` Peter Eriksen

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=Pine.LNX.4.64.0704031219430.6730@woody.linux-foundation.org \
    --to=torvalds@linux-foundation.org \
    --cc=cloos@jhcloos.com \
    --cc=git@vger.kernel.org \
    --cc=junkio@cox.net \
    --cc=merlyn@stonehenge.com \
    --cc=s022018@student.dtu.dk \
    --cc=spearce@spearce.org \
    /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).