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

Re: GIT_TRACE doesn't show content filter files it's operating on

From
SBStas Bekman <stas@stason.org>
Date
Aug 28, 2018, 01:13 UTC
Message-ID
<9fc6cdcf-2e72-8eb1-9bcd-f513babd9c6f@stason.org>
In-Reply-To
<20180828005810.GA18659@sigill.intra.peff.net>

On 2018-08-27 05:58 PM, Jeff King wrote: [...]

Show 13 quoted lines
>> 2. Is there no way to get git to do the filename reporting as a normal
>> GIT_TRACE behavior? I don't know anything about its internal workings,
>> but it surely must knows which file it operates on when it opens it and
>> sends its data as stdin to the content filter. It makes the debugging so
>> much easier when one can see what files are being worked on. So perhaps
>> this utility can be made available to all not just as a hack/workaround.
> 
> No, because GIT_TRACE itself only reports on the execution of commands
> and sub-processes. There are other GIT_TRACE_* variables for various
> subsystems, but AFAIK nobody has instrumented the smudge/clean filter
> code. IMHO it would be reasonable to have a GIT_TRACE_CONVERT
> that covered convert.c (so these filters, but also newline conversion,
> etc).
Thank you, Jeff.

Would you please add this to the TODO list (if that's how new feature requests are made)?

I now know how get the filenames for "clean/smudge" filters. Can you please help with the same for "textconv". %f doesn't work - it gets stuck there waiting for stdin, the following seems to pass, but I'm not sure it's correct:

[diff "ipynb-code"]
	textconv = "f() { echo >&2 \"textconv: nbstripout -t $*\"; nbstripout
-t; }; cat $1 > f"
In a trace (git diff w/ one modified file) it gets invoked twice:
18:05:27.640955 run-command.c:640       trace: run_command: 'f() { echo
>&2 "textconv: nbstripout $*"; nbstripout -t; }; cat $1 > f'

/tmp/4nCYaT_004_callbacks.ipynb 18:05:27.642205 run-command.c:640 trace: run_command: 'f() { echo

>&2 "textconv: nbstripout $*"; nbstripout -t; }; cat $1 > f'
dev_nb/004_callbacks.ipynb
The first trace gives a tmp filename, whereas I need the actual filename.
Thank you.
-- 
________________________________________________
Stas Bekman       <'))))><       <'))))><
https://stasosphere.com  https://chestofbooks.com
https://experientialsexlab.com https://stason.org
https://stasosphere.com/experience-life/my-books
Previous: Jeff KingNext: Stas Bekman
Message 5 of 6 in “GIT_TRACE doesn't show content filter files it's operating on”
  1. Stas BekmanAug 27, 2018
  2. Jeff KingAug 27, 2018
  3. Stas BekmanAug 28, 2018
  4. Jeff KingAug 28, 2018
  5. Stas BekmanAug 28, 2018
  6. Stas BekmanAug 28, 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.