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

Re: [PATCH] git-add: make the entry stat-clean after re-adding the same contents

From
Linus Torvalds <torvalds@linux-foundation.org>
Date
Nov 10, 2007, 02:43 UTC
Message-ID
<alpine.LFD.0.999.0711091840120.15101@woody.linux-foundation.org>
In-Reply-To
<7vzlxmq1oj.fsf_-_@gitster.siamese.dyndns.org>
On Fri, 9 Nov 2007, Junio C Hamano wrote:
>  
> -int run_diff_files(struct rev_info *revs, int silent_on_removed)
> +int run_diff_files(struct rev_info *revs, int option)
Wouldn't it be much better to now 
 - make it "unsigned int flags"
 - create a few enums or #define's to make the usage be more readable?
Because this:
>-       run_diff_files(&rev, 0);
>+       run_diff_files(&rev, 2);
> -	    !ie_modified(istate, istate->cache[pos], &st, 1)) {
> +	    !ie_match_stat(istate, istate->cache[pos], &st, 3)) {
just went from subtle to "incredibly non-obvious".

I realize that 3 is "silent + assume_racy" and 2 is just "assume_racy", but I may realize that now, and in a month? I'd need to look it up.

		Linus
Previous: Junio C HamanoNext: Junio C Hamano
Message 12 of 14 in “builtin-commit: Refresh cache after adding files.”
  1. builtin-commit: Refresh cache after adding files.Kristian Høgsberg, Nov 9, 2007
  2. Johannes SchindelinNov 9, 2007
  3. Kristian HøgsbergNov 9, 2007
  4. Johannes SchindelinNov 9, 2007
  5. Kristian HøgsbergNov 9, 2007
  6. Junio C HamanoNov 9, 2007
  7. Kristian HøgsbergNov 9, 2007
  8. Junio C HamanoNov 10, 2007
  9. Johannes SchindelinNov 10, 2007
  10. Junio C HamanoNov 10, 2007
  11. git-add: make the entry stat-clean after re-adding the same contentsJunio C Hamano, Nov 10, 2007
  12. Linus TorvaldsNov 10, 2007
  13. 1/2 ce_match_stat, run_diff_files: use symbolic constants for readabilityJunio C Hamano, Nov 10, 2007
  14. 2/2 git-add: make the entry stat-clean after re-adding the same contentsJunio C Hamano, Nov 10, 2007

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.