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

Re: -p diff output and the 'Index:' line

From
Petr Baudis <pasky@ucw.cz>
Date
May 29, 2005, 19:03 UTC
Message-ID
<20050529190305.GP1036@pasky.ji.cz>
In-Reply-To
<7vekbpq56r.fsf@assigned-by-dhcp.cox.net>

Dear diary, on Sun, May 29, 2005 at 08:04:44PM CEST, I got a letter where Junio C Hamano <junkio@cox.net> told me that...

Show 6 quoted lines
> You said you do not do "less", so the following may not apply to
> your usage, but I disagree your comment about "typing that /
> stuff seems insane".  Sean's workaround to use "less -p '^diff
> --git .*'" in a script, combined with typing 'n' in a "less"
> session to find the next such line, would make it very pleasant
> to use.
(As long as you don't want to search for something else. ;-)
But yes, I like the less -p hack.
Show 11 quoted lines
> PB> OTOH I think I'll go for the diff output colorification (at
> PB> the Cogito level), so the separator indeed isn't strictly
> PB> necessary. I can live without it. :-)
> 
> When I want to make a customized diff output out of the "diff-*
> -p' command, I find it a lot easier to use the GIT_EXTERNAL_DIFF
> mechanism than parsing what comes out of "diff-* -p" and munging
> it.  I am not _telling_, _ordering_, nor even _asking_ you to
> use GIT_EXTERNAL_DIFF; just suggesting you to consider that as a
> way to possibly make your implementation easier.  I'd start from
> the supplied git-external-diff-script and go from there.

It's just something along the lines of "Me Og. Og sees /^+/. Og makes the line green." written in gawk (actually I'm not sure if pure awk wouldn't do, but I actually don't know the language), so I don't think the external diff thing would've helped me with that in any way.

-- 
				Petr "Pasky" Baudis
Stuff: http://pasky.or.cz/
C++: an octopus made by nailing extra legs onto a dog. -- Steve Taylor
Previous: Junio C HamanoNext: Junio C Hamano
Message 7 of 9 in “-p diff output and the 'Index:' line”
  1. Petr BaudisMay 29, 2005
  2. Junio C HamanoMay 29, 2005
  3. SeanMay 29, 2005
  4. Thomas GlanzmannMay 29, 2005
  5. Petr BaudisMay 29, 2005
  6. Junio C HamanoMay 29, 2005
  7. Petr BaudisMay 29, 2005
  8. Junio C HamanoMay 30, 2005
  9. Petr BaudisMay 30, 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.