Thread (2 messages) flat view 2 messages, 2 authors, 2016-06-15

Re: [PATCH] GitWeb + TopGit

From: Petr Baudis <hidden>
Date: 2016-06-15 22:47:39

  Hi!

On Wed, Jun 03, 2009 at 01:09:12PM +0200, Bert Wesarg wrote:
I have changed gitweb to show topgit topics. log and shortlog shows
only the history for refs/top-bases/$topic..$topic.

You can see it in action here:

http://kgb2.thruhere.net/git/?p=bertw/topgit.git;a=summary

This patch is based on the debian package gitweb-1.6.3.1-1.  If you'r
interested I can rebase the patch on git.git.
  I'm very sorry I never got around to replying to this patch; I'd like
to add it to repo.or.cz now, would you still be interested in improving
it a little?

  Specifically, it would be necessary to show the topics section only if
the repository actually is topgit-controlled, that is it has the
refs/top-bases/ tree. If you could add that, I'm wondering if it would
be also suitable for gitweb upstream inclusion? Anyone...?

  Your gitweb above also has an extra 'patches' link in the shortlog
view - this would indeed be much useful to actually get the patch
introduced by the topic branch, however:

  (i) It is not included in this patch?
  (ii) It doesn't seem to work, giving a 400 error.
  (iii) It would be cool if it could also be added to the links in the
topic list.

  Thanks!
quoted hunk ↗ jump to hunk
Signed-off-by: Bert Wesarg <redacted>

---
diff --git a/gitweb.cgi b/gitweb.cgi
index 820f073..fd9e64b 100755
--- a/gitweb.cgi
+++ b/gitweb.cgi
@@ -5054,7 +5148,11 @@ sub git_log {
 	}
 	my $refs = git_get_references();
 
-	my @commitlist = parse_commits($hash, 101, (100 * $page));
+	my $commit_hash = $hash;
+	if (defined $hash_parent) {
+		$commit_hash = "$hash_parent..$hash";
+	}
+	my @commitlist = parse_commits($commit_hash, 101, (100 * $page));
 
 	my $paging_nav = format_paging_nav('log', $hash, $head, $page, $#commitlist >= 100);
 
  And this seems like overally useful gitweb addition.

-- 
				Petr "Pasky" Baudis
A lot of people have my books on their bookshelves.
That's the problem, they need to read them. -- Don Knuth
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help