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

4 messages, 4 authors, 2016-06-15 · open the first message on its own page

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

From: Junio C Hamano <hidden>
Date: 2016-06-15 22:41:58

quoted
quoted
quoted
quoted
"PB" == Petr Baudis [off-list ref] writes:
PB>   What do you think? Would you hate it to show up in the diffs, or are
PB> you ok with it?

I cannot tell if you are asking about cg-diff or changing the
built-in diff-* output.  The Subject: line suggests you are
talking about the latter, but if that is the case I have to
admit that I am not that sympathetic to Index: nor separator.

Like Linus, I do "/^diff --git .*" in my less sessions, which
gives a very nice highlighted separator line without wasting a
single line on the terminal.  If any of the readers on the list
didn't know about this trick (especially the trailing .* part),
please try it.  I'm certain everybody would love it.

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

From: Sean <hidden>
Date: 2016-06-15 22:41:58

On Sun, May 29, 2005 3:41 am, Junio C Hamano said:
quoted
quoted
quoted
quoted
quoted
"PB" == Petr Baudis [off-list ref] writes:
PB>   What do you think? Would you hate it to show up in the diffs, or are
PB> you ok with it?

I cannot tell if you are asking about cg-diff or changing the
built-in diff-* output.  The Subject: line suggests you are
talking about the latter, but if that is the case I have to
admit that I am not that sympathetic to Index: nor separator.

Like Linus, I do "/^diff --git .*" in my less sessions, which
gives a very nice highlighted separator line without wasting a
single line on the terminal.  If any of the readers on the list
didn't know about this trick (especially the trailing .* part),
please try it.  I'm certain everybody would love it.
It's good to know you can wrap this into a shell script too, which saves
you having to type the search string in "less" each time... something
like:

git-diff-tree "$@" | git-diff-helper | less -p "^diff --git .*"

Sean

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

From: Petr Baudis <hidden>
Date: 2016-06-15 22:41:58

Dear diary, on Sun, May 29, 2005 at 09:41:03AM CEST, I got a letter
where Junio C Hamano [off-list ref] told me that...
quoted
quoted
quoted
quoted
quoted
"PB" == Petr Baudis [off-list ref] writes:
PB>   What do you think? Would you hate it to show up in the diffs, or are
PB> you ok with it?

I cannot tell if you are asking about cg-diff or changing the
built-in diff-* output.  The Subject: line suggests you are
talking about the latter, but if that is the case I have to
admit that I am not that sympathetic to Index: nor separator.
Yes, I'm talking about the latter.
Like Linus, I do "/^diff --git .*" in my less sessions, which
gives a very nice highlighted separator line without wasting a
single line on the terminal.  If any of the readers on the list
didn't know about this trick (especially the trailing .* part),
please try it.  I'm certain everybody would love it.
When I do just cg-diff to see what I changed I usually do not pipe it to
less, and typing that / stuff seems insane (although /^d.* could give a
good approximation). OTOH I think I'll go for the diff output
colorification (at the Cogito level), so the separator indeed isn't
strictly necessary. I can live without it. :-)

-- 
				Petr "Pasky" Baudis
Stuff: http://pasky.or.cz/
C++: an octopus made by nailing extra legs onto a dog. -- Steve Taylor

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

From: Thomas Glanzmann <hidden>
Date: 2016-06-15 22:41:58

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
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help