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

Re: [PATCH] Built-in diff driver shows Index: line.

From
Linus Torvalds <torvalds@osdl.org>
Date
Apr 28, 2005, 22:30 UTC
Message-ID
<Pine.LNX.4.58.0504281522560.18901@ppc970.osdl.org>
In-Reply-To
<7vacni5z9y.fsf@assigned-by-dhcp.cox.net>
On Thu, 28 Apr 2005, Junio C Hamano wrote:
> 
> So I'd say we'd punt this one for now, unless somebody else has
> a better idea.
It's trivially easy to do it with a external diff helper.

So you can do it with a few lines of GIT_EXTERNAL_DIFF, and the hardest part is showing it in a nice format (ie do the normalization of the results that diffstat does).

The external diff program can _literally_ just do something like
	#!/bin/sh
	name="$1"
	src="$2"
	dst="$5"
	diff "$src" "$dst" | cut -c1 | grep '[<>]' | sort | uniq -c
and the output should be something like
    458 <
    104 >

which means "458 lines removed, 104 lines added". Pretty-print it some, and you're done.

Hacky hacky,
		Linus
Previous: Junio C HamanoNext: Junio C Hamano
Message 4 of 5 in “Built-in diff driver shows Index: line.”
  1. Built-in diff driver shows Index: line.Junio C Hamano, Apr 28, 2005
  2. Linus TorvaldsApr 28, 2005
  3. Junio C HamanoApr 28, 2005
  4. Linus TorvaldsApr 28, 2005
  5. Junio C HamanoApr 28, 2005

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.