{"thread":{"id":"756","subject":"-p diff output and the 'Index:' line","startedAt":"2005-05-29T07:15:20Z","lastAt":"2005-05-30T08:30:52Z","messageCount":9,"participants":["Petr Baudis","Junio C Hamano","Sean","Thomas Glanzmann"],"isPatch":false,"patchVersion":null,"patchTotal":null},"messages":[{"id":"4156","messageId":"20050529071520.GC1036@pasky.ji.cz","threadId":"756","inReplyTo":null,"subject":"-p diff output and the 'Index:' line","fromName":"Petr Baudis","fromEmail":"pasky@ucw.cz","sentAt":"2005-05-29T07:15:20Z","receivedAt":"2005-05-29T07:15:20Z","isPatch":false,"sender":{"key":"pasky@ucw.cz","avatar":"https://avatars.githubusercontent.com/u/18439?v=4"},"body":"  Hello,\n\n  so I've tried how would cg-diff output look like if I used the\ngit-diff -p argument, and I found that I miss the 'Index:' line.\nActually, what I really miss is the separator ==== line just below, but\nit'd probably look weird without the 'Index:' line. I became used to the\nseparators and they enable me to quickly visually notice the files\nboundary, which is more drudging if you have just the 'diff --git' line.\n\n  What do you think? Would you hate it to show up in the diffs, or are\nyou ok with it?\n\n  Thanks,\n\n-- \n\t\t\t\tPetr \"Pasky\" Baudis\nStuff: http://pasky.or.cz/\nC++: an octopus made by nailing extra legs onto a dog. -- Steve Taylor\n"},{"id":"4157","messageId":"7vd5raqy28.fsf@assigned-by-dhcp.cox.net","threadId":"756","inReplyTo":"20050529071520.GC1036@pasky.ji.cz","subject":"Re: -p diff output and the 'Index:' line","fromName":"Junio C Hamano","fromEmail":"junkio@cox.net","sentAt":"2005-05-29T07:41:03Z","receivedAt":"2005-05-29T07:41:03Z","isPatch":false,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":">>>>> \"PB\" == Petr Baudis <pasky@ucw.cz> writes:\n\nPB>   What do you think? Would you hate it to show up in the diffs, or are\nPB> you ok with it?\n\nI cannot tell if you are asking about cg-diff or changing the\nbuilt-in diff-* output.  The Subject: line suggests you are\ntalking about the latter, but if that is the case I have to\nadmit that I am not that sympathetic to Index: nor separator.\n\nLike Linus, I do \"/^diff --git .*\" in my less sessions, which\ngives a very nice highlighted separator line without wasting a\nsingle line on the terminal.  If any of the readers on the list\ndidn't know about this trick (especially the trailing .* part),\nplease try it.  I'm certain everybody would love it.\n\n"},{"id":"4158","messageId":"2788.10.10.10.24.1117353158.squirrel@linux1","threadId":"756","inReplyTo":"7vd5raqy28.fsf@assigned-by-dhcp.cox.net","subject":"Re: -p diff output and the 'Index:' line","fromName":"Sean","fromEmail":"seanlkml@sympatico.ca","sentAt":"2005-05-29T07:52:38Z","receivedAt":"2005-05-29T07:52:38Z","isPatch":false,"sender":{"key":"seanlkml@sympatico.ca","avatar":"https://gravatar.com/avatar/f92923f54fc08c401fc59b71829d4b89e9b8087fbba45ff87c82e6a83aee02ae?d=mp&s=160"},"body":"On Sun, May 29, 2005 3:41 am, Junio C Hamano said:\n>>>>>> \"PB\" == Petr Baudis <pasky@ucw.cz> writes:\n>\n> PB>   What do you think? Would you hate it to show up in the diffs, or are\n> PB> you ok with it?\n>\n> I cannot tell if you are asking about cg-diff or changing the\n> built-in diff-* output.  The Subject: line suggests you are\n> talking about the latter, but if that is the case I have to\n> admit that I am not that sympathetic to Index: nor separator.\n>\n> Like Linus, I do \"/^diff --git .*\" in my less sessions, which\n> gives a very nice highlighted separator line without wasting a\n> single line on the terminal.  If any of the readers on the list\n> didn't know about this trick (especially the trailing .* part),\n> please try it.  I'm certain everybody would love it.\n\nIt's good to know you can wrap this into a shell script too, which saves\nyou having to type the search string in \"less\" each time... something\nlike:\n\ngit-diff-tree \"$@\" | git-diff-helper | less -p \"^diff --git .*\"\n\nSean\n\n\n"},{"id":"4163","messageId":"20050529120248.GD1036@pasky.ji.cz","threadId":"756","inReplyTo":"7vd5raqy28.fsf@assigned-by-dhcp.cox.net","subject":"Re: -p diff output and the 'Index:' line","fromName":"Petr Baudis","fromEmail":"pasky@ucw.cz","sentAt":"2005-05-29T12:02:49Z","receivedAt":"2005-05-29T12:02:49Z","isPatch":false,"sender":{"key":"pasky@ucw.cz","avatar":"https://avatars.githubusercontent.com/u/18439?v=4"},"body":"Dear diary, on Sun, May 29, 2005 at 09:41:03AM CEST, I got a letter\nwhere Junio C Hamano <junkio@cox.net> told me that...\n> >>>>> \"PB\" == Petr Baudis <pasky@ucw.cz> writes:\n> \n> PB>   What do you think? Would you hate it to show up in the diffs, or are\n> PB> you ok with it?\n> \n> I cannot tell if you are asking about cg-diff or changing the\n> built-in diff-* output.  The Subject: line suggests you are\n> talking about the latter, but if that is the case I have to\n> admit that I am not that sympathetic to Index: nor separator.\n\nYes, I'm talking about the latter.\n\n> Like Linus, I do \"/^diff --git .*\" in my less sessions, which\n> gives a very nice highlighted separator line without wasting a\n> single line on the terminal.  If any of the readers on the list\n> didn't know about this trick (especially the trailing .* part),\n> please try it.  I'm certain everybody would love it.\n\nWhen I do just cg-diff to see what I changed I usually do not pipe it to\nless, and typing that / stuff seems insane (although /^d.* could give a\ngood approximation). OTOH I think I'll go for the diff output\ncolorification (at the Cogito level), so the separator indeed isn't\nstrictly necessary. I can live without it. :-)\n\n-- \n\t\t\t\tPetr \"Pasky\" Baudis\nStuff: http://pasky.or.cz/\nC++: an octopus made by nailing extra legs onto a dog. -- Steve Taylor\n"},{"id":"4166","messageId":"20050529123624.GJ4881@cip.informatik.uni-erlangen.de","threadId":"756","inReplyTo":"2788.10.10.10.24.1117353158.squirrel@linux1","subject":"Re: -p diff output and the 'Index:' line","fromName":"Thomas Glanzmann","fromEmail":"sithglan@stud.uni-erlangen.de","sentAt":"2005-05-29T12:36:24Z","receivedAt":"2005-05-29T12:36:24Z","isPatch":false,"sender":{"key":"sithglan@stud.uni-erlangen.de","avatar":null},"body":"Hello,\nI actually use the following bash script to browse the diffs with\nwhat-changed:\n\n(faui03) [~/work/monitor] git-whatchanged -p | cdiff\n...\n\n\n# COLORDEFINITIONS\nBLACK=\"\u001b[0;30m\"\nRED=\"\u001b[0;31m\"\nGREEN=\"\u001b[0;32m\"\nYELLO=\"\u001b[0;33m\"\nBLUE=\"\u001b[0;34m\"\nPURPLE=\"\u001b[0;35m\"\nCYAN=\"\u001b[0;36m\"\nWHITE=\"\u001b[0;37m\"\nEND=\"\u001b[0m\"\nREVERSE=\"\u001b[7m\"\n\ncdiff()\n{\n\tcat $1 | \\\n\tsed -e \" \\\n\t\ts/^\\(diff-tree\\)\\(.*\\)/\\1${RED}\\2${END}/; \\\n\t        s/^+.*/$RED&$END/;  \\\n\t\ts/^-.*/$BLUE&$END/;  \\\n\t\ts/^@.*/$GREEN&$END/;  \\\n\t\ts/^Date.*/$RED&$END/;  \\\n\t\ts/^Author.*/$RED&$END/; \\\n\t\t\" | less -R -i -p \"^diff-tree\"\n\n\t\t# This would highlight manpages but the last line clashes with cdiff\n\t\t# --tg 00:52 05-05-26\n\t\t#s/^[A-Z]\\+[A-Z ]\\+$/$RED&$END/; \\\n\t\t#s/[A-Z]\\+([0-9])/$RED&$END/g; \\\n\t\t# s/\\W--\\?[0-9a-zA-Z=-]\\+/$BLUE&$END/g; \\\n}\n\nGruesse,\n\tThomas\n"},{"id":"4177","messageId":"7vekbpq56r.fsf@assigned-by-dhcp.cox.net","threadId":"756","inReplyTo":"20050529120248.GD1036@pasky.ji.cz","subject":"Re: -p diff output and the 'Index:' line","fromName":"Junio C Hamano","fromEmail":"junkio@cox.net","sentAt":"2005-05-29T18:04:44Z","receivedAt":"2005-05-29T18:04:44Z","isPatch":false,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":">>>>> \"PB\" == Petr Baudis <pasky@ucw.cz> writes:\n\n>> Like Linus, I do \"/^diff --git .*\" in my less sessions, which\n>> gives a very nice highlighted separator line without wasting a\n>> single line on the terminal.  If any of the readers on the list\n>> didn't know about this trick (especially the trailing .* part),\n>> please try it.  I'm certain everybody would love it.\n\nPB> When I do just cg-diff to see what I changed I usually do not pipe it to\nPB> less, and typing that / stuff seems insane (although /^d.* could give a\nPB> good approximation).\n\nYou said you do not do \"less\", so the following may not apply to\nyour usage, but I disagree your comment about \"typing that /\nstuff seems insane\".  Sean's workaround to use \"less -p '^diff\n--git .*'\" in a script, combined with typing 'n' in a \"less\"\nsession to find the next such line, would make it very pleasant\nto use.\n\nPB> OTOH I think I'll go for the diff output colorification (at\nPB> the Cogito level), so the separator indeed isn't strictly\nPB> necessary. I can live without it. :-)\n\nWhen I want to make a customized diff output out of the \"diff-*\n-p' command, I find it a lot easier to use the GIT_EXTERNAL_DIFF\nmechanism than parsing what comes out of \"diff-* -p\" and munging\nit.  I am not _telling_, _ordering_, nor even _asking_ you to\nuse GIT_EXTERNAL_DIFF; just suggesting you to consider that as a\nway to possibly make your implementation easier.  I'd start from\nthe supplied git-external-diff-script and go from there.\n\n"},{"id":"4189","messageId":"20050529190305.GP1036@pasky.ji.cz","threadId":"756","inReplyTo":"7vekbpq56r.fsf@assigned-by-dhcp.cox.net","subject":"Re: -p diff output and the 'Index:' line","fromName":"Petr Baudis","fromEmail":"pasky@ucw.cz","sentAt":"2005-05-29T19:03:05Z","receivedAt":"2005-05-29T19:03:05Z","isPatch":false,"sender":{"key":"pasky@ucw.cz","avatar":"https://avatars.githubusercontent.com/u/18439?v=4"},"body":"Dear diary, on Sun, May 29, 2005 at 08:04:44PM CEST, I got a letter\nwhere Junio C Hamano <junkio@cox.net> told me that...\n> You said you do not do \"less\", so the following may not apply to\n> your usage, but I disagree your comment about \"typing that /\n> stuff seems insane\".  Sean's workaround to use \"less -p '^diff\n> --git .*'\" in a script, combined with typing 'n' in a \"less\"\n> session to find the next such line, would make it very pleasant\n> to use.\n\n(As long as you don't want to search for something else. ;-)\n\nBut yes, I like the less -p hack.\n\n> PB> OTOH I think I'll go for the diff output colorification (at\n> PB> the Cogito level), so the separator indeed isn't strictly\n> PB> necessary. I can live without it. :-)\n> \n> When I want to make a customized diff output out of the \"diff-*\n> -p' command, I find it a lot easier to use the GIT_EXTERNAL_DIFF\n> mechanism than parsing what comes out of \"diff-* -p\" and munging\n> it.  I am not _telling_, _ordering_, nor even _asking_ you to\n> use GIT_EXTERNAL_DIFF; just suggesting you to consider that as a\n> way to possibly make your implementation easier.  I'd start from\n> the supplied git-external-diff-script and go from there.\n\nIt's just something along the lines of \"Me Og. Og sees /^+/. Og makes\nthe line green.\" written in gawk (actually I'm not sure if pure awk\nwouldn't do, but I actually don't know the language), so I don't think\nthe external diff thing would've helped me with that in any way.\n\n-- \n\t\t\t\tPetr \"Pasky\" Baudis\nStuff: http://pasky.or.cz/\nC++: an octopus made by nailing extra legs onto a dog. -- Steve Taylor\n"},{"id":"4241","messageId":"7v7jhh6ty5.fsf@assigned-by-dhcp.cox.net","threadId":"756","inReplyTo":"20050529190305.GP1036@pasky.ji.cz","subject":"Re: -p diff output and the 'Index:' line","fromName":"Junio C Hamano","fromEmail":"junkio@cox.net","sentAt":"2005-05-30T07:42:26Z","receivedAt":"2005-05-30T07:42:26Z","isPatch":false,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":">>>>> \"PB\" == Petr Baudis <pasky@ucw.cz> writes:\n\nPB> It's just something along the lines of \"Me Og. Og sees /^+/. Og makes\nPB> the line green.\" written in gawk (actually I'm not sure if pure awk\nPB> wouldn't do, but I actually don't know the language), so I don't think\nPB> the external diff thing would've helped me with that in any way.\n\nAh, I see.  I thought you were talking about the Index: and\nseparator lines.  Colorizing diff/patch part, you need to parse\nthe diff output with sed/awk/perl and annotate it anyway, and it\ndoes not matter if you annotate within GIT_EXTERNAL_DIFF or\noutside.  I agree with you that using GIT_EXTERNAL_DIFF\nmechanism would not help you here.\n\n\n\n\n"},{"id":"4245","messageId":"20050530083052.GC1036@pasky.ji.cz","threadId":"756","inReplyTo":"7v7jhh6ty5.fsf@assigned-by-dhcp.cox.net","subject":"Re: -p diff output and the 'Index:' line","fromName":"Petr Baudis","fromEmail":"pasky@ucw.cz","sentAt":"2005-05-30T08:30:52Z","receivedAt":"2005-05-30T08:30:52Z","isPatch":false,"sender":{"key":"pasky@ucw.cz","avatar":"https://avatars.githubusercontent.com/u/18439?v=4"},"body":"Dear diary, on Mon, May 30, 2005 at 09:42:26AM CEST, I got a letter\nwhere Junio C Hamano <junkio@cox.net> told me that...\n> >>>>> \"PB\" == Petr Baudis <pasky@ucw.cz> writes:\n> \n> PB> It's just something along the lines of \"Me Og. Og sees /^+/. Og makes\n> PB> the line green.\" written in gawk (actually I'm not sure if pure awk\n> PB> wouldn't do, but I actually don't know the language), so I don't think\n> PB> the external diff thing would've helped me with that in any way.\n> \n> Ah, I see.  I thought you were talking about the Index: and\n> separator lines.  Colorizing diff/patch part, you need to parse\n> the diff output with sed/awk/perl and annotate it anyway, and it\n> does not matter if you annotate within GIT_EXTERNAL_DIFF or\n> outside.  I agree with you that using GIT_EXTERNAL_DIFF\n> mechanism would not help you here.\n\nWell, I want to finally converge with the diff format to what git uses.\nSo I'm just colorizing the /^diff --git/ line with a unusually bright\ncolor, which will hopefully make up for the Index: and separator lines.\n\n-- \n\t\t\t\tPetr \"Pasky\" Baudis\nStuff: http://pasky.or.cz/\nC++: an octopus made by nailing extra legs onto a dog. -- Steve Taylor\n"}]}