Re: [PATCH] gitweb: Fix file name quoting in simplified out patch detection for --cc output

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Junio C Hamano wrote:
> Jakub Narebski <jnareb@xxxxxxxxx> writes:
> 
> > diff --git a/gitweb/gitweb.perl b/gitweb/gitweb.perl
> > index 8c1e02c..5d424e5 100755
> > --- a/gitweb/gitweb.perl
> > +++ b/gitweb/gitweb.perl
> > @@ -3140,8 +3140,8 @@ sub git_patchset_body {
> >  			# compact combined diff output can have some patches skipped
> >  			# find which patch (using pathname of result) we are at now
> >  			my $to_name;
> > -			if ($patch_line =~ m!^diff --cc "?(.*)"?$!) {
> > -				$to_name = $1;
> > +			if ($patch_line =~ m!^diff --cc ("?.*"?)$!) {
> > +				$to_name = unquote($1);
> >  			}
> 
> This patch obviously makes sense, but I wonder why you use the
> form m!foobar! here, instead of far simpler to read /foobar/
> form?

Consistency (kind of). For the ordinary diff output I use m!regexp!
instead of simpler /regexp/ to avoid 'leaning toothpicks' syndrome:

  m!^diff --git "?a/.*"? "?b/.*"?!

But as it is now not near, then I guess /regexp/ would be better...

-- 
Jakub Narebski
Poland
-
To unsubscribe from this list: send the line "unsubscribe git" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html

[Index of Archives]     [Linux Kernel Development]     [Gcc Help]     [IETF Annouce]     [DCCP]     [Netdev]     [Networking]     [Security]     [V4L]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux SCSI]     [Fedora Users]

  Powered by Linux