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

Re: [PATCH 0/2] Support diff.wordDiff config

From
Junio C Hamano <gitster@pobox.com>
Date
Mar 2, 2024, 17:03 UTC
Message-ID
<xmqqedcszhty.fsf@gitster.g>
In-Reply-To
<20240302095751.123138-1-karthik.188@gmail.com>
Karthik Nayak <karthik.188@gmail.com> writes:
> This patch series adds the diff.wordDiff config option. This mimics the
> '--word-diff' option of `git-diff(1)`.

Is it even be sensible to introduce this configuration variable in the first place? What would this do to users who set this variable and use third-party or their own scripts that run "git diff" under the hood?

The usual answer is "these tools should be using the low-level plumbing commands like diff-files, diff-index, and diff-tree", so I am not worried about it too much myself, and the above is purely the devil's advocate comment.

Having said that, running
	$ git grep -e 'git diff '

in the collection of scripts I use [*] to work on this project, I am reminded that I may have to be a bit more conservative than I currently am about the risk of breaking scripts with the changes like the one being proposed.

The proposed feature also may break those who use the git-prompt and diff-highlight available in conrib/, even though I am not sure how badly they would break, because I only looked at the lines given by this command:

	$ git grep -e 'git diff ' -- \*.sh ':!t/'
and didn't check how the output from 'git diff' is used.
[Footnote]
 * They can be seen in the 'todo' branch, if anybody is interested.
Previous: Jean-Noël AVILANext: Karthik Nayak
Message 8 of 17 in “Allow setting diff.worddiff=color via gitconfig”
  1. Olliver SchinaglFeb 28, 2024
  2. 0/2 Support diff.wordDiff configKarthik Nayak, Mar 2, 2024
  3. 1/2 t4034: extract out `diff_with_opts`Karthik Nayak, Mar 2, 2024
  4. 2/2 diff: add 'diff.wordDiff' config optionKarthik Nayak, Mar 2, 2024
  5. Eric SunshineMar 2, 2024
  6. Karthik NayakMar 2, 2024
  7. Jean-Noël AVILAMar 2, 2024
  8. Junio C HamanoMar 2, 2024
  9. Karthik NayakMar 2, 2024
  10. Kristoffer HaugsbakkMar 2, 2024
  11. Chris TorekMar 3, 2024
  12. Junio C HamanoMar 3, 2024
  13. Olliver SchinaglMar 22, 2024
  14. Dragan SimicMar 25, 2024
  15. Olliver SchinaglMar 22, 2024
  16. Olliver SchinaglMar 22, 2024
  17. Olliver SchinaglMar 22, 2024

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.