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

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

From
Jakub Narebski <jnareb@gmail.com>
Date
Sep 3, 2007, 09:52 UTC
Message-ID
<200709031152.51373.jnareb@gmail.com>
In-Reply-To
<7vabs4oaxh.fsf@gitster.siamese.dyndns.org>
Junio C Hamano wrote:
Show 19 quoted lines
> Jakub Narebski <jnareb@gmail.com> 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
Previous: Junio C Hamano
Message 3 of 3 in “gitweb: Fix file name quoting in simplified out patch detection for --cc output”
  1. gitweb: Fix file name quoting in simplified out patch detection for --cc outputJakub Narebski, Sep 2, 2007
  2. Junio C HamanoSep 3, 2007
  3. Jakub NarebskiSep 3, 2007

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.