]> Lady’s Gitweb - Gitweb/commit
gitweb: link to "git describe"'d commits in log messages
authorÆvar Arnfjörð Bjarmason <redacted>
Thu, 6 Oct 2016 09:11:35 +0000 (09:11 +0000)
committerLady <redacted>
Mon, 6 Apr 2026 04:51:33 +0000 (00:51 -0400)
commitce6f98e12cf2125f4650bd90edaf88a4c7c13817ac69e2e7b5bef58a455797d7
tree54e71d73373d1ab4764372dac887df47d3b01d35727f689bad2c4dcda182ae39
parentaa850baeea643106c0fc945a1ff1429cd7d408b779af22a186e13d1e522563bf
gitweb: link to "git describe"'d commits in log messages

Change the log formatting function to know about "git describe" output
such as "v2.8.0-4-g867ad08", in addition to just plain "867ad08".

There are still many valid refnames that we don't link to
e.g. v2.10.0-rc1~2^2~1 is also a valid way to refer to
v2.8.0-4-g867ad08, but I'm not supporting that with this commit,
similarly it's trivially possible to create some refnames like
"æ/var-gf6727b0" or which won't be picked up by this regex.

There's surely room for improvement here, but I just wanted to address
the very common case of sticking "git describe" output into commit
messages without trying to link to all possible refnames, that's going
to be a rather futile exercise given that this is free text, and it
would be prohibitively expensive to look up whether the references in
question exist in our repository.

There was on-list discussion about how we could do better than this
patch. Junio suggested to update parse_commits() to call a new
"gitweb--helper" command which would pass each of the revision
candidates through "rev-parse --verify --quiet". That would cut down
on our false positives (e.g. we'll link to "deadbeef"), and also allow
us to be more aggressive in selecting candidate revisions.

That may be too expensive to work in practice, or it may
not. Investigating that would be a good follow-up to this patch.

Signed-off-by: Ævar Arnfjörð Bjarmason <redacted>
Acked-by: Jakub Narębski <redacted>
Signed-off-by: Junio C Hamano <redacted>
gitweb.perl
This page took 0.164516 seconds and 5 git commands to generate.