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

Re: [RFC] Configuring (future) committags support in gitweb, especially bug linking

From
Jakub Narebski <jnareb@gmail.com>
Date
Feb 18, 2009, 03:38 UTC
Message-ID
<200902180438.55081.jnareb@gmail.com>
In-Reply-To
<499AD871.8000808@oak.homeunix.org>
On Tue, 17 Feb 2009, Marcel M. Cary wrote:
Show 5 quoted lines
> I'm interested in cross-linking bug references in commit messages to a
> bug tracking system.  I started tinkering a couple weeks ago and am
> finally understanding that committags encompass this functionality.
> (From the subject line I first understood "tags" to mean git tags rather
> than commit message munging.)
What would you name this feature, then?
> 
> Is the committags idea still under active development?
Well, it is in my todo list, rather further on...
[...]
Show 6 quoted lines
> Two regexes would make it easier to configure a driver without needing
> look-ahead and look-behind assertions.  For example, if you want to
> match non-negative integers but only in the context of a Resolves-bug
> header:
> 
>     Resolves-bug: 1234, 1235
[...]
> I got the two-regex idea from a spec I ran across while evaluating
> Subversion:
> 
> http://guest:@tortoisesvn.tigris.org/svn/tortoisesvn/trunk/doc/issuetrackers.txt

You don't need multiple regexps for that, and in above example it is used _single_ regexp; only with more than one catching group.

Show 7 quoted lines
> I like the idea of allowing a regex writer -- a gitweb admin or a
> repository owner -- to ignore issues regarding HTML escaping.  For
> example, I'd rather not have &nbsp; in the regex.  And I don't want the
> replacement to have to escape "&" in a query string.  That's a strength
> of not having to write the whole link replacement rule.  And I think
> hyperlinking will be one of the most common uses of this committag
> feature, so it's worth special support.
[...]
> I'm concerned about the composition of these committag drivers.  In
> other words, will it be hard for the configurer to manage interactions
> between committag drivers?  To choose a sane order, will I have to
> understand the implementation details of each committag driver?

In current proposal the order of running committags drivers is specified in configuration...

Show 12 quoted lines
> 
> Perhaps a simpler alternative would be to let at most one driver process
> a given snippet of text, forbidding nesting of replacements.  (If I
> understand Junio's suggestion to use a list of strings and refs,
> non-nesting overlaps are already not supported.)  If all replacements
> were hyperlinks -- and I expect that to be the common case -- they
> wouldn't be nestable anyway.  I wouldn't see it as a huge loss for the
> nesting examples I can think of:  Separate rules for span around S-o-b
> and linking or obfuscation of email could be combined into one...  A
> rule to shade text quoted email-style with leading angle brackets could
> just clobber any further processing of that text.  And it might simplify
> the code and testing of it quite a bit.

... but I guess that at first attempt we could support non-overlapping committags only, i.e. replacement is always as whole not passed to later committags.

Still there is a problem how to specify which parts of replacement for committags have to be HTML escaped, and which are HTML and should not be (and which are attributes, and have to be escaped too).

[...]
Show 5 quoted lines
> A few ideas for drivers that I don't think have been mentioned yet:
> 
> * Wiki page names, like to [[Feature Documentation]].  These are notable
> because they tend to contain punctuation that get HTML-escaped, like
> quotes and ampersands.

Well, I think if it would be supported, it would be a very special case, so I don't think generic support for this is needed nor required.

Show 8 quoted lines
> 
> * Links to gitweb itself, such as 123abc:file.txt and HEAD:file.txt.  I
> guess the current hash linking sort of does the first case except that
> you have to get the hash of the blob instead of using the commit hash,
> and the current hash linking wouldn't reveal the filename until after
> you click, nor when viewing textual log messages.  I'm not sure whether
> special support for linking to multi-commit diffs or other object types
> would be as helpful.

Also 'v1.5.4' etc linking to tag; both would be a good idea. At this point I think we have already list of all references (for ref markers) so it wouldn't require additional call to git command.

P.S. I understand that this post is an exception (send after long, long time), but please do not toppost in replies. It goes against natural reading order.

-- 
Jakub Narebski
Poland
Previous: Junio C HamanoNext: Marcel M. Cary
Message 19 of 20 in “[RFC] Configuring (future) committags support in gitweb”
  1. Jakub NarebskiNov 8, 2008
  2. Francis GaliegueNov 8, 2008
  3. Jakub NarebskiNov 8, 2008
  4. Francis GaliegueNov 8, 2008
  5. Jakub NarebskiNov 9, 2008
  6. Marcel M. CaryFeb 17, 2009
  7. 1/2 gitweb: Fix warnings with override permitted but no repo overrideMarcel M. Cary, Feb 18, 2009
  8. 2/2 gitweb: Hyperlink multiple git hashes on the same commit message lineMarcel M. Cary, Feb 18, 2009
  9. Jakub NarebskiFeb 18, 2009
  10. Junio C HamanoFeb 20, 2009
  11. Jakub NarebskiFeb 20, 2009
  12. Addresses with full names in patch emailsMarcel M. Cary, Feb 24, 2009
  13. Jakub NarebskiFeb 24, 2009
  14. Marcel M. CaryFeb 24, 2009
  15. Giuseppe BilottaFeb 18, 2009
  16. Junio C HamanoFeb 18, 2009
  17. Jakub NarebskiFeb 18, 2009
  18. Junio C HamanoFeb 18, 2009
  19. Jakub NarebskiFeb 18, 2009
  20. Marcel M. CaryFeb 19, 2009

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.