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

Re: [PATCH 6/6] fsmonitor: Use fsmonitor data in `git diff`

From
Junio C Hamano <gitster@pobox.com>
Date
Jan 5, 2018, 22:22 UTC
Message-ID
<xmqqefn4aqt8.fsf@gitster.mtv.corp.google.com>
In-Reply-To
<alpine.DEB.2.21.1.1801042335130.32@MININT-6BKU6QN.europe.corp.microsoft.com>
Johannes Schindelin <Johannes.Schindelin@gmx.de> writes:
Show 21 quoted lines
>> diff --git a/diff-lib.c b/diff-lib.c
>> index 8104603a3..13ff00d81 100644
>> --- a/diff-lib.c
>> +++ b/diff-lib.c
>> @@ -95,6 +95,9 @@ int run_diff_files(struct rev_info *revs, unsigned int option)
>>  
>>  	diff_set_mnemonic_prefix(&revs->diffopt, "i/", "w/");
>>  
>> +	if (!(option & DIFF_SKIP_FSMONITOR))
>> +		refresh_fsmonitor(&the_index);
>> +
>>  	if (diff_unmerged_stage < 0)
>>  		diff_unmerged_stage = 2;
>
> I read over this hunk five times, and only now am I able to wrap my head
> around this: if we do *not* want to skip the fsmonitor data, we refresh
> the fsmonitor data in the index.
>
> That feels a bit like an unneeded double negation. Speaking for myself, I
> would prefore `DIFF_IGNORE_FSMONITOR` instead, it would feel less like a
> double negation then. But I am not a native speaker, so I might be wrong.
I do find the logic a bit convoluted with double negative.
Previous: Johannes SchindelinNext: Ben Peart
Message 5 of 15 in “Minor fsmonitor bugfixes, use with `git diff`”
  1. 0/6 Minor fsmonitor bugfixes, use with `git diff`Alex Vandiver, Jan 3, 2018
  2. 1/6 Fix comments to agree with argument nameAlex Vandiver, Jan 3, 2018
  3. 6/6 fsmonitor: Use fsmonitor data in `git diff`Alex Vandiver, Jan 3, 2018
  4. Johannes SchindelinJan 4, 2018
  5. Junio C HamanoJan 5, 2018
  6. Ben PeartJan 8, 2018
  7. 5/6 fsmonitor: Remove debugging lines from t/t7519-status-fsmonitor.shAlex Vandiver, Jan 3, 2018
  8. 2/6 fsmonitor: Stop inline'ing mark_fsmonitor_valid / _invalidAlex Vandiver, Jan 3, 2018
  9. Johannes SchindelinJan 4, 2018
  10. Ben PeartJan 8, 2018
  11. 4/6 fsmonitor: Make output of test-dump-fsmonitor more conciseAlex Vandiver, Jan 3, 2018
  12. Johannes SchindelinJan 4, 2018
  13. Ben PeartJan 8, 2018
  14. 3/6 fsmonitor: Update helper tool, now that flags are filled laterAlex Vandiver, Jan 3, 2018
  15. Johannes SchindelinJan 4, 2018

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.