Re: Should git-prune-script warn about dircache?
- From
Junio C Hamano <junkio@cox.net>
- Date
- May 1, 2005, 17:20 UTC
- Message-ID
- <7vll6yyiax.fsf@assigned-by-dhcp.cox.net>
- In-Reply-To
- <Pine.LNX.4.58.0505010916510.2296@ppc970.osdl.org>
>>>>> "LT" == Linus Torvalds <torvalds@osdl.org> writes:
LT> How about making git-prune-script first run "git-update-cache --refresh", LT> and checking the return value of it (this, of course, assumes that LT> git-update-cache --refresh would return non-zero if it can't refresh a LT> file, which is currently not true, but should be easily fixable).
Or just check if it sees anything in the output, especially "needs update" line.
I do not think it is such a big deal [*1*] but I should point out that, "git-update-cache --refresh" needs to be run on all of them if the user (or the porcelain layer) is using more than one GIT_INDEX_FILEs [*2*].
[Footnotes]
*1* Because git-prune-script is just an example and it already assumes it knows where the valid heads are; right now it looks only at .git/HEAD and not .git/refs/*/*. Each Porcelain layer implementation should provide its own prune script anyway.
*2* I do not do this anymore but an earlier incarnation of my little SCM on GIT [*3*] allowed a user to keep snapshots of work tree state and switch between them by juggling multiple GIT_INDEX_FILE. I just create commits off of the current state when making a snapshot in the latest version so it is not a problem anymore for me.
*3* (PLUG) found in http://members.cox.net/junkio/.