{"thread":{"id":"31633","subject":"[BUG?] Path limiting in \"git log\" when run from another subdir","startedAt":"2012-09-24T11:59:57Z","lastAt":"2012-09-24T14:11:11Z","messageCount":7,"participants":["Johan Herland","Nguyen Thai Ngoc Duy"],"isPatch":false,"patchVersion":null,"patchTotal":null},"messages":[{"id":"199794","messageId":"CALKQrged+ptCQYm-=JKRborrAeKmaNFG=rDS8BQK5CNhwqjnkQ@mail.gmail.com","threadId":"31633","inReplyTo":null,"subject":"[BUG?] Path limiting in \"git log\" when run from another subdir","fromName":"Johan Herland","fromEmail":"johan@herland.net","sentAt":"2012-09-24T11:59:57Z","receivedAt":"2012-09-24T11:59:57Z","isPatch":false,"sender":{"key":"johan@herland.net","avatar":"https://avatars.githubusercontent.com/u/547031?v=4"},"body":"The following works in the git.git repo:\n\n$ cd t\n$ git log -- /Documentation\n[...]\n\nbut the following does not:\n\n$ cd t\n$ git log -- /Documentation/RelNotes\nfatal: Could not switch to '/Documentation': No such file or directory\n\n\nIs this the intended behavior?\n\n\n...Johan\n\n-- \nJohan Herland, <johan@herland.net>\nwww.herland.net\n"},{"id":"199795","messageId":"CACsJy8CECnFbkD6QFWiDMxz6J4mOngrmHPwjuXvsFBUXhNc1_w@mail.gmail.com","threadId":"31633","inReplyTo":"CALKQrged+ptCQYm-=JKRborrAeKmaNFG=rDS8BQK5CNhwqjnkQ@mail.gmail.com","subject":"Re: [BUG?] Path limiting in \"git log\" when run from another subdir","fromName":"Nguyen Thai Ngoc Duy","fromEmail":"pclouds@gmail.com","sentAt":"2012-09-24T12:22:20Z","receivedAt":"2012-09-24T12:22:20Z","isPatch":false,"sender":{"key":"pclouds@gmail.com","avatar":"https://avatars.githubusercontent.com/u/720?v=4"},"body":"On Mon, Sep 24, 2012 at 6:59 PM, Johan Herland <johan@herland.net> wrote:\n> The following works in the git.git repo:\n>\n> $ cd t\n> $ git log -- /Documentation\n> [...]\n>\n\nWhat version? Mine (recent master) does not work\n\n~/w/git/t $ ../git log -- /Documentation\nfatal: '/Documentation' is outside repository\n\n> but the following does not:\n>\n> $ cd t\n> $ git log -- /Documentation/RelNotes\n> fatal: Could not switch to '/Documentation': No such file or directory\n>\n>\n> Is this the intended behavior?\n-- \nDuy\n"},{"id":"199799","messageId":"CALKQrgfb8qbeKmCzri27iA1qk9H8R4FgyA-YsUQf_JQRWvGK4g@mail.gmail.com","threadId":"31633","inReplyTo":"CACsJy8CECnFbkD6QFWiDMxz6J4mOngrmHPwjuXvsFBUXhNc1_w@mail.gmail.com","subject":"Re: [BUG?] Path limiting in \"git log\" when run from another subdir","fromName":"Johan Herland","fromEmail":"johan@herland.net","sentAt":"2012-09-24T13:16:46Z","receivedAt":"2012-09-24T13:16:46Z","isPatch":false,"sender":{"key":"johan@herland.net","avatar":"https://avatars.githubusercontent.com/u/547031?v=4"},"body":"On Mon, Sep 24, 2012 at 2:22 PM, Nguyen Thai Ngoc Duy <pclouds@gmail.com> wrote:\n> On Mon, Sep 24, 2012 at 6:59 PM, Johan Herland <johan@herland.net> wrote:\n>> The following works in the git.git repo:\n>>\n>> $ cd t\n>> $ git log -- /Documentation\n>> [...]\n>>\n>\n> What version? Mine (recent master) does not work\n>\n> ~/w/git/t $ ../git log -- /Documentation\n> fatal: '/Documentation' is outside repository\n\nWe initially found it on 1.7.9.5, and conrfirmed it on various 1.7.10\nversions. A bisect reveals that this behavior changed in\nv1.7.11.5-35-gf4c21e8 (Michael Haggerty: real_path(): properly handle\nnonexistent top-level paths).\n\nDoes this mean that \"git log -- /Documentation\" never should have\nworked in the first place (and was \"fixed\" by this commit), or that it\nshould work (but was broken by this commit)?\n\nIn any case, what is the _preferred_ way to path-limit \"git log\" to\nDocumentation/RelNotes, when my cwd is t/?\n\n\nThanks for your help,\n\n...Johan\n\n>> but the following does not:\n>>\n>> $ cd t\n>> $ git log -- /Documentation/RelNotes\n>> fatal: Could not switch to '/Documentation': No such file or directory\n>>\n>>\n>> Is this the intended behavior?\n> --\n> Duy\n\n\n\n-- \nJohan Herland, <johan@herland.net>\nwww.herland.net\n"},{"id":"199801","messageId":"CACsJy8A4-XC7AS4ZqZ1Whsoo-mztTNFvEnk810e10-rwXBkJHA@mail.gmail.com","threadId":"31633","inReplyTo":"CALKQrgfb8qbeKmCzri27iA1qk9H8R4FgyA-YsUQf_JQRWvGK4g@mail.gmail.com","subject":"Re: [BUG?] Path limiting in \"git log\" when run from another subdir","fromName":"Nguyen Thai Ngoc Duy","fromEmail":"pclouds@gmail.com","sentAt":"2012-09-24T13:30:49Z","receivedAt":"2012-09-24T13:30:49Z","isPatch":false,"sender":{"key":"pclouds@gmail.com","avatar":"https://avatars.githubusercontent.com/u/720?v=4"},"body":"On Mon, Sep 24, 2012 at 8:16 PM, Johan Herland <johan@herland.net> wrote:\n> On Mon, Sep 24, 2012 at 2:22 PM, Nguyen Thai Ngoc Duy <pclouds@gmail.com> wrote:\n>> On Mon, Sep 24, 2012 at 6:59 PM, Johan Herland <johan@herland.net> wrote:\n>>> The following works in the git.git repo:\n>>>\n>>> $ cd t\n>>> $ git log -- /Documentation\n>>> [...]\n>>>\n>>\n>> What version? Mine (recent master) does not work\n>>\n>> ~/w/git/t $ ../git log -- /Documentation\n>> fatal: '/Documentation' is outside repository\n>\n> We initially found it on 1.7.9.5, and conrfirmed it on various 1.7.10\n> versions. A bisect reveals that this behavior changed in\n> v1.7.11.5-35-gf4c21e8 (Michael Haggerty: real_path(): properly handle\n> nonexistent top-level paths).\n\nOK checking. I still don't know why it does not happen to me. Any\nspecial in gitdir/worktree setting? That commit is in master.\n\n> Does this mean that \"git log -- /Documentation\" never should have\n> worked in the first place (and was \"fixed\" by this commit), or that it\n> should work (but was broken by this commit)?\n\nI think that should mean Documentation at root. \"git log -- `chdir\n../Documentation;pwd`\" works and that clearly conflicts with\ninterpreting \"/Documentation\" as the directory at worktree's root.\n\n> In any case, what is the _preferred_ way to path-limit \"git log\" to\n> Documentation/RelNotes, when my cwd is t/?\n\nIf you want worktree root no matter where you stand, use \"git log --\n:/Documentation/RelNotes\". The idea is \":\" starts some \"magic\" in path\nhandling, but for now there is only \":/\". Or if you don't like magic,\n`git rev-parse --git-dir` should give you worktree's root to start\nwith.\n-- \nDuy\n"},{"id":"199803","messageId":"CACsJy8AXonkSXNU_uUXh=d2wojOhAn+S1JW7eUMywxohnAOXjg@mail.gmail.com","threadId":"31633","inReplyTo":"CACsJy8A4-XC7AS4ZqZ1Whsoo-mztTNFvEnk810e10-rwXBkJHA@mail.gmail.com","subject":"Re: [BUG?] Path limiting in \"git log\" when run from another subdir","fromName":"Nguyen Thai Ngoc Duy","fromEmail":"pclouds@gmail.com","sentAt":"2012-09-24T13:39:13Z","receivedAt":"2012-09-24T13:39:13Z","isPatch":false,"sender":{"key":"pclouds@gmail.com","avatar":"https://avatars.githubusercontent.com/u/720?v=4"},"body":"On Mon, Sep 24, 2012 at 8:30 PM, Nguyen Thai Ngoc Duy <pclouds@gmail.com> wrote:\n> Any special in gitdir/worktree setting?\n\nWhat does \"GIT_TRACE_SETUP=1 git log -- /Documentation\" show?\n-- \nDuy\n"},{"id":"199804","messageId":"CALKQrget=YpoZuH+aRdiey_S==37SPnJ+PvwiDpSM2701w602A@mail.gmail.com","threadId":"31633","inReplyTo":"CACsJy8A4-XC7AS4ZqZ1Whsoo-mztTNFvEnk810e10-rwXBkJHA@mail.gmail.com","subject":"Re: [BUG?] Path limiting in \"git log\" when run from another subdir","fromName":"Johan Herland","fromEmail":"johan@herland.net","sentAt":"2012-09-24T14:04:29Z","receivedAt":"2012-09-24T14:04:29Z","isPatch":false,"sender":{"key":"johan@herland.net","avatar":"https://avatars.githubusercontent.com/u/547031?v=4"},"body":"On Mon, Sep 24, 2012 at 3:30 PM, Nguyen Thai Ngoc Duy <pclouds@gmail.com> wrote:\n>> In any case, what is the _preferred_ way to path-limit \"git log\" to\n>> Documentation/RelNotes, when my cwd is t/?\n>\n> If you want worktree root no matter where you stand, use \"git log --\n> :/Documentation/RelNotes\". The idea is \":\" starts some \"magic\" in path\n> handling, but for now there is only \":/\". Or if you don't like magic,\n> `git rev-parse --git-dir` should give you worktree's root to start\n> with.\n\nAh, ok, that's exactly what I wanted. Then I guess \"cd t && git log --\n/Documentation\" should have never worked in the first place, and I\nquestion about \"git log -- /Documentation/RelNotes\" was misguided.\n\nThanks for clearing up my confusion.\n\n\n...Johan\n\n-- \nJohan Herland, <johan@herland.net>\nwww.herland.net\n"},{"id":"199806","messageId":"CALKQrgdhFCUs+gqT=PrT3w7suGzvnj7Wo8GfipHHQm6b=TZF+A@mail.gmail.com","threadId":"31633","inReplyTo":"CACsJy8AXonkSXNU_uUXh=d2wojOhAn+S1JW7eUMywxohnAOXjg@mail.gmail.com","subject":"Re: [BUG?] Path limiting in \"git log\" when run from another subdir","fromName":"Johan Herland","fromEmail":"johan@herland.net","sentAt":"2012-09-24T14:11:11Z","receivedAt":"2012-09-24T14:11:11Z","isPatch":false,"sender":{"key":"johan@herland.net","avatar":"https://avatars.githubusercontent.com/u/547031?v=4"},"body":"On Mon, Sep 24, 2012 at 3:39 PM, Nguyen Thai Ngoc Duy <pclouds@gmail.com> wrote:\n> On Mon, Sep 24, 2012 at 8:30 PM, Nguyen Thai Ngoc Duy <pclouds@gmail.com> wrote:\n>> Any special in gitdir/worktree setting?\n>\n> What does \"GIT_TRACE_SETUP=1 git log -- /Documentation\" show?\n\nFWIW, this issue is resolved as far as I'm concerned. I was simply\nusing the wrong syntax...\n\nAnyway, with current master:\n\n$ GIT_TRACE_SETUP=1 ../git log -1 -- /Documentation\nsetup: git_dir: .git\nsetup: worktree: /home/jherland/git/git\nsetup: cwd: /home/jherland/git/git\nsetup: prefix: t/\nfatal: '/Documentation' is outside repository\n\nWith v1.7.11:\n\n$ GIT_TRACE_SETUP=1 ../git log -1 -- /Documentation\nsetup: git_dir: .git\nsetup: worktree: /home/jherland/git/git\nsetup: cwd: /home/jherland/git/git\nsetup: prefix: t/\ncommit 0ce2e396ee9fb0fa07e8381b338e49859dbf03db\nAuthor: Junio C Hamano <gitster@pobox.com>\nDate:   Sun Jun 17 14:07:15 2012 -0700\n\n    Git 1.7.11\n\n    Signed-off-by: Junio C Hamano <gitster@pobox.com>\n\n\n...Johan\n\n-- \nJohan Herland, <johan@herland.net>\nwww.herland.net\n"}]}