"Gumbel, Matthew K" [off-list ref] writes:
"Junio C Hamano" [off-list ref] writes:
quoted
There probably are other things that can be optimized.
Yes, I think that when the user passes --only flag to git-commit, then git does not
need to call refresh_cache() in prepare_index() in builtin/commit.c.
I may experiment with that. Do you see any downside or negative side-effects?
There may be other fallouts, but one that immediately comes to mind
is that it may break pre-commit hook.
When we get "--only", we prepare an temporary index to create the
commit out of, and give it to the pre-commit hook. The hook expects
that the cached stat information is up-to-date, iow, it does not
have to do 'update-index --refresh' before using plumbing commands
like "diff-index" to do its own inspection of the working tree.
"Junio C Hamano <mailto:jch2355@gmail.com> writes:
"Gumbel, Matthew K" [off-list ref] writes:
quoted
Yes, I think that when the user passes --only flag to git-commit, then git does not
need to call refresh_cache() in prepare_index() in builtin/commit.c.
I may experiment with that. Do you see any downside or negative side-effects?
There may be other fallouts, but one that immediately comes to mind
is that it may break pre-commit hook.
If pre-commit hook exists, we can fall-back to original behavior and call
refresh_cache(). Many repos will not have pre-commit hook and can
benefit from the speedup.
I'm testing such a change locally. Git test suite seems to be running for quite
a while. Do you know any way to run it in parallel or otherwise speed it
up?
Thanks,
Matt
On Thu, Feb 02, 2017 at 12:14:30AM +0000, Gumbel, Matthew K wrote:
I'm testing such a change locally. Git test suite seems to be running for quite
a while. Do you know any way to run it in parallel or otherwise speed it
up?
I usually do something like the following:
make -j3 all && (cd t && GIT_PROVE_OPTS=-j3 make prove)
This, of course, requires that you have Perl's prove installed, which
has been part of core Perl since 5.10.1.
--
brian m. carlson / brian with sandals: Houston, Texas, US
+1 832 623 2791 | https://www.crustytoothpaste.net/~bmc | My opinion only
OpenPGP: https://keybase.io/bk2204