Open
Conversation
Many projects use project-specific notations in changelogs to refer
to bug trackers and the like. One example is the "Closes: #12345"
notation used in Debian.
Make gitk configurable so that arbitrary strings can be turned into
clickable links that are opened in a web browser.
[zj: updated documentation patch in the description below following
Junio's suggestion]
Signed-off-by: Jeff Epler <jepler@unpythonic.net>
Signed-off-by: Zbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl>
The following changes to documentation should go along with this patch:
diff --git a/Documentation/config.txt b/Documentation/config.txt
index ae9913b..ffc9ccf 100644
--- a/Documentation/config.txt
+++ b/Documentation/config.txt
@@ -1064,6 +1064,10 @@ All gitcvs variables except for 'gitcvs.usecrlfattr' and
is one of "ext" and "pserver") to make them apply only for the given
access method.
+gitk.browser::
+ Specify the browser that will be used to open links generated by
+ 'linkify' configuration options.
+
grep.lineNumber::
If set to true, enable '-n' option by default.
@@ -1317,6 +1321,28 @@ interactive.singlekey::
setting is silently ignored if portable keystroke input
is not available.
+linkify.<name>.regexp::
+ 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).
+
+linkify.<name>.subst::
+ A string matching 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.
++
+For example, to automatically link from Debian-style "Closes: #nnnn"
+message to the Debian BTS,
++
+--------
+ git config linkify.debian-bts.regexp '#([1-9][0-9]*)'
+ git config linkify.debian-bts.subst 'http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=\1'
+--------
++
+Currently, only linkgit:gitk[1] converts strings to links in this fashion.
+
log.abbrevCommit::
If true, makes linkgit:git-log[1], linkgit:git-show[1], and
linkgit:git-whatchanged[1] assume `\--abbrev-commit`. You may
@@ -1870,5 +1896,5 @@ user.signingkey::
web.browser::
Specify a web browser that may be used by some commands.
- Currently only linkgit:git-instaweb[1] and linkgit:git-help[1]
- may use it.
+ Currently only linkgit:git-instaweb[1], linkgit:gitk[1],
+ and linkgit:git-help[1] may use it.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Hi,
this is a patch floated on the git mailing list. Please consider adding it to your pool
of gitk patches.