{"thread":{"id":"12796","subject":"[PATCH] gitweb: Add hash parameter in feed URL when a hash is specified in the current request","startedAt":"2008-03-21T18:38:38Z","lastAt":"2008-03-21T19:53:54Z","messageCount":4,"participants":["Jean-Baptiste Quenot","Jakub Narebski"],"isPatch":true,"patchVersion":1,"patchTotal":null},"messages":[{"id":"72609","messageId":"ae63f8b50803211138y6355fd11pa64cda50a1f53011@mail.gmail.com","threadId":"12796","inReplyTo":null,"subject":"[PATCH] gitweb: Add hash parameter in feed URL when a hash is specified in the current request","fromName":"Jean-Baptiste Quenot","fromEmail":"jbq@caraldi.com","sentAt":"2008-03-21T18:38:38Z","receivedAt":"2008-03-21T18:38:38Z","isPatch":true,"sender":{"key":"jbq@caraldi.com","avatar":null},"body":"Hi list,\n\nI was annoyed with the RSS feed link at the bottom of gitweb because I\ncouldn't find a way to have a specific feed for every branch.  With\nthis patch, the generated links include the hash parameter so that\nfeeds are context-dependant.\n\nHope it helps!\n\n---\n gitweb/gitweb.perl |    1 +\n 1 files changed, 1 insertions(+), 0 deletions(-)\n\ndiff --git a/gitweb/gitweb.perl b/gitweb/gitweb.perl\nindex ec73cb1..7d013bd 100755\n--- a/gitweb/gitweb.perl\n+++ b/gitweb/gitweb.perl\n@@ -615,6 +615,7 @@ sub href(%) {\n        my %mapping = @mapping;\n\n        $params{'project'} = $project unless exists $params{'project'};\n+       $params{'hash'} = $hash unless exists $params{'hash'};\n\n        if ($params{-replay}) {\n                while (my ($name, $symbol) = each %mapping) {\n-- \n1.5.4.1-dirty\n"},{"id":"72612","messageId":"m3skyjvrgr.fsf@localhost.localdomain","threadId":"12796","inReplyTo":"ae63f8b50803211138y6355fd11pa64cda50a1f53011@mail.gmail.com","subject":"Re: [PATCH] gitweb: Add hash parameter in feed URL when a hash is specified in the current request","fromName":"Jakub Narebski","fromEmail":"jnareb@gmail.com","sentAt":"2008-03-21T18:53:48Z","receivedAt":"2008-03-21T18:53:48Z","isPatch":true,"sender":{"key":"jnareb@gmail.com","avatar":"https://avatars.githubusercontent.com/u/2706?v=4"},"body":"\"Jean-Baptiste Quenot\" <jbq@caraldi.com> writes:\n\n> Hi list,\n> \n> I was annoyed with the RSS feed link at the bottom of gitweb because I\n> couldn't find a way to have a specific feed for every branch.  With\n> this patch, the generated links include the hash parameter so that\n> feeds are context-dependant.\n> \n> Hope it helps!\n> \n> ---\n>  gitweb/gitweb.perl |    1 +\n>  1 files changed, 1 insertions(+), 0 deletions(-)\n> \n> diff --git a/gitweb/gitweb.perl b/gitweb/gitweb.perl\n> index ec73cb1..7d013bd 100755\n> --- a/gitweb/gitweb.perl\n> +++ b/gitweb/gitweb.perl\n> @@ -615,6 +615,7 @@ sub href(%) {\n>         my %mapping = @mapping;\n> \n>         $params{'project'} = $project unless exists $params{'project'};\n> +       $params{'hash'} = $hash unless exists $params{'hash'};\n> \n>         if ($params{-replay}) {\n>                 while (my ($name, $symbol) = each %mapping) {\n\nIt is *a* solution, but I don't think it is a *correct* solution for\nthis problem.  This adds 'hash' parameter to *every* link if parent\nview had hash parameter passed or just defined $hash variable for\nconvenience.  \n\nThe project parameter is added implicitely unless turned off \n('project => undef) because almost all links need this parameter;\nIMHO this is not the case for hash parameter.\n\nBesides this solution doesn't address the naming of feed links.\n\n\nI was planning to add context-dependent feed links, both in page\nheader (<link .../> elements in HTML <head>) and at the bottom of the\npage.  Unfortunately to do this *rigth* took me more time than I\nthough.  (Additionally I got no responses to the post asking about\nthoughs on how should this be done:)\n  \"[RFC] gitweb: Use feed link according to current view\"\n  Message-Id: <200802111900.12325.jnareb@gmail.com>\nI was derailed for a bit, but I can try to do this... but after the\nEaster.\n\n-- \nJakub Narebski\nPoland\nShadeHawk on #git\n"},{"id":"72614","messageId":"ae63f8b50803211214i59184fd7jde7d640d6a8580b8@mail.gmail.com","threadId":"12796","inReplyTo":"m3skyjvrgr.fsf@localhost.localdomain","subject":"Re: [PATCH] gitweb: Add hash parameter in feed URL when a hash is specified in the current request","fromName":"Jean-Baptiste Quenot","fromEmail":"jbq@caraldi.com","sentAt":"2008-03-21T19:14:16Z","receivedAt":"2008-03-21T19:14:16Z","isPatch":true,"sender":{"key":"jbq@caraldi.com","avatar":null},"body":"I just read your initial post, and IMHO we should keep it simple.  I\ntested the various links, and it appears to be good-enough to pass the\nhash parameter for all URLs that do not specify the hash parameter\nexplicitly.  You can still pass it on a per-link basis if you think\nit's too simplistic.\n\nMaybe it's not the perfect solution, but at least it will improve the\ncurrent situation where some people are apparently deceived by not\nhaving a per-branch RSS feed.  Not everyone forges URLs like we do :D\n\nOh, and about the title, just appending the hash is sufficient.\nWhat's important is the contents of the feed.  Users will probably end\nup editing the feed title in their reader after all.\n\nCheers,\n-- \nJean-Baptiste Quenot\nhttp://caraldi.com/jbq/blog/\n"},{"id":"72616","messageId":"200803212053.55998.jnareb@gmail.com","threadId":"12796","inReplyTo":"ae63f8b50803211214i59184fd7jde7d640d6a8580b8@mail.gmail.com","subject":"Re: [PATCH] gitweb: Add hash parameter in feed URL when a hash is specified in the current request","fromName":"Jakub Narebski","fromEmail":"jnareb@gmail.com","sentAt":"2008-03-21T19:53:54Z","receivedAt":"2008-03-21T19:53:54Z","isPatch":true,"sender":{"key":"jnareb@gmail.com","avatar":"https://avatars.githubusercontent.com/u/2706?v=4"},"body":"On Fri, 21 March 2008, Jean-Baptiste Quenot wrote:\n>\n> I just read your initial post, and IMHO we should keep it simple.  I\n> tested the various links, and it appears to be good-enough to pass the\n> hash parameter for all URLs that do not specify the hash parameter\n> explicitly.  You can still pass it on a per-link basis if you think\n> it's too simplistic.\n\nWell, I think it would be a bit more cautious to just pass the hash\nparameter to code generating feed links, in all of two places.\nI'm sure about implict 'project' parameter, but not so sure about \nimplicit 'hash' parameter, but if you have checked it... I'd rather \navoid implicit parameters.\n\nBTW. one of things I wanted to address (and what made patch long in \ncoming) was that redundancy, unnecessary code duplication in feed links \nin HTML header, and in page footer.\n \n> Maybe it's not the perfect solution, but at least it will improve the\n> current situation where some people are apparently deceived by not\n> having a per-branch RSS feed.  Not everyone forges URLs like we do :D\n> \n> Oh, and about the title, just appending the hash is sufficient.\n> What's important is the contents of the feed.  Users will probably end\n> up editing the feed title in their reader after all.\n\nFor example 'tag' view has $hash defined, but I don't think feed \nstarting at given tag is something one would want to have; tags don't \nchange, feeds are about fresh, changing, live information.\n\nWhen viewing history of a file, we would want to have feed of file \nhistory (perhaps for given branch)... and that was what I also wanted \nto address in my patch.\n\n-- \nJakub Narebski\nPoland\n"}]}