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

Re: [PATCH] git-add--interactive.perl: Permit word-based diff

From
Jeff King <peff@peff.net>
Date
Jun 18, 2013, 06:31 UTC
Message-ID
<20130618063144.GA6276@sigill.intra.peff.net>
In-Reply-To
<CAMNuMARruu+1=kny=g5O1MoxCXuoT3BHdSEEPSqvyn2t2JsAYg@mail.gmail.com>
On Sat, Jun 15, 2013 at 04:01:04PM +0200, Mark Abraham wrote:
Show 8 quoted lines
> Controlled by new configuration option
> "color.word-diff-in-interactive-add". There is no existing support for
> "git add" to pass a command-line option like "--word-diff=color" to
> git-add--interactive.perl, so a configuration option is the only
> lightweight solution.
> 
> With this feature, the added or deleted form of a hunk can be empty,
> so made some necessary checks for $_ being defined.

Hmm. We can't apply a word-diff, so presumably your "permit" here is just for the display, replacing the colorized bits. And that looks like what your patch does.

Note that the number of lines in your --word-diff=color hunk and the actual diff will not necessarily be the same. What happens if I split a hunk with your patch?

-Peff
Next: Thomas Rast
Message 1 of 5 in “Re: [PATCH] git-add--interactive.perl: Permit word-based diff”
  1. Jeff KingJun 18, 2013
  2. Thomas RastJun 18, 2013
  3. Jeff KingJun 18, 2013
  4. Mark AbrahamJun 18, 2013
  5. Jeff KingJun 18, 2013

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.