Junio C Hamano wrote:
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@xxxxxx
OP5 AB www.op5.se
Tel: +46 8-230225 Fax: +46 8-230231
-
: send the line "unsubscribe git" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html