Subject: Re: cgit suggestion

From: Alexey Nezhdanov <[email-masked]>
Date: Sun, 27 Sep 2009 23:02:30 +0400

Hello Lars.
Here is the diff. It adds feature of downloading 'named' tarball from the tag 
description page.

On Saturday 26 September 2009 10:14:19 Alexey Nezhdanov wrote:
> Hello Lars.
> Discovered a cgit for myself throught the LWN article:
> http://lwn.net/Articles/351798/
>
> Great thing! I'm impressed, will use it instead of gitweb (when I'll need a
> web interface anyway ;-P).
> Came upon a thing though that I consider to be an inconvenience.
>
> When I click on a tag, for instance:
> http://hjemli.net/git/cgit/tag/?id=v0.8.2.2
> there is no download link of assotiated object. And if I click on a 'tagged
> object' I get download links, but they are referenced by SHA-1 format.
> So they can not be used as a .orig.tar.gz package or even just stored 'for
> a future use' since SHA-1 is not human readable.
> So I propose putting download links onto tag page for the objects of type
> 'tree' and 'commit'.
> If you want me to write a patch - I'll do.
>
> Regards
> Alexey Nezhdanov.

-- 
Sincerely yours
Alexey Nezhdanov
From b70365dfab8bb9ade733ea8387880b2b2cf4baa4 Mon Sep 17 00:00:00 2001
From: Alexey Nezhdanov <[email-masked]>
Date: Sun, 27 Sep 2009 23:00:29 +0400
Subject: [PATCH] Ad-hoc tarball downloads from the tag description page.

Signed-off-by: Alexey Nezhdanov <[email-masked]>
---
 ui-tag.c |   12 ++++++++++++
 1 files changed, 12 insertions(+), 0 deletions(-)

diff --git a/ui-tag.c b/ui-tag.c
index c2d72af..da93b7a 100644
--- a/ui-tag.c
+++ b/ui-tag.c
@@ -76,6 +76,12 @@ void cgit_print_tag(char *revname)
 		html("<tr><td>Tagged object</td><td>");
 		cgit_object_link(tag->tagged);
 		html("</td></tr>\n");
+                if (ctx.repo->snapshots) {
+                        html("<tr><th>download</th><td class='sha1'>");
+                        cgit_print_snapshot_links(ctx.qry.repo, ctx.qry.head,
+                                                  revname, ctx.repo->snapshots);
+                        html("</td></tr>");
+                }
 		html("</table>\n");
 		print_tag_content(info->msg);
 	} else {
@@ -86,6 +92,12 @@ void cgit_print_tag(char *revname)
 		html("<tr><td>Tagged object</td><td>");
 		cgit_object_link(obj);
 		html("</td></tr>\n");
+                if (ctx.repo->snapshots) {
+                        html("<tr><th>download</th><td class='sha1'>");
+                        cgit_print_snapshot_links(ctx.qry.repo, ctx.qry.head,
+                                                  revname, ctx.repo->snapshots);
+                        html("</td></tr>");
+                }
 		html("</table>\n");
         }
 	return;
-- 
1.5.6.3