git/list[1] front-page[2] threads[3] people[4] search[5] about
 

Re: [PATCH 1/2] rebase -i: optimize the creation of the todo file

From
Dominique Quatravaux <domq@google.com>
Date
Mar 8, 2012, 11:41 UTC
Message-ID
<CAJh6GrGcr3nOMR7Yrq7g8c-RgQ4FS_FrhcMb+w-nXQO2nic_rw@mail.gmail.com>
In-Reply-To
<CAJh6GrGch9JHYnGW+K-wxdX9wPRry4Lxi2ysTtt0g9FTF4ThTQ@mail.gmail.com>
On Thu, Mar 8, 2012 at 12:36 PM, Dominique Quatravaux <domq@google.com> wrote:
Show 11 quoted lines
> 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() (one of the two processes in my patched version is a shell, so no execve() there) but I admit I haven't benchmarked this.

-- 
  Dominique Quatravaux
  +41 79 609 40 72
Previous: Dominique QuatravauxNext: Johannes Sixt
Message 17 of 18 in “rebase -i: optimize the creation of the todo file”
  1. 1/2 rebase -i: optimize the creation of the todo fileDominique Quatravaux, Mar 8, 2012
  2. 2/2 rebase -i: new option --name-revDominique Quatravaux, Mar 8, 2012
  3. Thomas RastMar 8, 2012
  4. Dominique QuatravauxMar 8, 2012
  5. Junio C HamanoMar 8, 2012
  6. Dominique QuatravauxMar 9, 2012
  7. Junio C HamanoMar 8, 2012
  8. Junio C HamanoMar 8, 2012
  9. Johannes SixtMar 9, 2012
  10. Dominique QuatravauxMar 9, 2012
  11. Junio C HamanoMar 9, 2012
  12. Thomas RastMar 8, 2012
  13. Dominique QuatravauxMar 8, 2012
  14. Thomas RastMar 8, 2012
  15. Johannes SixtMar 8, 2012
  16. Dominique QuatravauxMar 8, 2012
  17. Dominique QuatravauxMar 8, 2012
  18. Johannes SixtMar 8, 2012

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.