Re: [PATCH 1/2] rebase -i: optimize the creation of the todo file
- From
Johannes Sixt <j.sixt@viscovery.net>
- Date
- Mar 8, 2012, 11:51 UTC
- Message-ID
- <4F589D40.5060804@viscovery.net>
- In-Reply-To
- <CAJh6GrGcr3nOMR7Yrq7g8c-RgQ4FS_FrhcMb+w-nXQO2nic_rw@mail.gmail.com>
Am 3/8/2012 12:41, schrieb Dominique Quatravaux:
Show 16 quoted lines
> On Thu, Mar 8, 2012 at 12:36 PM, Dominique Quatravaux <domq@google.com> wrote: >> On Thu, Mar 8, 2012 at 12:20 PM, Johannes Sixt <j.sixt@viscovery.net> wrote: >>> Am 3/8/2012 11:42, schrieb Dominique Quatravaux: >>>> + shortsha1=$(echo $sha1 | cut -c1-7) >>> >>>> - sha1=$(git rev-parse $shortsha1) >>> >>> Why do you call it "optimization" when you spend two or three subprocesses >>> instead of one? >> >> echo is a shell internal. "git rev-parse" is two processes just as >> "cut" and a pipe. > > My mistake, strace git rev-parse revals that this is only one process. > Still, I think that saving a bunch of filesystem access beats saving > one fork()...
Not so on Windows.
But you must look at the repository in any case to avoid truncating the SHA1 too much, as Thomas pointed out.
-- Hannes