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

Re: [RFC/PATCH] Configurable hyperlinking in gitk

From
Chris Packham <judge.packham@gmail.com>
Date
Sep 17, 2011, 09:26 UTC
Message-ID
<4E7467B7.1090201@gmail.com>
In-Reply-To
<20110917022903.GA2445@unpythonic.net>
Hi,
On 17/09/11 14:29, Jeff Epler wrote:
Show 5 quoted lines
> Some time ago I hardcoded this into gitk for $DAY_JOB and find it very
> useful.  I made it configurable in the hopes that it might be adopted
> upstream. (unfortunately, the configurable version is radically
> different from the original hard-coded version, so I can't say this
> has had much testing yet)

This is definitely something folks at my $dayjob would be interested in. We've already done some customisation of gitweb to do something similar. I'm not actually sure what the changes where or how configurable they are. I'll see if I can dig them out on Monday someone else might want to polish them into something suitable (I might do it myself if I get some tuits).

Show 15 quoted lines
> The definition of the allowed regular expression in the docs
> probably needs some refinement.  Basically, they have to also be REs
> that can be concatenated with the "|" character, which is not true
> of REs that begin with the *** flavor selector (which I had not
> heard of before rereading `man re_syntax` just now) or (?xyz)
> embedded options.  Or maybe there's an efficient alternate approach
> to scanning for the next non-overlapping match among several
> patterns that doesn't involve concatenating the patterns.
> 
> I'm not sure about the "one line" restriction; at first I thought
> that everything was fed to 'appendwithlinks' in arbitrary chunks,
> but not I see that they are mostly logical chunks (and probably only
> the comment, not the headers or commit descriptors, will have
> anything to linkify).  The problem again seems to be how to succinctly
> describe what is permitted.

For my use case the one line restriction is fine. We tend to put the bug number in the headline anyway.

Sometimes when a commit fixes multiple bugs we put all the bug numbers in separated by commas. I don't know Tcl well enough to tell if your code supports that or not.

> There are probably better names for the configuration options, too.

It'd be nice if the config variables weren't gitk specific. .re and .sub could be applied to gitweb and maybe other git viewers outside of gig.git might decide to use them. My bikeshedding suggestion would be to just drop the gitk prefix and have linkify.re and linkify.sub.

> Suggestions?  Problems?  Successes?

Re-compiling now. I won't be able to actually test it properly until I'm back in the office but I can at least check that the links are generated.

Previous: Jeff EplerNext: Chris Packham
Message 2 of 33 in “Configurable hyperlinking in gitk”
  1. Configurable hyperlinking in gitkJeff Epler, Sep 17, 2011
  2. Chris PackhamSep 17, 2011
  3. Chris PackhamSep 17, 2011
  4. Jeff EplerSep 17, 2011
  5. Chris PackhamSep 17, 2011
  6. git web--browse error handling URL with & in it (Was Re: [RFC/PATCH] Configurable hyperlinking in gitk)Chris Packham, Sep 18, 2011
  7. Chris PackhamSep 18, 2011
  8. Jeff KingSep 18, 2011
  9. git-web--browse: invoke kfmclient directlyChris Packham, Sep 18, 2011
  10. Jeff KingSep 18, 2011
  11. [RFC/PATCHv2] git-web--browse: avoid the use of evalChris Packham, Sep 19, 2011
  12. Jeff KingSep 19, 2011
  13. Chris PackhamSep 20, 2011
  14. Jeff KingSep 20, 2011
  15. Junio C HamanoSep 20, 2011
  16. Junio C HamanoSep 19, 2011
  17. Jeff KingSep 19, 2011
  18. Junio C HamanoSep 19, 2011
  19. Jeff KingSep 19, 2011
  20. Junio C HamanoSep 19, 2011
  21. Andreas SchwabSep 19, 2011
  22. Jeff KingSep 19, 2011
  23. Junio C HamanoSep 19, 2011
  24. Andreas SchwabSep 19, 2011
  25. Jakub NarebskiSep 19, 2011
  26. Christian CouderSep 18, 2011
  27. Marc BranchaudSep 19, 2011
  28. Jakub NarebskiSep 18, 2011
  29. Jeff EplerSep 22, 2011
  30. Configurable hyperlinking in gitkJeff Epler, Sep 22, 2011
  31. Configurable hyperlinking in gitkJeff Epler, Oct 11, 2011
  32. Junio C HamanoOct 11, 2011
  33. Chris PackhamOct 12, 2011

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.