# [PATCH 01/14] gitweb: get remotes too when getting heads list

2 messages from 2007-08-31 to 2007-08-31. Participants: Giuseppe Bilotta.
Thread: https://gitlist.dev/t/9717

## Giuseppe Bilotta, 2007-08-31 08:32

Subject: [PATCH 01/14] gitweb: get remotes too when getting heads list
Message-ID: <11885491241529-git-send-email-giuseppe.bilotta@gmail.com>
URL: https://gitlist.dev/e/11885491241529-git-send-email-giuseppe.bilotta%40gmail.com
In-Reply-To: <favitdff@sea.gmane.org>

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

diff --git a/gitweb/gitweb.perl b/gitweb/gitweb.perl
index b2bae1b..65953db 100755
--- a/gitweb/gitweb.perl
+++ b/gitweb/gitweb.perl
@@ -2063,7 +2063,7 @@ sub git_get_heads_list {
 	open my $fd, '-|', git_cmd(), 'for-each-ref',
 		($limit ? '--count='.($limit+1) : ()), '--sort=-committerdate',
 		'--format=%(objectname) %(refname) %(subject)%00%(committer)',
-		'refs/heads'
+		'refs/heads', 'refs/remotes'
 		or return;
 	while (my $line = <$fd>) {
 		my %ref_item;
@@ -2073,8 +2073,9 @@ sub git_get_heads_list {
 		my ($hash, $name, $title) = split(' ', $refinfo, 3);
 		my ($committer, $epoch, $tz) =
 			($committerinfo =~ /^(.*) ([0-9]+) (.*)$/);
-		$name =~ s!^refs/heads/!!;
+		$name =~ s!^refs/(head|remote)s/!!;
 
+		$ref_item{'class'} = $1;
 		$ref_item{'name'}  = $name;
 		$ref_item{'id'}    = $hash;
 		$ref_item{'title'} = $title || '(no commit message)';
-- 
1.5.2.5

```

## Giuseppe Bilotta, 2007-08-31 09:10

Subject: Re: [PATCH 01/14] gitweb: get remotes too when getting heads list
Message-ID: <fb8lte$8rk$1@sea.gmane.org>
URL: https://gitlist.dev/e/fb8lte%248rk%241%40sea.gmane.org
In-Reply-To: <11885491241529-git-send-email-giuseppe.bilotta@gmail.com>

```
On Friday 31 August 2007 10:32, Giuseppe Bilotta wrote:

> Signed-off-by: Giuseppe Bilotta <giuseppe.bilotta@gmail.com>

A-hem, sorry, I think I've done something seriously wrong with the
patch sending. It should have been threaded under the previous thread,
and my smtp server decided to throttle me after the second.

Let me see if I can get this right.

-- 
Giuseppe "Oblomov" Bilotta

```
