{"thread":{"id":"9362","subject":"[PATCH] gitweb: Provide RSS feeds for file history","startedAt":"2007-08-03T02:05:55Z","lastAt":"2007-08-04T00:27:08Z","messageCount":5,"participants":["Steven Walter","Jakub Narebski","Junio C Hamano","Robert Fitzsimons"],"isPatch":true,"patchVersion":1,"patchTotal":null},"messages":[{"id":"49532","messageId":"20070803020555.GB8593@dervierte","threadId":"9362","inReplyTo":null,"subject":"[PATCH] gitweb: Provide RSS feeds for file history","fromName":"Steven Walter","fromEmail":"stevenrwalter@gmail.com","sentAt":"2007-08-03T02:05:55Z","receivedAt":"2007-08-03T02:05:55Z","isPatch":true,"sender":{"key":"stevenrwalter@gmail.com","avatar":"https://avatars.githubusercontent.com/u/79127?v=4"},"body":"If git_feed is provided a file name, it ought to show only the history\naffecting that file.  The title was already being set correctly, but all\ncommits from history were being shown anyway.\n---\n gitweb/gitweb.perl |    3 ++-\n 1 files changed, 2 insertions(+), 1 deletions(-)\n\ndiff --git a/gitweb/gitweb.perl b/gitweb/gitweb.perl\nindex 498b936..26932a4 100755\n--- a/gitweb/gitweb.perl\n+++ b/gitweb/gitweb.perl\n@@ -611,6 +611,7 @@ sub href(%) {\n \tmy %mapping = @mapping;\n \n \t$params{'project'} = $project unless exists $params{'project'};\n+\t$params{'file_name'} = $file_name unless exists $params{'file_name'};\n \n \tmy ($use_pathinfo) = gitweb_check_feature('pathinfo');\n \tif ($use_pathinfo) {\n@@ -5365,7 +5366,7 @@ sub git_feed {\n \n \t# log/feed of current (HEAD) branch, log of given branch, history of file/directory\n \tmy $head = $hash || 'HEAD';\n-\tmy @commitlist = parse_commits($head, 150);\n+\tmy @commitlist = parse_commits($head, 150, 0, \"--full-history\", $file_name);\n \n \tmy %latest_commit;\n \tmy %latest_date;\n-- \n1.5.2.3\n\n\n-- \n-Steven Walter <swalter@lexmark.com>\n"},{"id":"49569","messageId":"200708031110.55969.jnareb@gmail.com","threadId":"9362","inReplyTo":"20070803020555.GB8593@dervierte","subject":"Re: [PATCH] gitweb: Provide RSS feeds for file history","fromName":"Jakub Narebski","fromEmail":"jnareb@gmail.com","sentAt":"2007-08-03T09:10:55Z","receivedAt":"2007-08-03T09:10:55Z","isPatch":true,"sender":{"key":"jnareb@gmail.com","avatar":"https://avatars.githubusercontent.com/u/2706?v=4"},"body":"Steven Walter wrote:\n\nNak. Explanation below. Corrected patch will follow.\n\n> If git_feed is provided a file name, it ought to show only the history\n> affecting that file.  The title was already being set correctly, but all\n> commits from history were being shown anyway.\n\nThis is a bug introduced while changing gitweb (among others git_feed\nsubroutine) to use parse_commits, in commit b6093a5c. Earlier it worked.\nSo the explanation (in commit message) is not full.\n\nBy the way it affects not only RSS but also Atom feeds.\n\nDocumentation/SubmittingPatches:\n\n  Checklist (and a short version for the impatient):\n\n        Commits:\n\n  [...]\n\n        - if you want your work included in git.git, add a\n          \"Signed-off-by: Your Name <your@email.com>\" line to the\n          commit message (or just use the option \"-s\" when\n          committing) to confirm that you agree to the Developer's\n          Certificate of Origin\n\n> ---\n>  gitweb/gitweb.perl |    3 ++-\n>  1 files changed, 2 insertions(+), 1 deletions(-)\n> \n> diff --git a/gitweb/gitweb.perl b/gitweb/gitweb.perl\n> index 498b936..26932a4 100755\n> --- a/gitweb/gitweb.perl\n> +++ b/gitweb/gitweb.perl\n> @@ -611,6 +611,7 @@ sub href(%) {\n>  \tmy %mapping = @mapping;\n>  \n>  \t$params{'project'} = $project unless exists $params{'project'};\n> +\t$params{'file_name'} = $file_name unless exists $params{'file_name'};\n>  \n>  \tmy ($use_pathinfo) = gitweb_check_feature('pathinfo');\n>  \tif ($use_pathinfo) {\n\nThis is a big, intrusive change. It makes 'file_name' default argument,\nunless overriden. While it made sense for 'project' parameter, as almost\nall URLs in gitweb needed it, more than half URLs does not need 'file_name'\nparameter. And some of those URLs are present in a views which do use\n'file_name'.\n\nIf you wanted alternative URLs for a feed preserve 'file_name' parameter,\ndo it explicitely.\n\n> @@ -5365,7 +5366,7 @@ sub git_feed {\n>  \n>  \t# log/feed of current (HEAD) branch, log of given branch, history of file/directory\n>  \tmy $head = $hash || 'HEAD';\n> -\tmy @commitlist = parse_commits($head, 150);\n> +\tmy @commitlist = parse_commits($head, 150, 0, \"--full-history\", $file_name);\n>  \n>  \tmy %latest_commit;\n>  \tmy %latest_date;\n\nI'd rather not use \"--full-history\" for feeds. We use it in the 'history'\nview for backward compatibility reasons; I'd rather leave it for extra\noptions in the feed.\n\n-- \nJakub Narebski\nPoland\n"},{"id":"49641","messageId":"200708031950.43126.jnareb@gmail.com","threadId":"9362","inReplyTo":"200708031110.55969.jnareb@gmail.com","subject":"[PATCH] gitweb: Fix handling of $file_name in feed generation","fromName":"Jakub Narebski","fromEmail":"jnareb@gmail.com","sentAt":"2007-08-03T17:50:42Z","receivedAt":"2007-08-03T17:50:42Z","isPatch":true,"sender":{"key":"jnareb@gmail.com","avatar":"https://avatars.githubusercontent.com/u/2706?v=4"},"body":">From 6ef05672bb1dd1fe1ded15707164eaac36772c21 Mon Sep 17 00:00:00 2001\nFrom: Steven Walter <stevenrwalter@gmail.com>\nFrom: Jakub Narebski <jnareb@gmail.com>\nDate: Fri, 3 Aug 2007 19:35:00 +0200\nSubject: [PATCH] gitweb: Fix handling of $file_name in feed generation\n\nThe commit b6093a5c, by Robert Fitzsimons:\n  \"gitweb: Change atom, rss actions to use parse_commits.\"\nforgot to pass $file_name parameter to parse_commits subroutine.\n\nIf git_feed is provided a file name, it ought to show only the history\naffecting that file or a directory.  The title was being set\ncorrectly, but all commits from history were being shown.\n\nSigned-off-by: Steven Walter <stevenrwalter@gmail.com>\nSigned-off-by: Jakub Narebski <jnareb@gmail.com>\n---\nThree comments. First, authorship. Steven Walter didn't signoff his patch,\nand the contents differs a bit from second chunk of his patch (see\ncomment below) and I have added infor about which commit introduced this\nbug to the commit message. I have added my signoff, you can take this\npatch as either mine or Steven authorship.\n\n\nSecond, I have discarded first chunk in Steven patch because it was too\nintrusive. As I have said, it makes 'file_name' default argument,\nunless overriden. While it made sense for 'project' parameter to be made\ndefault parameter in href(), as almost all URLs in gitweb needed it,\nmore than half URLs does not need 'file_name' parameter. And some of\nthose URLs are present in a views which do use 'file_name'.\n\nSo if we want alternative URLs for a feed preserve 'file_name' parameter,\nor we want RSS/Atom links for \"file_name\" kind of views, like 'tree',\n'blob' or 'history' views, we should add 'file_name' parameter\nexplicitely, and not change href() to do it implicitely.\n\nBut as we are in stabilization (freeze) stage, I'd rather not add any new\nfeatures. This one just fixes a bug in gitweb.\n\n\nThird, I'd rather not use \"--full-history\" for feeds. We use it in the\n'history' view for backward compatibility reasons; I'd rather leave it\nfor extra options in the feed. But this is also for after the release.\n\n gitweb/gitweb.perl |    2 +-\n 1 files changed, 1 insertions(+), 1 deletions(-)\n\ndiff --git a/gitweb/gitweb.perl b/gitweb/gitweb.perl\nindex 498b936..4733728 100755\n--- a/gitweb/gitweb.perl\n+++ b/gitweb/gitweb.perl\n@@ -5365,7 +5365,7 @@ sub git_feed {\n \n \t# log/feed of current (HEAD) branch, log of given branch, history of file/directory\n \tmy $head = $hash || 'HEAD';\n-\tmy @commitlist = parse_commits($head, 150);\n+\tmy @commitlist = parse_commits($head, 150, 0, undef, $file_name);\n \n \tmy %latest_commit;\n \tmy %latest_date;\n-- \n1.5.2.4\n"},{"id":"49648","messageId":"7v7iockuwg.fsf@assigned-by-dhcp.cox.net","threadId":"9362","inReplyTo":"200708031950.43126.jnareb@gmail.com","subject":"Re: [PATCH] gitweb: Fix handling of $file_name in feed generation","fromName":"Junio C Hamano","fromEmail":"gitster@pobox.com","sentAt":"2007-08-04T00:25:51Z","receivedAt":"2007-08-04T00:25:51Z","isPatch":true,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"Thanks.  This came in while I already tagged -rc4 and was doing\nthe final round of tests and packaging, so has to become the\nfirst thing post -rc4, unfortunately.\n\nThe format of the e-mail message you sent out could use much\nimprovements but I'll let it pass this time.\n"},{"id":"49655","messageId":"20070804002708.GA9840@localhost","threadId":"9362","inReplyTo":"200708031950.43126.jnareb@gmail.com","subject":"Re: [PATCH] gitweb: Fix handling of $file_name in feed generation","fromName":"Robert Fitzsimons","fromEmail":"robfitz@273k.net","sentAt":"2007-08-04T00:27:08Z","receivedAt":"2007-08-04T00:27:08Z","isPatch":true,"sender":{"key":"robfitz@273k.net","avatar":null},"body":"> Subject: [PATCH] gitweb: Fix handling of $file_name in feed generation\n> \n> The commit b6093a5c, by Robert Fitzsimons:\n>   \"gitweb: Change atom, rss actions to use parse_commits.\"\n> forgot to pass $file_name parameter to parse_commits subroutine.\n> \n> If git_feed is provided a file name, it ought to show only the history\n> affecting that file or a directory.  The title was being set\n> correctly, but all commits from history were being shown.\n> \n> Signed-off-by: Steven Walter <stevenrwalter@gmail.com>\n> Signed-off-by: Jakub Narebski <jnareb@gmail.com>\n\nSilly me.  Jakub's change is the correct fix for the bug.\n\nRobert\n"}]}