# [RFC PATCH] gitweb.perl: tags snapshot link

3 messages from 2010-09-03 to 2010-09-14. Participants: WOLfgang Schricker, Giuseppe Bilotta.
Thread: https://gitlist.dev/t/24957

## WOLfgang Schricker, 2010-09-03 11:42

Subject: [RFC PATCH] gitweb.perl: tags snapshot link
Message-ID: <i5qmuo$ice$1@dough.gmane.org>
URL: https://gitlist.dev/e/i5qmuo%24ice%241%40dough.gmane.org

```
Hello,

I missed a snapshot link in my local repo:
====
tags
====
	tag | commit | shortlog | log | *snapshot*

I found this threads

<http://kerneltrap.org/mailarchive/git/2009/11/8/15785/thread>
<http://thread.gmane.org/gmane.comp.version-control.git/132366>

and the code for "Smarter snapshot names" in 'gitwep.perl'.

My gitweb.perl-1.7.2.2.patch for "activating":


--- gitweb.perl.orig	2010-08-20 01:44:47.000000000 +0200
+++ gitweb.perl	2010-09-03 13:20:40.000000000 +0200
@@ -4909,6 +4909,10 @@
 		} elsif ($tag{'reftype'} eq "blob") {
 			print " | " . $cgi->a({-href => href(action=>"blob_plain", hash=>$tag{'refid'})}, "raw");
 		}
+        my $snapshot_links = format_snapshot_links($tag{'fullname'});
+        if (defined $snapshot_links) {
+            print " | " . $snapshot_links;
+        }
 		print "</td>\n" .
 		      "</tr>";
 	}

-- 
Regards
*WOL* fgang *S* chricker

```

## Giuseppe Bilotta, 2010-09-12 23:25

Subject: Re: [RFC PATCH] gitweb.perl: tags snapshot link
Message-ID: <i6jnhg$epf$1@dough.gmane.org>
URL: https://gitlist.dev/e/i6jnhg%24epf%241%40dough.gmane.org
In-Reply-To: <i5qmuo$ice$1@dough.gmane.org>

```
WOLfgang Schricker wrote:

> Hello,
> 
> I missed a snapshot link in my local repo:
> ====
> tags
> ====
> tag | commit | shortlog | log | *snapshot*
> 
> I found this threads
> 
> <http://kerneltrap.org/mailarchive/git/2009/11/8/15785/thread>
> <http://thread.gmane.org/gmane.comp.version-control.git/132366>
> 
> and the code for "Smarter snapshot names" in 'gitwep.perl'.
> 
> My gitweb.perl-1.7.2.2.patch for "activating":
> 
> 
> --- gitweb.perl.orig	2010-08-20 01:44:47.000000000 +0200
> +++ gitweb.perl	2010-09-03 13:20:40.000000000 +0200
> @@ -4909,6 +4909,10 @@
>  } elsif ($tag{'reftype'} eq "blob") {
>  print " | " . $cgi->a({-href => href(action=>"blob_plain",
>  hash=>$tag{'refid'})}, "raw"); }
> +        my $snapshot_links = format_snapshot_links($tag{'fullname'});
> +        if (defined $snapshot_links) {
> +            print " | " . $snapshot_links;
> +        }
>  print "</td>\n" .
>  "</tr>";
>  }

If I read the patch correctly, this would add a 'snapshot' link to the tag
list view. Although the snapshot can already be obtained by clicking first
on the commit or shortlog view, this would reduce the number of clicks
necessary to obtain the snapshot. I believe it would be a good idea to have
this. Wolfgang: wold you consider submitting it in a more appropriate form
for inclusion?

If you do, you should probably also consider other places where such a link
could be added, such as in tag view, where the nav bar currently reads

summary | shortlog | log | commit | commitdiff | tree

and "| snapshot" could be appended.

-- 
Giuseppe Bilotta

```

## WOLfgang Schricker, 2010-09-14 18:06

Subject: Re: [RFC PATCH] gitweb.perl: tags snapshot link
Message-ID: <i6odiq$ire$1@dough.gmane.org>
URL: https://gitlist.dev/e/i6odiq%24ire%241%40dough.gmane.org
In-Reply-To: <i6jnhg$epf$1@dough.gmane.org>

```
Giuseppe Bilotta wrote:
> WOLfgang Schricker wrote:
> 
>> Hello,
>>
>> I missed a snapshot link in my local repo:
>> ====
>> tags
>> ====
>> tag | commit | shortlog | log | *snapshot*
>>
>> I found this threads
>>
>> <http://kerneltrap.org/mailarchive/git/2009/11/8/15785/thread>
>> <http://thread.gmane.org/gmane.comp.version-control.git/132366>
>>
>> and the code for "Smarter snapshot names" in 'gitwep.perl'.
>>
>> My gitweb.perl-1.7.2.2.patch for "activating":
>>
>>
>> --- gitweb.perl.orig	2010-08-20 01:44:47.000000000 +0200
>> +++ gitweb.perl	2010-09-03 13:20:40.000000000 +0200
>> @@ -4909,6 +4909,10 @@
>>  } elsif ($tag{'reftype'} eq "blob") {
>>  print " | " . $cgi->a({-href => href(action=>"blob_plain",
>>  hash=>$tag{'refid'})}, "raw"); }
>> +        my $snapshot_links = format_snapshot_links($tag{'fullname'});
>> +        if (defined $snapshot_links) {
>> +            print " | " . $snapshot_links;
>> +        }
>>  print "</td>\n" .
>>  "</tr>";
>>  }
> 
> If I read the patch correctly, this would add a 'snapshot' link to the tag
> list view. Although the snapshot can already be obtained by clicking first
> on the commit or shortlog view, this would reduce the number of clicks
> necessary to obtain the snapshot. I believe it would be a good idea to have
> this. Wolfgang: wold you consider submitting it in a more appropriate form
> for inclusion?
> 
> If you do, you should probably also consider other places where such a link
> could be added, such as in tag view, where the nav bar currently reads
> 
> summary | shortlog | log | commit | commitdiff | tree
> 
> and "| snapshot" could be appended.
>

Yes. _Every_ available snapshot link looks <project>-<SHA1>.tgz.
A 'v0.1' tag brings in the tag list project-v0.1.tgz now.
I see eg. a relocatable 'latest' tag for project-latest.tgz.
-- 
Regards
*WOL* fgang *S* chricker

```
