git@vger.kernel.org mailing list mirror (one of many)
 help / color / mirror / code / Atom feed
From: Dominique Quatravaux <domq@google.com>
To: Thomas Rast <trast@inf.ethz.ch>
Cc: gitster@pobox.com, git@vger.kernel.org
Subject: Re: [PATCH 1/2] rebase -i: optimize the creation of the todo file
Date: Thu, 8 Mar 2012 12:48:24 +0100	[thread overview]
Message-ID: <CAJh6GrGWfyKguhgf9dJR4yG3qYjh2jJz7OzzN8wao0rWLcohoA@mail.gmail.com> (raw)
In-Reply-To: <87boo7pdvc.fsf@thomas.inf.ethz.ch>

On Thu, Mar 8, 2012 at 11:48 AM, Thomas Rast <trast@inf.ethz.ch> wrote:
> Dominique Quatravaux <domq@google.com> writes:
>
>> Instead of obtaining short SHA1's from "git rev-list" and hitting the repository
>> once more with "git rev-parse" for the full-size SHA1's, obtain long SHA1's from
>> "git rev-list" and truncate them with "cut".
>
> That doesn't work if there are 7-digit SHA1 collisions in the repo.

I don't see how my patch changes the picture wrt SHA1 collisions. In
the current state, the rebase todo already uses short SHA1s.

> Even my git.git has a bunch of them, as checked with
>
>  git rev-list --objects --all | cut -c1-7 | sort | uniq -d
>
> and I expect a bigger project would have collisions beyond the 9th
> digit.
>
> What you can, however, do:
>
>> -git rev-list $merges_option --pretty=oneline --abbrev-commit \
>> -     --abbrev=7 --reverse --left-right --topo-order \
>> +git rev-list $merges_option --pretty=oneline --no-abbrev-commit \
>> +     --reverse --left-right --topo-order \
>>       $revisions | \
>
> rev-list can give you *both* the abbreviated and full SHA1s if you say
>
>  git rev-list $merges_option --format="%>%h %H %s" <...etc...>

Interesting, thanks! It seems that %h works with find_unique_abbrev
which according to the name, should Do The Right Thing. I'll update my
patch.


-- 
  Dominique Quatravaux
  +41 79 609 40 72

  reply	other threads:[~2012-03-08 11:49 UTC|newest]

Thread overview: 18+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-03-08 10:42 [PATCH 1/2] rebase -i: optimize the creation of the todo file Dominique Quatravaux
2012-03-08 10:42 ` [PATCH 2/2] rebase -i: new option --name-rev Dominique Quatravaux
2012-03-08 10:56   ` Thomas Rast
2012-03-08 11:57     ` Dominique Quatravaux
2012-03-08 18:58       ` Junio C Hamano
2012-03-09  7:58         ` Dominique Quatravaux
2012-03-08 19:08     ` Junio C Hamano
2012-03-08 22:13       ` Junio C Hamano
2012-03-09  7:22         ` Johannes Sixt
2012-03-09  9:04           ` Dominique Quatravaux
2012-03-09  9:45             ` Junio C Hamano
2012-03-08 10:48 ` [PATCH 1/2] rebase -i: optimize the creation of the todo file Thomas Rast
2012-03-08 11:48   ` Dominique Quatravaux [this message]
2012-03-08 11:55     ` Thomas Rast
2012-03-08 11:20 ` Johannes Sixt
2012-03-08 11:36   ` Dominique Quatravaux
2012-03-08 11:41     ` Dominique Quatravaux
2012-03-08 11:51       ` Johannes Sixt

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

  List information: http://vger.kernel.org/majordomo-info.html

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=CAJh6GrGWfyKguhgf9dJR4yG3qYjh2jJz7OzzN8wao0rWLcohoA@mail.gmail.com \
    --to=domq@google.com \
    --cc=git@vger.kernel.org \
    --cc=gitster@pobox.com \
    --cc=trast@inf.ethz.ch \
    /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.
Code repositories for project(s) associated with this public inbox

	https://80x24.org/mirrors/git.git

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 read-only IMAP folder(s) and NNTP newsgroup(s).