Re: [PATCH] gitweb: Add hash parameter in feed URL when a hash is specified in the current request
- From
Jakub Narebski <jnareb@gmail.com>
- Date
- Mar 21, 2008, 18:53 UTC
- Message-ID
- <m3skyjvrgr.fsf@localhost.localdomain>
- In-Reply-To
- <ae63f8b50803211138y6355fd11pa64cda50a1f53011@mail.gmail.com>
"Jean-Baptiste Quenot" <jbq@caraldi.com> writes:
Show 25 quoted lines
> Hi list,
>
> I was annoyed with the RSS feed link at the bottom of gitweb because I
> couldn't find a way to have a specific feed for every branch. With
> this patch, the generated links include the hash parameter so that
> feeds are context-dependant.
>
> Hope it helps!
>
> ---
> gitweb/gitweb.perl | 1 +
> 1 files changed, 1 insertions(+), 0 deletions(-)
>
> diff --git a/gitweb/gitweb.perl b/gitweb/gitweb.perl
> index ec73cb1..7d013bd 100755
> --- a/gitweb/gitweb.perl
> +++ b/gitweb/gitweb.perl
> @@ -615,6 +615,7 @@ sub href(%) {
> my %mapping = @mapping;
>
> $params{'project'} = $project unless exists $params{'project'};
> + $params{'hash'} = $hash unless exists $params{'hash'};
>
> if ($params{-replay}) {
> while (my ($name, $symbol) = each %mapping) {It is *a* solution, but I don't think it is a *correct* solution for this problem. This adds 'hash' parameter to *every* link if parent view had hash parameter passed or just defined $hash variable for convenience.
The project parameter is added implicitely unless turned off ('project => undef) because almost all links need this parameter; IMHO this is not the case for hash parameter.
Besides this solution doesn't address the naming of feed links.
I was planning to add context-dependent feed links, both in page header (<link .../> elements in HTML <head>) and at the bottom of the page. Unfortunately to do this *rigth* took me more time than I though. (Additionally I got no responses to the post asking about thoughs on how should this be done:) "[RFC] gitweb: Use feed link according to current view" Message-Id: <200802111900.12325.jnareb@gmail.com> I was derailed for a bit, but I can try to do this... but after the Easter.
-- Jakub Narebski Poland ShadeHawk on #git