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

Re: [PATCH 4/6] fsmonitor: Add a trailing newline to test-dump-fsmonitor

From
AVAlex Vandiver <alexmv@dropbox.com>
Date
Dec 21, 2017, 01:55 UTC
Message-ID
<alpine.DEB.2.10.1712201744270.15915@alexmv-linux>
In-Reply-To
<xmqqlghyv4wz.fsf@gitster.mtv.corp.google.com>
On Tue, 19 Dec 2017, Junio C Hamano wrote:
Show 14 quoted lines
> That (and existing) uses of printf() all feel a bit overkill ;-)
> Perhaps putchar() would suffice.
> 
> I am not sure if the above wants to become something like
> 
> 	for (i = 0; i < istate->cache_nr; i++) {
>         	putchar(istate->cache[i]->ce_flags & CE_FSMONITOR_VALID ? '+' : '-');
> 		quote_c_style(istate->cache[i]->name, NULL, stdout, 0);
> 		putchar('\n');
> 	}
> 
> instead of "a single long incomplete line" in the first place.  Your
> "fix" merely turns it into "a single long complete line", which does
> not quite feel big enough an improvement, at least to me.

The more user-digestable form like you describe already exists by way of `git ls-files -f`. I am not sure it is worth replicating it.

The only current uses of this tool are in tests, which only examine the first ("no fsmonitor" / "fsmonitor last update ...") line. I find it useful as a brief summary view of the fsmonitor bits, but I suppose I'd also be happy with just presence/absence and a count of set/unset bits.

Barring objections from Dscho or Ben, I'll reroll with a version that shows something like:

    fsmonitor last update 1513821151547101894 (5 seconds ago)
    5 files valid / 10 files invalid
 - Alex
Previous: Junio C HamanoNext: Junio C Hamano
Message 9 of 16 in “Minor fsmonitor bugfixes, use with `git diff`”
  1. 0/6 Minor fsmonitor bugfixes, use with `git diff`Alex Vandiver, Dec 19, 2017
  2. 1/6 Fix comments to agree with argument nameAlex Vandiver, Dec 19, 2017
  3. 2/6 fsmonitor: Add dir.h include, for untracked_cache_invalidate_pathAlex Vandiver, Dec 19, 2017
  4. Junio C HamanoDec 19, 2017
  5. Alex VandiverDec 20, 2017
  6. Junio C HamanoDec 21, 2017
  7. 4/6 fsmonitor: Add a trailing newline to test-dump-fsmonitorAlex Vandiver, Dec 19, 2017
  8. Junio C HamanoDec 19, 2017
  9. Alex VandiverDec 21, 2017
  10. Junio C HamanoDec 21, 2017
  11. 3/6 fsmonitor: Update helper tool, now that flags are filled laterAlex Vandiver, Dec 19, 2017
  12. Alex VandiverDec 20, 2017
  13. 6/6 fsmonitor: Use fsmonitor data in `git diff`Alex Vandiver, Dec 19, 2017
  14. 5/6 fsmonitor: Remove debugging lines from t/t7519-status-fsmonitor.shAlex Vandiver, Dec 19, 2017
  15. Junio C HamanoDec 19, 2017
  16. Johannes SchindelinDec 20, 2017

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.