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

Re: [RFC/PATCH] gitweb: Add committags support

From
Petr Baudis <pasky@suse.cz>
Date
Sep 23, 2006, 14:05 UTC
Message-ID
<20060923140535.GK8259@pasky.or.cz>
In-Reply-To
<200609231533.02455.jnareb@gmail.com>

Dear diary, on Sat, Sep 23, 2006 at 03:33:01PM CEST, I got a letter where Jakub Narebski <jnareb@gmail.com> said that...

Show 12 quoted lines
> Petr Baudis wrote:
> 
> > Dear diary, on Sat, Sep 23, 2006 at 10:34:49AM CEST, I got a letter
> > where Jakub Narebski <jnareb@gmail.com> said that...
> 
> > Also, there is a fundamental limitation for the multi-word patterns that
> > they won't work if the line wraps at that point in the log message. This
> > will likely be a problem especially for the msgids, because those are
> > very long and are very likely to cause a linewrap immediately before.
> 
> We do not wrap log messages in gitweb. So the problem is only when
> commit message is wrongly wrapped itself (pre imples nowrap).

The commit message is not "wrongly" wrapped but just wrapped to fit into 72 or whatever columns. It would be silly to mandate users to use msg-id: <200609231533.02455.jnareb@gmail.com> with the message id stretching far away just for the sake of some gitweb limitations when having the message wrapped such as msg-id: <200609231533.02455.jnareb@gmail.com> looks much more reasonable.

Show 18 quoted lines
> >> > > +);
> >> > ..snip..
> >> > > +sub quote_msgid_gmane {
> >> > > +	my $msgid = shift || return;
> >> > > +
> >> > > +	return '<'.(quotemeta $msgid).'>';
> >> > > +}
> >> > 
> >> > <> should be HTML-escaped (unless CGI::a() does that).
> >> 
> >> CGI::a() probably does that. But true, "<" and ">" should be "params quoted":
> >> 
> >> 	return '%3c' . (quotemeta $msgid) . '%3e';
> > 
> > Ah, silly me, I didn't notice that it goes into the URL.
> 
> Should it be "params quoted" or not? What are valid characters
> in message-id? (And in which RFC it is defined?)

RFC2822. Unfortunately there can be all kind of crap inside if you put it inside quotes, so yes, it should.

What a pity that (apparently) noone supports RFC2392.
Show 6 quoted lines
> >> (Quotemeta is because Message-Id contains '@').
> > 
> > Hmm, and at which point would that be eaten?
> 
> In the substitution phase... but perhaps I was to defensive.
> s/$from/$to/g where $to can have '@'. 

$ perl -le 'my $x="a\@bc"; my $y="@"; $x =~ s/$y/$y.$y/g; print $x;' a@.@bc

You probably should regexp-quote $from if you don't yet, though, although a misbehaviour from that side is not very probable.

Show 21 quoted lines
> >> > Subjects are often clickable and we don't want links in those.
> >> 
> >> The extra code with $a_attr is to have links within links. It works
> >> quite well, I'd say. The subject link is broken, and the committag
> >> link is inserted in the break (gitweb-xmms2 committag code did the same,
> >> but did not preserved all the subject link attributes, like title or class,
> >> only the target of the link).
> >> 
> >> The result is somethink like:
> >> 
> >>   <a href="..." class="subject" ...>Fix </a><a href="...=137">BUG(137)</a><a href="..." class="subject" ...>: ...</a> 
> > 
> > I don't think this is good idea though - if I'm clicking at links, I
> > don't want to have to carefully watch where that bit of the link leads.
> > IMHO this would be just annoying.
> 
> The committag links within subject link are clearly visually distinguished:
> first they have default link color (blue for not visited, dark red for
> visited links), second they are not bold width (as opposed to gitweb-xmms2,
> where bold font was due to <b>...</b> element and not CSS styling 
> of a.subject).

Ok, in that case it's better though I'm still feeling somewhat uncomfortable about it. What if the _whole_ subject is just "Bug 1324"? I can click the 'commit' link instead but it throws exception in my brain I need to handle and I need to move my mouse around.

Show 6 quoted lines
> > I meant that we should consider substituting the committags in those as
> > well.
> 
> Ahh... For tags I guess it is a good idea (especially that I think that
> fixes for bugtracker tracked bugs and feature request should be marked by tags,
> e.g. b/<bugid>, to be used to link to commit/change/patch from bugtracker. 

For blobs, the point is mainly comments, those can contain all kinds of stuff.

> By the way, should we use some color for PGP signature block in signed tags?
Sounds like a good idea.
-- 
				Petr "Pasky" Baudis
Stuff: http://pasky.or.cz/
#!/bin/perl -sp0777i<X+d*lMLa^*lN%0]dsXx++lMlN/dsM0<j]dsj
$/=unpack('H*',$_);$_=`echo 16dio\U$k"SK$/SM$n\EsN0p[lN*1
lK[d2%Sa2/d0$^Ixp"|dc`;s/\W//g;$_=pack('H*',/((..)*)$/)
Previous: Jakub NarebskiNext: Jakub Narebski
Message 7 of 17 in “gitweb: Add committags support”
  1. gitweb: Add committags supportJakub Narebski, Sep 21, 2006
  2. Jakub NarebskiSep 22, 2006
  3. Petr BaudisSep 23, 2006
  4. Jakub NarebskiSep 23, 2006
  5. Petr BaudisSep 23, 2006
  6. Jakub NarebskiSep 23, 2006
  7. Petr BaudisSep 23, 2006
  8. Jakub NarebskiSep 25, 2006
  9. Petr BaudisSep 25, 2006
  10. Jakub NarebskiSep 26, 2006
  11. Junio C HamanoSep 23, 2006
  12. Jakub NarebskiSep 23, 2006
  13. Junio C HamanoSep 23, 2006
  14. Jakub NarebskiSep 24, 2006
  15. Junio C HamanoSep 24, 2006
  16. Jakub NarebskiSep 24, 2006
  17. Junio C HamanoSep 24, 2006

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.