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

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

From
TGThomas Glanzmann <sithglan@stud.uni-erlangen.de>
Date
May 29, 2005, 12:36 UTC
Message-ID
<20050529123624.GJ4881@cip.informatik.uni-erlangen.de>
In-Reply-To
<2788.10.10.10.24.1117353158.squirrel@linux1>

Hello, I actually use the following bash script to browse the diffs with what-changed:

(faui03) [~/work/monitor] git-whatchanged -p | cdiff ...

# COLORDEFINITIONS BLACK="" RED="" GREEN="" YELLO="" BLUE="" PURPLE="" CYAN="" WHITE="" END="" REVERSE=""

cdiff()
{
	cat $1 | \
	sed -e " \
		s/^\(diff-tree\)\(.*\)/\1${RED}\2${END}/; \
	        s/^+.*/$RED&$END/;  \
		s/^-.*/$BLUE&$END/;  \
		s/^@.*/$GREEN&$END/;  \
		s/^Date.*/$RED&$END/;  \
		s/^Author.*/$RED&$END/; \
		" | less -R -i -p "^diff-tree"
		# This would highlight manpages but the last line clashes with cdiff
		# --tg 00:52 05-05-26
		#s/^[A-Z]\+[A-Z ]\+$/$RED&$END/; \
		#s/[A-Z]\+([0-9])/$RED&$END/g; \
		# s/\W--\?[0-9a-zA-Z=-]\+/$BLUE&$END/g; \
}
Gruesse,
	Thomas
Previous: SeanNext: Petr Baudis
Message 4 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.