* A better way to inform about git clone url. [2de21fac9842650fceb3db68f15711e38fabc3c8] @ 2006-08-15 6:27 Aneesh Kumar K.V 2006-08-15 14:28 ` [PATCH] gitweb: Add support for cloneurl Aneesh Kumar K.V 2006-08-15 16:24 ` A better way to inform about git clone url. [2de21fac9842650fceb3db68f15711e38fabc3c8] Jon Loeliger 0 siblings, 2 replies; 4+ messages in thread From: Aneesh Kumar K.V @ 2006-08-15 6:27 UTC (permalink / raw) To: git http://gitweb.freedesktop.org/?p=PolicyKit.git;a=summary This shows it in the URL part of each project. -aneesh ^ permalink raw reply [flat|nested] 4+ messages in thread
* [PATCH] gitweb: Add support for cloneurl. 2006-08-15 6:27 A better way to inform about git clone url. [2de21fac9842650fceb3db68f15711e38fabc3c8] Aneesh Kumar K.V @ 2006-08-15 14:28 ` Aneesh Kumar K.V 2006-08-15 16:24 ` A better way to inform about git clone url. [2de21fac9842650fceb3db68f15711e38fabc3c8] Jon Loeliger 1 sibling, 0 replies; 4+ messages in thread From: Aneesh Kumar K.V @ 2006-08-15 14:28 UTC (permalink / raw) To: git [-- Attachment #1: Type: text/plain, Size: 323 bytes --] Aneesh Kumar K.V wrote: > http://gitweb.freedesktop.org/?p=PolicyKit.git;a=summary > > This shows it in the URL part of each project. > -aneesh The below patch implements the same. I am not sure whether the approach is the right one. To see the results you can see http://git.openssi.org/~kvaneesh/gitweb.cgi -aneesh [-- Attachment #2: 0001-gitweb-Add-support-for-cloneurl.txt --] [-- Type: text/plain, Size: 1644 bytes --] >From 87503bfc92210ab6791f7a15eba72682d60f74ca Mon Sep 17 00:00:00 2001 Subject: [PATCH] gitweb: Add support for cloneurl. A new file cloneurl is added below .git directory for each project. The contents of the file is displayed by gitweb as the url which need to be used for git clone. Signed-off-by: Aneesh Kumar K.V <aneesh.kumar@gmail.com> --- gitweb/gitweb.perl | 12 ++++++++++++ 1 files changed, 12 insertions(+), 0 deletions(-) diff --git a/gitweb/gitweb.perl b/gitweb/gitweb.perl index b5b89de..869c53e 100755 --- a/gitweb/gitweb.perl +++ b/gitweb/gitweb.perl @@ -503,6 +503,16 @@ sub git_get_project_description { return $descr; } +sub git_get_project_cloneurl { + my $path = shift; + + open my $fd, "$projectroot/$path/cloneurl" or return undef; + my $descr = <$fd>; + close $fd; + chomp $descr; + return $descr; +} + sub git_get_projects_list { my @list; @@ -1655,6 +1665,7 @@ sub git_project_list { sub git_summary { my $descr = git_get_project_description($project) || "none"; my $head = git_get_head_hash($project); + my $cloneurl = git_get_project_cloneurl($project) || "none"; my %co = parse_commit($head); my %cd = parse_date($co{'committer_epoch'}, $co{'committer_tz'}); @@ -1669,6 +1680,7 @@ sub git_summary { "<tr><td>description</td><td>" . esc_html($descr) . "</td></tr>\n" . "<tr><td>owner</td><td>$owner</td></tr>\n" . "<tr><td>last change</td><td>$cd{'rfc2822'}</td></tr>\n" . + "<tr><td>URL</td><td>$cloneurl</td></tr>\n" . "</table>\n"; open my $fd, "-|", $GIT, "rev-list", "--max-count=17", git_get_head_hash($project) -- 1.4.2.rc1.g83e1-dirty ^ permalink raw reply related [flat|nested] 4+ messages in thread
* Re: A better way to inform about git clone url. [2de21fac9842650fceb3db68f15711e38fabc3c8] 2006-08-15 6:27 A better way to inform about git clone url. [2de21fac9842650fceb3db68f15711e38fabc3c8] Aneesh Kumar K.V 2006-08-15 14:28 ` [PATCH] gitweb: Add support for cloneurl Aneesh Kumar K.V @ 2006-08-15 16:24 ` Jon Loeliger 2006-08-15 17:23 ` [PATCH] gitweb: Support multiple clone urls Aneesh Kumar K.V 1 sibling, 1 reply; 4+ messages in thread From: Jon Loeliger @ 2006-08-15 16:24 UTC (permalink / raw) To: Aneesh Kumar K.V; +Cc: Git List On Tue, 2006-08-15 at 01:27, Aneesh Kumar K.V wrote: > http://gitweb.freedesktop.org/?p=PolicyKit.git;a=summary > > This shows it in the URL part of each project. Oh yes. ++Vote. jdl ^ permalink raw reply [flat|nested] 4+ messages in thread
* [PATCH] gitweb: Support multiple clone urls 2006-08-15 16:24 ` A better way to inform about git clone url. [2de21fac9842650fceb3db68f15711e38fabc3c8] Jon Loeliger @ 2006-08-15 17:23 ` Aneesh Kumar K.V 0 siblings, 0 replies; 4+ messages in thread From: Aneesh Kumar K.V @ 2006-08-15 17:23 UTC (permalink / raw) To: git [-- Attachment #1: Type: text/plain, Size: 37 bytes --] This one is on top of the last one [-- Attachment #2: 0002-gitweb-Support-multiple-clone-urls.txt --] [-- Type: text/plain, Size: 1902 bytes --] >From 135f502d7f47f58be5035f2cdb4896dd24adb852 Mon Sep 17 00:00:00 2001 gitweb: Support multiple clone urls This shows multiple urls if available for git clone Signed-off-by: Aneesh Kumar K.V <aneesh.kumar@gmail.com> --- gitweb/gitweb.perl | 20 +++++++++++++------- 1 files changed, 13 insertions(+), 7 deletions(-) diff --git a/gitweb/gitweb.perl b/gitweb/gitweb.perl index 869c53e..501537f 100755 --- a/gitweb/gitweb.perl +++ b/gitweb/gitweb.perl @@ -505,12 +505,13 @@ sub git_get_project_description { sub git_get_project_cloneurl { my $path = shift; + my @cloneurls; open my $fd, "$projectroot/$path/cloneurl" or return undef; - my $descr = <$fd>; + @cloneurls = <$fd>; close $fd; - chomp $descr; - return $descr; + + return \@cloneurls; } sub git_get_projects_list { @@ -1665,7 +1666,7 @@ sub git_project_list { sub git_summary { my $descr = git_get_project_description($project) || "none"; my $head = git_get_head_hash($project); - my $cloneurl = git_get_project_cloneurl($project) || "none"; + my $cloneurls = git_get_project_cloneurl($project); my %co = parse_commit($head); my %cd = parse_date($co{'committer_epoch'}, $co{'committer_tz'}); @@ -1679,9 +1680,14 @@ sub git_summary { print "<table cellspacing=\"0\">\n" . "<tr><td>description</td><td>" . esc_html($descr) . "</td></tr>\n" . "<tr><td>owner</td><td>$owner</td></tr>\n" . - "<tr><td>last change</td><td>$cd{'rfc2822'}</td></tr>\n" . - "<tr><td>URL</td><td>$cloneurl</td></tr>\n" . - "</table>\n"; + "<tr><td>last change</td><td>$cd{'rfc2822'}</td></tr>\n"; + + my $url; + foreach $url (@$cloneurls) { + chomp $url; + print "<tr><td>URL</td><td>$url</td></tr>\n"; + } + print "</table>\n"; open my $fd, "-|", $GIT, "rev-list", "--max-count=17", git_get_head_hash($project) or die_error(undef, "Open git-rev-list failed"); -- 1.4.2.rc1.g83e1-dirty ^ permalink raw reply related [flat|nested] 4+ messages in thread
end of thread, other threads:[~2006-08-15 17:24 UTC | newest] Thread overview: 4+ messages (download: mbox.gz follow: Atom feed -- links below jump to the message on this page -- 2006-08-15 6:27 A better way to inform about git clone url. [2de21fac9842650fceb3db68f15711e38fabc3c8] Aneesh Kumar K.V 2006-08-15 14:28 ` [PATCH] gitweb: Add support for cloneurl Aneesh Kumar K.V 2006-08-15 16:24 ` A better way to inform about git clone url. [2de21fac9842650fceb3db68f15711e38fabc3c8] Jon Loeliger 2006-08-15 17:23 ` [PATCH] gitweb: Support multiple clone urls Aneesh Kumar K.V
This is a public inbox, see mirroring instructions for how to clone and mirror all data and code used for this inbox; as well as URLs for NNTP newsgroup(s).