gitweb: Add snapshot to shortlog
PATCH 1/1 gitweb: Add snapshot to shortlog
Add snapshot to each commit-row of shortlog.
Signed-off-by Luben Tuikov <[email protected]>
--- gitweb/gitweb.perl | 3 ++- 1 files changed, 2 insertions(+), 1 deletions(-)
gitweb/gitweb.perl +2 -1
@@ -2021,7 +2021,8 @@ sub git_shortlog_body { print "</td>\n" . "<td class=\"link\">" . $cgi->a({-href => href(action=>"commitdiff", hash=>$commit)}, "commitdiff") . " | " . - $cgi->a({-href => href(action=>"tree", hash=>$commit, hash_base=>$commit)}, "tree"); + $cgi->a({-href => href(action=>"tree", hash=>$commit, hash_base=>$commit)}, "tree") . " | " . + $cgi->a({-href => href(action=>"snapshot", hash=>$commit)}, "snapshot"); print "</td>\n" . "</tr>\n"; }
Signature · 1 line
1.4.2.1.g05f0f
Quoted 1 line · Luben Tuikov
Add snapshot to each commit-row of shortlog.
You should add it conditionally, checking for gitweb_have_snapshot.
Signature · 3 lines
Jakub Narebski Warsaw, Poland ShadeHawk on #git
PATCH 1/1 Show snapshot link in shortlog only if have_snapsho
Signed-off-by Petr Baudis <[email protected]>
---
gitweb/gitweb.perl | 6 ++++-- 1 files changed, 4 insertions(+), 2 deletions(-)
gitweb/gitweb.perl +4 -2
@@ -2098,8 +2098,10 @@ sub git_shortlog_body { print "</td>\n" . "<td class=\"link\">" . $cgi->a({-href => href(action=>"commitdiff", hash=>$commit)}, "commitdiff") . " | " . - $cgi->a({-href => href(action=>"tree", hash=>$commit, hash_base=>$commit)}, "tree") . " | " . - $cgi->a({-href => href(action=>"snapshot", hash=>$commit)}, "snapshot"); + $cgi->a({-href => href(action=>"tree", hash=>$commit, hash_base=>$commit)}, "tree"); + if (gitweb_have_snapshot()) { + print " | " . $cgi->a({-href => href(action=>"snapshot", hash=>$commit)}, "snapshot"); + } print "</td>\n" . "</tr>\n"; }