# [PATCH] gitweb: shortlog now also obeys $hash_parent

2 messages from 2008-08-08 to 2008-09-25. Participants: Giuseppe Bilotta, Petr Baudis.
Thread: https://gitlist.dev/t/14890

## Giuseppe Bilotta, 2008-08-08 14:12

Subject: [PATCH] gitweb: shortlog now also obeys $hash_parent
Message-ID: <1218204731-9931-1-git-send-email-giuseppe.bilotta@gmail.com>
URL: https://gitlist.dev/e/1218204731-9931-1-git-send-email-giuseppe.bilotta%40gmail.com

```
If $hash_parent is defined, shortlog now limits the list of commits at
those between $hash_parent (exclusive) and $hash (inclusive).

Signed-off-by: Giuseppe Bilotta <giuseppe.bilotta@gmail.com>
---
 gitweb/gitweb.perl |    6 +++++-
 1 files changed, 5 insertions(+), 1 deletions(-)

diff --git a/gitweb/gitweb.perl b/gitweb/gitweb.perl
index a12ce87..d811dd4 100755
--- a/gitweb/gitweb.perl
+++ b/gitweb/gitweb.perl
@@ -5472,7 +5472,11 @@ sub git_shortlog {
 	}
 	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('shortlog', $hash, $head, $page, $#commitlist >= 100);
 	my $next_link = '';
-- 
1.5.6.3

```

## Petr Baudis, 2008-09-25 15:44

Subject: Re: [PATCH] gitweb: shortlog now also obeys $hash_parent
Message-ID: <20080925154459.GN10544@machine.or.cz>
URL: https://gitlist.dev/e/20080925154459.GN10544%40machine.or.cz
In-Reply-To: <1218204731-9931-1-git-send-email-giuseppe.bilotta@gmail.com>

```
On Fri, Aug 08, 2008 at 04:12:11PM +0200, Giuseppe Bilotta wrote:
> If $hash_parent is defined, shortlog now limits the list of commits at
> those between $hash_parent (exclusive) and $hash (inclusive).
> 
> Signed-off-by: Giuseppe Bilotta <giuseppe.bilotta@gmail.com>

That sounds like a useful feature.

Acked-by: Petr Baudis <pasky@suse.cz>

-- 
				Petr "Pasky" Baudis
People who take cold baths never have rheumatism, but they have
cold baths.

```
