Re: [PATCH 1/2] rebase -i: optimize the creation of the todo file
- From
Thomas Rast <trast@inf.ethz.ch>
- Date
- Mar 8, 2012, 11:55 UTC
- Message-ID
- <87haxzl337.fsf@thomas.inf.ethz.ch>
- In-Reply-To
- <CAJh6GrGWfyKguhgf9dJR4yG3qYjh2jJz7OzzN8wao0rWLcohoA@mail.gmail.com>
Dominique Quatravaux <domq@google.com> writes:
Show 11 quoted lines
> 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.
But it gets them from --abbrev-commit, which makes sure that the abbreviation is unique. The 7 is just a request for the minimal number.
You can easily verify this in git.git with e.g.
git show --abbrev-commit --abbrev=7 \
2539a7b64dbc7e214704f6b879749a94685fb99eNote how the output uses an 8-digit SHA1 in the first line. The 7-digit colliding commit is 2539a7bdb81dcc920c97837a9bfb9d4c4e1ac280.
--
Thomas Rast
trast@{inf,student}.ethz.ch