{"thread":{"id":"11988","subject":"[PATCH] Ignore duplicated slashes in git-log","startedAt":"2008-02-09T12:54:57Z","lastAt":"2008-02-09T14:16:45Z","messageCount":3,"participants":["Andi Kleen","Johannes Schindelin"],"isPatch":true,"patchVersion":1,"patchTotal":null},"messages":[{"id":"68077","messageId":"20080209125457.GA5686@basil.nowhere.org","threadId":"11988","inReplyTo":null,"subject":"[PATCH] Ignore duplicated slashes in git-log","fromName":"Andi Kleen","fromEmail":"andi@firstfloor.org","sentAt":"2008-02-09T12:54:57Z","receivedAt":"2008-02-09T12:54:57Z","isPatch":true,"sender":{"key":"andi@firstfloor.org","avatar":null},"body":"\nWhen I use git-log ... path/name  I seem to regularly\ntypo path/name as path//name (with duplicated slashes)\nThe normal kernel ignores these duplicated slashes\naccording to POSIX so it's typically no problem, but git \nfails and cannot find the correct file name when this\nhappens.\n\nThis patch fixes this case for git-log at least, by\nhandling duplicated slashes as a single slash. I probably\ndidn't change all places where file names are parsed\nin the source base, but this seems to be a relatively common\nplace used by several sub commands. And at least for me\nfixing git-log is the most important case anyways.\n\nPatch against git 1.5.4\n\n-Andi\n\ndiff -u git-1.5.4/setup.c-o git-1.5.4/setup.c\n--- git-1.5.4/setup.c-o\t2008-02-09 13:35:21.000000000 +0100\n+++ git-1.5.4/setup.c\t2008-02-09 13:47:53.000000000 +0100\n@@ -7,6 +7,11 @@\n const char *prefix_path(const char *prefix, int len, const char *path)\n {\n \tconst char *orig = path;\n+\tchar *s;\n+\n+\twhile ((s = strstr(path, \"//\")) != NULL)\n+\t\tmemmove(s, s + 1, strlen(s));\n+\n \tfor (;;) {\n \t\tchar c;\n \t\tif (*path != '.')\n"},{"id":"68082","messageId":"alpine.LSU.1.00.0802091323550.11591@racer.site","threadId":"11988","inReplyTo":"20080209125457.GA5686@basil.nowhere.org","subject":"Re: [PATCH] Ignore duplicated slashes in git-log","fromName":"Johannes Schindelin","fromEmail":"johannes.schindelin@gmx.de","sentAt":"2008-02-09T13:24:56Z","receivedAt":"2008-02-09T13:24:56Z","isPatch":true,"sender":{"key":"johannes.schindelin@gmx.de","avatar":"https://avatars.githubusercontent.com/u/127790?v=4"},"body":"Hi,\n\nOn Sat, 9 Feb 2008, Andi Kleen wrote:\n\n> When I use git-log ... path/name I seem to regularly typo path/name as \n> path//name (with duplicated slashes) The normal kernel ignores these \n> duplicated slashes according to POSIX so it's typically no problem, but \n> git fails and cannot find the correct file name when this happens.\n\nThis is only one case you want to fix.  There are absolute paths, too, and \nseries of \"../\".\n\nAlas, Junio was quicker than you:\n\nhttp://repo.or.cz/w/git.git?a=commitdiff;h=d089ebaad5315325d67db30176df1bbd7754fda9\n\nHth,\nDscho\n"},{"id":"68084","messageId":"20080209141645.GB22569@one.firstfloor.org","threadId":"11988","inReplyTo":"alpine.LSU.1.00.0802091323550.11591@racer.site","subject":"Re: [PATCH] Ignore duplicated slashes in git-log","fromName":"Andi Kleen","fromEmail":"andi@firstfloor.org","sentAt":"2008-02-09T14:16:45Z","receivedAt":"2008-02-09T14:16:45Z","isPatch":true,"sender":{"key":"andi@firstfloor.org","avatar":null},"body":"On Sat, Feb 09, 2008 at 01:24:56PM +0000, Johannes Schindelin wrote:\n> Hi,\n> \n> On Sat, 9 Feb 2008, Andi Kleen wrote:\n> \n> > When I use git-log ... path/name I seem to regularly typo path/name as \n> > path//name (with duplicated slashes) The normal kernel ignores these \n> > duplicated slashes according to POSIX so it's typically no problem, but \n> > git fails and cannot find the correct file name when this happens.\n> \n> This is only one case you want to fix.  There are absolute paths, too, and \n> series of \"../\".\n\nIt's hard to imagine anyone typoing sequences of ../ or ./, so at least\nI personally didn't feel the need to handle that.\n\n> \n> Alas, Junio was quicker than you:\n> \n> http://repo.or.cz/w/git.git?a=commitdiff;h=d089ebaad5315325d67db30176df1bbd7754fda9\n\nGreat.\n\n-Andi\n"}]}