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

Re: [Bug report] diff.noprefix config is ignored for interactive `add`

From
Junio C Hamano <gitster@pobox.com>
Date
Apr 6, 2021, 21:57 UTC
Message-ID
<xmqqsg4313fp.fsf@gitster.g>
In-Reply-To
<YGzUerPL7V8jDxHo@coredump.intra.peff.net>
Jeff King <peff@peff.net> writes:
Show 10 quoted lines
> I imagine something like this:
> ...
> would work, but I didn't really test it. There's another hitch, which is
> that this subsystem has all been re-written in C. So we'd really want to
> implement it in the new code (possibly in both places, though maybe it
> is time to consider cutting over from the perl script to the C one by
> deafult?).
>
> But hopefully this illustrates the general idea, and gives somebody
> interested in the feature enough to work up their own patch.

These "cosmetic appearance" configuration that would affect the output from diff shown to the user would not be limited to just the .noprefix, though. Depending on the users, they would care just as deeply about any of these:

	.context
	.interHunkContext
	.mnemonicPrefix
        .noprefix
	.relative
	.orderFile
as Nikita does for .noprefix to send a bug report.

Luckily or unluckily, .suppressBlankEmpty and the per-filetype .xfuncname patterns do impact the output from the plumbing, because git_diff_basic_config() does read them, even though they are merely "cosmetic" configurations.

I am unsure how much we should cater to end-user controlled configuration when we are generating diff output for our own consumption, but if we were to tweak "add -p" and friends to pay attention to .noprefix, we probably should do the same for all the others.

Thanks.
Previous: Jeff KingNext: Jeff King
Message 3 of 4 in “[Bug report] diff.noprefix config is ignored for interactive `add`”
  1. Nikita BobkoApr 6, 2021
  2. Jeff KingApr 6, 2021
  3. Junio C HamanoApr 6, 2021
  4. Jeff KingApr 6, 2021

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.