git/list[1] front-page[2] threads[3] people[4] search[5] about
 

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
Previous: Jonas FonsecaNext: Andreas Gal
Message 3 of 4 in “Add --strict switch to diff-cache to force SHA1 checking”
  1. Add --strict switch to diff-cache to force SHA1 checkingJonas Fonseca, Apr 24, 2005
  2. Use diff-cache --strict in gitdiff.shJonas Fonseca, Apr 24, 2005
  3. Linus TorvaldsApr 24, 2005
  4. fix segfault in fsck-cache (2nd attempt)Andreas Gal, Apr 24, 2005

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.