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

Re: [RESEND PATCH v3] Configurable hyperlinking in gitk

From
Junio C Hamano <gitster@pobox.com>
Date
Oct 11, 2011, 22:13 UTC
Message-ID
<7vfwizdvnn.fsf@alter.siamese.dyndns.org>
In-Reply-To
<20111011183722.GA26646@unpythonic.net>
Jeff Epler <jepler@unpythonic.net> writes:
> I'm aware of no problems with this patch, and a number of people have
> commented that it is useful to them.

Hmmm, "didn't generate any discussion" does not mesh very well with "a number of people are happy". Which one should I trust?

Show 5 quoted lines
>  * Documented that these are POSIX EREs; hopefully that's OK.  I see
>    in CodingGuidelines that in git itself "a subset of BREs" are used,
>    so maybe even this is too much power.  And hopefully tcl's
>    re_syntax really is close enough to an ERE superset that this isn't
>    a terrible lie about the initial implementation either.

I think it is better to be honest and say these are fed to the native regexp engine of Tcl somewhere in the documentation.

Declaring "these are POSIX EREs" invites a user to expect they truly are. When the pattern the user wrote triggers a strange Tcl extension to cause unexpected things to match, the documentation needs to help the user to understand why. I understand the longer-term wish to reuse these in gitweb and elsewhere, but it becomes even more important that it is clearly documented that these "regexp" are fed to native regexp engines of Tcl and Perl depending on the program that they are used in. Unless the documentation spells it out, the user will not be able to decide how to work the implementation around, avoiding constructs that would behave differently between Tcl and Perl.

Doesn't tcl have/use pcre these days, by the way? If we envision that this will be shared with gitweb, perhaps using that might be a better option to reduce potential confusion.

>  * Added a Signed-Off-By, since I've had a number of positive feedbacks
>    and the only problems I've heard of (since patch v2) are the ones
>    related to 'eval' in git-web--browse.

By the way, "This patch is good" does not have anything to do with signing off a patch.

Paul wanted to keep gitk sources separately available from the rest of the git. After all, that is how gitk project started. Even after 5569bf9 (Do a cross-project merge of Paul Mackerras' gitk visualizer, 2005-06-22), we kept it so that git://git.kernel.org/pub/scm/gitk/gitk was the primary project to make changes to gitk, and git.git pulled from it (it is an assymmetric pull, as gitk cannot pull from git without contaminating its history with the changes to the rest of git).

I do not know how motivated Paul is to keep gitk part separated in its own project these days. I do not think the /pub/scm/gitk/gitk repository has been re-populated yet. Assuming that it will eventually come back on-line, could you send the gitk part of this change to Paul (i.e. the diff header of your patch should read "diff --git a/gitk b/gitk") and another separate patch to Documentation/ part?

Paul, if you are orphaning gitk, I do _not_ mind start taking patches that touch gitk myself directly into git tree.

But I would still need reviewers who are motivated and interested in enhancing and maintaining gitk.

Show 5 quoted lines
> +linkify.<name>.regexp::
> +	Specify a regular expression in the POSIX Extended Regular Expression
> +	syntax defining a class of strings to automatically convert to
> +	hyperlinks.  This regular expression many not span multiple lines.
> +	You must also specify 'linkify.<name>.subst'.

Saying "You must ..." without explicitly saying "why" is a bad style. If the reader already _knows_ the .regexp is used to supply captured substring to the corresponding .subst, then it is obvious that whenever you have .regexp you need a matching .subst, but that is not even explained here.

How about this?
	A string that matches this regexp is converted to a hyperlink
	using the value of corresponding `linkify.<name>.subst` variable.
	The regular expression is passed to the regexp engine of Tcl (in
	gitk) or Perl (in gitweb).
Show 5 quoted lines
> +linkify.<name>.subst::
> +	Specify a substitution that results in the target URL for the
> +	related regular expression.  Back-references like '\1' refer
> +	to capturing groups in the associated regular expression.
> +	You must also specify 'linkify.<name>.regexp'.
Likewise.
	A string matched the value of the corresponding
	`linkify.<name>.regexp` variable is rewritten to this URL. The
	value of this variable can contain back-references like `\1` to
	refer to capturing groups in the associated regular expression.
Previous: Jeff EplerNext: Chris Packham
Message 32 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.