git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] gitweb: Add hash parameter in feed URL when a hash is specified in the current request
@ 2008-03-21 18:38 Jean-Baptiste Quenot
  2008-03-21 18:53 ` Jakub Narebski
  0 siblings, 1 reply; 4+ messages in thread
From: Jean-Baptiste Quenot @ 2008-03-21 18:38 UTC (permalink / raw)
  To: git

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) {
-- 
1.5.4.1-dirty

^ permalink raw reply related	[flat|nested] 4+ messages in thread

* Re: [PATCH] gitweb: Add hash parameter in feed URL when a hash is specified in the current request
  2008-03-21 18:38 [PATCH] gitweb: Add hash parameter in feed URL when a hash is specified in the current request Jean-Baptiste Quenot
@ 2008-03-21 18:53 ` Jakub Narebski
  2008-03-21 19:14   ` Jean-Baptiste Quenot
  0 siblings, 1 reply; 4+ messages in thread
From: Jakub Narebski @ 2008-03-21 18:53 UTC (permalink / raw)
  To: Jean-Baptiste Quenot; +Cc: git

"Jean-Baptiste Quenot" <jbq@caraldi.com> writes:

> 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

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [PATCH] gitweb: Add hash parameter in feed URL when a hash is specified in the current request
  2008-03-21 18:53 ` Jakub Narebski
@ 2008-03-21 19:14   ` Jean-Baptiste Quenot
  2008-03-21 19:53     ` Jakub Narebski
  0 siblings, 1 reply; 4+ messages in thread
From: Jean-Baptiste Quenot @ 2008-03-21 19:14 UTC (permalink / raw)
  To: Jakub Narebski; +Cc: git

I just read your initial post, and IMHO we should keep it simple.  I
tested the various links, and it appears to be good-enough to pass the
hash parameter for all URLs that do not specify the hash parameter
explicitly.  You can still pass it on a per-link basis if you think
it's too simplistic.

Maybe it's not the perfect solution, but at least it will improve the
current situation where some people are apparently deceived by not
having a per-branch RSS feed.  Not everyone forges URLs like we do :D

Oh, and about the title, just appending the hash is sufficient.
What's important is the contents of the feed.  Users will probably end
up editing the feed title in their reader after all.

Cheers,
-- 
Jean-Baptiste Quenot
http://caraldi.com/jbq/blog/

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [PATCH] gitweb: Add hash parameter in feed URL when a hash is specified in the current request
  2008-03-21 19:14   ` Jean-Baptiste Quenot
@ 2008-03-21 19:53     ` Jakub Narebski
  0 siblings, 0 replies; 4+ messages in thread
From: Jakub Narebski @ 2008-03-21 19:53 UTC (permalink / raw)
  To: Jean-Baptiste Quenot; +Cc: git

On Fri, 21 March 2008, Jean-Baptiste Quenot wrote:
>
> I just read your initial post, and IMHO we should keep it simple.  I
> tested the various links, and it appears to be good-enough to pass the
> hash parameter for all URLs that do not specify the hash parameter
> explicitly.  You can still pass it on a per-link basis if you think
> it's too simplistic.

Well, I think it would be a bit more cautious to just pass the hash
parameter to code generating feed links, in all of two places.
I'm sure about implict 'project' parameter, but not so sure about 
implicit 'hash' parameter, but if you have checked it... I'd rather 
avoid implicit parameters.

BTW. one of things I wanted to address (and what made patch long in 
coming) was that redundancy, unnecessary code duplication in feed links 
in HTML header, and in page footer.
 
> Maybe it's not the perfect solution, but at least it will improve the
> current situation where some people are apparently deceived by not
> having a per-branch RSS feed.  Not everyone forges URLs like we do :D
> 
> Oh, and about the title, just appending the hash is sufficient.
> What's important is the contents of the feed.  Users will probably end
> up editing the feed title in their reader after all.

For example 'tag' view has $hash defined, but I don't think feed 
starting at given tag is something one would want to have; tags don't 
change, feeds are about fresh, changing, live information.

When viewing history of a file, we would want to have feed of file 
history (perhaps for given branch)... and that was what I also wanted 
to address in my patch.

-- 
Jakub Narebski
Poland

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2008-03-21 19:54 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2008-03-21 18:38 [PATCH] gitweb: Add hash parameter in feed URL when a hash is specified in the current request Jean-Baptiste Quenot
2008-03-21 18:53 ` Jakub Narebski
2008-03-21 19:14   ` Jean-Baptiste Quenot
2008-03-21 19:53     ` Jakub Narebski

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).