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

Re: [PATCH] Teach diff -B about colours

From
Johannes Schindelin <johannes.schindelin@gmx.de>
Date
Feb 20, 2007, 18:35 UTC
Message-ID
<Pine.LNX.4.63.0702201932100.22628@wbgn013.biozentrum.uni-wuerzburg.de>
In-Reply-To
<7vodnovgcs.fsf@assigned-by-dhcp.cox.net>
Hi,
On Tue, 20 Feb 2007, Junio C Hamano wrote:
Show 6 quoted lines
> Johannes Schindelin <Johannes.Schindelin@gmx.de> writes:
> 
> > Matthias Lederhofer noticed that `diff -B` did not pick up on diff 
> > colournig.
> 
> sp.?
s/colournig/colouring/
Show 11 quoted lines
> > -static void copy_file(int prefix, const char *data, int size)
> > +static void copy_file(int prefix, const char *data, int size,
> > +		const char *set, const char *reset)
> > ...
> >  	if (!nl_just_seen)
> > -		printf("\n\\ No newline at end of file\n");
> > +		printf("%s\n\\ No newline at end of file\n", reset);
> >  }
> 
> Are you sure about this one?  If preimage lacked terminating LF and the 
> postimage has it, then don't you want to see "\ No..." as an addition?
Yes, you're right. But I tried to imitate what git-diff does without -B.

Ciao, Dscho

Previous: Junio C Hamano
Message 4 of 4 in “[BUG] diff -B does not (always?) use colors”
  1. Matthias LederhoferFeb 20, 2007
  2. Teach diff -B about coloursJohannes Schindelin, Feb 20, 2007
  3. Junio C HamanoFeb 20, 2007
  4. Johannes SchindelinFeb 20, 2007

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.