{"thread":{"id":"9754","subject":"[PATCH] gitweb: Fix file name quoting in simplified out patch detection for --cc output","startedAt":"2007-09-02T20:22:13Z","lastAt":"2007-09-03T09:52:51Z","messageCount":3,"participants":["Jakub Narebski","Junio C Hamano"],"isPatch":true,"patchVersion":1,"patchTotal":null},"messages":[{"id":"52276","messageId":"200709022222.13865.jnareb@gmail.com","threadId":"9754","inReplyTo":null,"subject":"[PATCH] gitweb: Fix file name quoting in simplified out patch detection for --cc output","fromName":"Jakub Narebski","fromEmail":"jnareb@gmail.com","sentAt":"2007-09-02T20:22:13Z","receivedAt":"2007-09-02T20:22:13Z","isPatch":true,"sender":{"key":"jnareb@gmail.com","avatar":"https://avatars.githubusercontent.com/u/2706?v=4"},"body":"For the --cc (compressed combined) diff output there can be patches\nwhich are simple and got simplified out, so there is no patch\ncorresponding to raw output line.\n\nFix detection of of such simplified out patches: file name in git diff\nheader for --cc diff can be quoted; unquote it.\n\nSigned-off-by: Jakub Narebski <jnareb@gmail.com>\n---\nThis patch depends _textually_ on the just send\n  \"gitweb: Fix and simplify \"split patch\" detection\"\npatch, although it is _conceptually_ independent.\n\nThe commit message could be better...\n\n gitweb/gitweb.perl |    4 ++--\n 1 files changed, 2 insertions(+), 2 deletions(-)\n\ndiff --git a/gitweb/gitweb.perl b/gitweb/gitweb.perl\nindex 8c1e02c..5d424e5 100755\n--- a/gitweb/gitweb.perl\n+++ b/gitweb/gitweb.perl\n@@ -3140,8 +3140,8 @@ sub git_patchset_body {\n \t\t\t# compact combined diff output can have some patches skipped\n \t\t\t# find which patch (using pathname of result) we are at now\n \t\t\tmy $to_name;\n-\t\t\tif ($patch_line =~ m!^diff --cc \"?(.*)\"?$!) {\n-\t\t\t\t$to_name = $1;\n+\t\t\tif ($patch_line =~ m!^diff --cc (\"?.*\"?)$!) {\n+\t\t\t\t$to_name = unquote($1);\n \t\t\t}\n \n \t\t\tdo {\n-- \n1.5.2.5\n"},{"id":"52287","messageId":"7vabs4oaxh.fsf@gitster.siamese.dyndns.org","threadId":"9754","inReplyTo":"200709022222.13865.jnareb@gmail.com","subject":"Re: [PATCH] gitweb: Fix file name quoting in simplified out patch detection for --cc output","fromName":"Junio C Hamano","fromEmail":"gitster@pobox.com","sentAt":"2007-09-03T00:22:02Z","receivedAt":"2007-09-03T00:22:02Z","isPatch":true,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"Jakub Narebski <jnareb@gmail.com> writes:\n\n> diff --git a/gitweb/gitweb.perl b/gitweb/gitweb.perl\n> index 8c1e02c..5d424e5 100755\n> --- a/gitweb/gitweb.perl\n> +++ b/gitweb/gitweb.perl\n> @@ -3140,8 +3140,8 @@ sub git_patchset_body {\n>  \t\t\t# compact combined diff output can have some patches skipped\n>  \t\t\t# find which patch (using pathname of result) we are at now\n>  \t\t\tmy $to_name;\n> -\t\t\tif ($patch_line =~ m!^diff --cc \"?(.*)\"?$!) {\n> -\t\t\t\t$to_name = $1;\n> +\t\t\tif ($patch_line =~ m!^diff --cc (\"?.*\"?)$!) {\n> +\t\t\t\t$to_name = unquote($1);\n>  \t\t\t}\n\nThis patch obviously makes sense, but I wonder why you use the\nform m!foobar! here, instead of far simpler to read /foobar/\nform?\n"},{"id":"52336","messageId":"200709031152.51373.jnareb@gmail.com","threadId":"9754","inReplyTo":"7vabs4oaxh.fsf@gitster.siamese.dyndns.org","subject":"Re: [PATCH] gitweb: Fix file name quoting in simplified out patch detection for --cc output","fromName":"Jakub Narebski","fromEmail":"jnareb@gmail.com","sentAt":"2007-09-03T09:52:51Z","receivedAt":"2007-09-03T09:52:51Z","isPatch":true,"sender":{"key":"jnareb@gmail.com","avatar":"https://avatars.githubusercontent.com/u/2706?v=4"},"body":"Junio C Hamano wrote:\n> Jakub Narebski <jnareb@gmail.com> writes:\n> \n> > diff --git a/gitweb/gitweb.perl b/gitweb/gitweb.perl\n> > index 8c1e02c..5d424e5 100755\n> > --- a/gitweb/gitweb.perl\n> > +++ b/gitweb/gitweb.perl\n> > @@ -3140,8 +3140,8 @@ sub git_patchset_body {\n> >  \t\t\t# compact combined diff output can have some patches skipped\n> >  \t\t\t# find which patch (using pathname of result) we are at now\n> >  \t\t\tmy $to_name;\n> > -\t\t\tif ($patch_line =~ m!^diff --cc \"?(.*)\"?$!) {\n> > -\t\t\t\t$to_name = $1;\n> > +\t\t\tif ($patch_line =~ m!^diff --cc (\"?.*\"?)$!) {\n> > +\t\t\t\t$to_name = unquote($1);\n> >  \t\t\t}\n> \n> This patch obviously makes sense, but I wonder why you use the\n> form m!foobar! here, instead of far simpler to read /foobar/\n> form?\n\nConsistency (kind of). For the ordinary diff output I use m!regexp!\ninstead of simpler /regexp/ to avoid 'leaning toothpicks' syndrome:\n\n  m!^diff --git \"?a/.*\"? \"?b/.*\"?!\n\nBut as it is now not near, then I guess /regexp/ would be better...\n\n-- \nJakub Narebski\nPoland\n"}]}