Re: [PATCH] Add --strict switch to diff-cache to force SHA1 checking
- From
Linus Torvalds <torvalds@osdl.org>
- Date
- Apr 24, 2005, 03:57 UTC
- Message-ID
- <Pine.LNX.4.58.0504232056160.2344@ppc970.osdl.org>
- In-Reply-To
- <20050424033554.GA23293@diku.dk>
On Sun, 24 Apr 2005, Jonas Fonseca wrote:
Show 6 quoted lines
> > It seems by far the easiest to let diff-cache take care of skipping > files which have not been modified. The alternative is to keep > diff-cache's lazy checking and make cogito's diff jump through hoops. > Note, although the new SHA1 signature is derived, diff-cache still > prints the special no-SHA1 for the modified file.
The reason I don't want this is that if the commands keep on silently fixing things like this up, then performance will go down the toilet.
What _should_ happen is that you do an "update-cache --refresh" before doing the diff-cache. That way you do _not_ end up having to check the sha1 match over and over again if you just did a "touch" on the file.
In other words, you're adding bandage for a problem that shouldn't exist, and you're doing it in a way which means that _if_ the problem exists, you'll never fix it, but you'll just rely on your bandage all the time.
So cogito definitely does not have to jump through any hoops at all. It should just make sure to keep the cache up-to-date if it ever cares (ie do "update-cache --refresh").
Some commands obviously won't care.
Linus