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

Re: [PATCH] Invoke git-repo-config directly.

From
Andreas Ericsson <ae@op5.se>
Date
Mar 16, 2006, 11:55 UTC
Message-ID
<4419524B.1030405@op5.se>
In-Reply-To
<7vmzfq8zmr.fsf@assigned-by-dhcp.cox.net>
Junio C Hamano wrote:
Show 10 quoted lines
> 
> And the second issue is the last point in the "implications"
> list above.  You are right, and I stand corrected.  Our scripts
> should consistently use dash form.
> 
> One thing that bothers me is that we need to keep encouraging
> users to use dashless form from the command line, while we
> update our scripts to use dash form.  What a contradicting and
> confusing situation X-<.
> 

One of the two reasons for rewriting the git wrapper in C was the performance penalty that came from having it as a shell-script while it was desirable from a porcelainish standpoint to use the dash-less form since we thought even then that "git" would always be in PATH while "git-foo" was to be moved to the still-imaginary GIT_EXEC_PATH.

The prepending of the GIT_EXEC_PATH to PATH was a laziness workaround for scripts that use the dashed form until we'd had time to change those, although I see from the commit-message that it's a far cry from abundantly clear (reading it now I even think it's clear I meant the other way around, although I remember I didn't). Anyways, the relative parts are these, from commit 8e49d50388211a0f3e7286f6ee600bf7736f4814

---8<---8<---8<---
     The location of the GIT_EXEC_PATH (name discussion's closed,
     thank gods) can be obtained by running
     	git --exec-path
     which will hopefully give porcelainistas ample time to adapt their
     heavy-duty loops to call the core programs directly and thus save
     the extra fork() / execve() overhead, although that's not really
     necessary any more.
     The --exec-path value is prepended to $PATH, so the git-* programs
     should Just Work without ever requiring any changes to how they call
     other programs in the suite.
     Some timing values for 10000 invocations of git-var >&/dev/null:
     	git.sh: 24.194s
     	git.c:   9.044s
     	git-var: 7.377s
---8<---8<---8<---
 From the timing values there I think the performance issues of using 
the dash-less form can just be ignored. Very rarely will a porcelainish 
wrapper do 10000 invocations of git commands where less than 2 seconds 
will be a large percentage of the overall runtime.
-- 
Andreas Ericsson                   andreas.ericsson@op5.se
OP5 AB                             www.op5.se
Tel: +46 8-230225                  Fax: +46 8-230231
Previous: Junio C HamanoNext: Jon Loeliger
Message 24 of 27 in “Invoke git-repo-config directly.”
  1. Invoke git-repo-config directly.Qingning Huo, Mar 14, 2006
  2. Johannes SchindelinMar 14, 2006
  3. Qingning HuoMar 14, 2006
  4. Linus TorvaldsMar 14, 2006
  5. Qingning HuoMar 14, 2006
  6. Linus TorvaldsMar 14, 2006
  7. Qingning HuoMar 15, 2006
  8. Junio C HamanoMar 15, 2006
  9. Junio C HamanoMar 15, 2006
  10. Qingning HuoMar 15, 2006
  11. Linus TorvaldsMar 15, 2006
  12. Junio C HamanoMar 15, 2006
  13. Qingning HuoMar 16, 2006
  14. Junio C HamanoMar 16, 2006
  15. Junio C HamanoMar 16, 2006
  16. Mark WoodingMar 16, 2006
  17. Andreas EricssonMar 16, 2006
  18. Junio C HamanoMar 17, 2006
  19. Mark WoodingMar 17, 2006
  20. Timo HirvonenMar 16, 2006
  21. Andreas EricssonMar 16, 2006
  22. Qingning HuoMar 16, 2006
  23. Junio C HamanoMar 16, 2006
  24. Andreas EricssonMar 16, 2006
  25. Jon LoeligerMar 16, 2006
  26. Jon LoeligerMar 16, 2006
  27. Junio C HamanoMar 16, 2006

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.