* Get rid of refreshing cache after "git commit"?
@ 2010-01-17 8:16 Nguyen Thai Ngoc Duy
2010-01-17 8:27 ` Junio C Hamano
0 siblings, 1 reply; 2+ messages in thread
From: Nguyen Thai Ngoc Duy @ 2010-01-17 8:16 UTC (permalink / raw)
To: Git Mailing List
Hi,
The current "git commit" refreshes cache and writes out after a
commit. I dug back in history to see how it was introduced. It looks
like from the very first days of "git commit", which was
git-commit-script at that time, git-update-cache was called on
specified paths, until commit 22cff6a (git-commit: pass explicit path
to git-diff-files. - 2005-08-16) started to do "git-update-cache -q
--refresh" without paths and the tradition keeps going until today.
Nowadays almost (all?) porcelain commands silently refresh index
before doing anything relating to worktree, I wonder if this tradition
is still necessary. On (again) gentoo-x86 repository, taking out the
refresh part could cut down about 1 sec on total 3 secs from "git
commit -m foo".
--
Duy
^ permalink raw reply [flat|nested] 2+ messages in thread
* Re: Get rid of refreshing cache after "git commit"?
2010-01-17 8:16 Get rid of refreshing cache after "git commit"? Nguyen Thai Ngoc Duy
@ 2010-01-17 8:27 ` Junio C Hamano
0 siblings, 0 replies; 2+ messages in thread
From: Junio C Hamano @ 2010-01-17 8:27 UTC (permalink / raw)
To: Nguyen Thai Ngoc Duy; +Cc: Git Mailing List
Nguyen Thai Ngoc Duy <pclouds@gmail.com> writes:
> Nowadays almost (all?) porcelain commands silently refresh index
> before doing anything relating to worktree, I wonder if this tradition
> is still necessary.
Inside "commit", various checks to see if/how worktree files are changed
are attempted by the libified diff-files/diff-index and they must be used
after you refresh the cache entries.
"git commit" (without paths) does not necessarily have to when you can
prove that the user never looks at .git/COMMIT_EDITMSG (e.g. "-F file" is
given without "-e"), but otherwise you need to refresh the index to show
the correct status in the message buffer.
"git commit paths..." must refresh the named paths (not necessarily the
whole index), but again you would need the whole index to show the status
correctly.
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2010-01-17 8:27 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2010-01-17 8:16 Get rid of refreshing cache after "git commit"? Nguyen Thai Ngoc Duy
2010-01-17 8:27 ` Junio C Hamano
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).