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

[RFC] Configuring (future) committags support in gitweb

From
Jakub Narebski <jnareb@gmail.com>
Date
Nov 8, 2008, 19:07 UTC
Message-ID
<200811082007.55045.jnareb@gmail.com>

Francis Galiegue <fg@one2team.net> writes in "Need help for migration from CVS to git in one go..."

Show 5 quoted lines
> * third: also Bonsai-related; Bonsai can link to Bugzilla by
> matching (wild guess) /\b(?:#?)(\d+)\b/ and transforming this into
> http://your.bugzilla.fqdn.here/show_bug.cgi?id=$1. Does gitweb have
> this built-in? (haven't looked yet) Is this planned, or has it been
> discussed and been considered not worth the hassle?

Here below there is proposal how the committags support could look like for gitweb _user_, which means how to configure gitweb to use (or do not use) committags, how to configure committags, and how to define new committags.

Committags are "tags" in commit messages, expanded when rendering commit message, like gitweb now does for (shortened) SHA-1, converting them to 'object' view link. It should be done in a way to make it easy configurable, preferably having to configure only variable part, and not having to write whole replacement rule.

Possible committags include: _BUG(n)_, bug _#n_, _FEATURE(n), Message-Id, plain text URL e.g. _http://repo.or.cz_, spam protecting of email addresses, "rich text formatting" like *bold* and _underline_, syntax highlighting of signoff lines.

I think it would be good idea to use repository config file for setting-up repository-specific committags, and use whatever Perl structure for global configuration. The config language can be borrowed from "drivers" in gitattributes (`diff' and `merge' drivers).

So the example configuration could look like this:
  [gitweb]
  	committags = sha1 signoff bugzilla
  [committag "bugzilla"]
  	match = "\\b(?:#?)(\\d+)\\b"
  	link  = "http://your.bugzilla.fqdn.here/show_bug.cgi?id=$1"
where 'sha1' and 'signoff' are built-in committags, committags are
applied in the order they are put in gitweb.committags; possible actions
for committag driver include:
 * link: replace $match by '_<a href="$link">_$match_</a>_'
 * html: replace $match by '_$html_'
 * text: replace $match by '$text'
where '_a_' means that 'a' is treated as HTML, and is not expanded
further, and 'b' means that it can be further expanded by later
committags, and finally is HTML-escaped (esc_html).
What do you think about this?
-- 
Jakub Narebski
Poland
Next: Francis Galiegue
Message 1 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.