{"thread":{"id":"51956","subject":"git checkout with an ambiguous rev","startedAt":"2019-10-02T12:02:21Z","lastAt":"2019-10-02T13:28:39Z","messageCount":2,"participants":["Rohit Sarkar"],"isPatch":false,"patchVersion":null,"patchTotal":null},"messages":[{"id":"383269","messageId":"20191002120213.GB5812@SARKAR","threadId":"51956","inReplyTo":null,"subject":"git checkout with an ambiguous rev","fromName":"Rohit Sarkar","fromEmail":"rohitsarkar5398@gmail.com","sentAt":"2019-10-02T12:02:13Z","receivedAt":"2019-10-02T12:02:21Z","isPatch":false,"sender":{"key":"rohitsarkar5398@gmail.com","avatar":null},"body":"Hi,\nI was looking into writing a patch for the issue [1] where if an user has\nmultiple remotes each with a remote tracking branch of the same name say\nxyz, 'git checkout xyz' fails with \"error: pathspec 'xyz' did not match any\nfile(s) known to git.\"\n\nThis can sort of be handled by setting checkout.defaultRemote so that\nthe ambiguity is removed. Although when checkout.defaultRemote is not\nset or there are more than 2 remotes I think it would be helpful if git\ngives a message listing out the possible revs instead of the pathspec\nerror. What do you guys think?\n\n[1] : https://public-inbox.org/git/CACcTrKdzVCKUR8EfwhqBQR7vWzRqTLcwRJ_r-hx3VztD=xvNuQ@mail.gmail.com/\n"},{"id":"383273","messageId":"20191002132832.GD5812@SARKAR","threadId":"51956","inReplyTo":"20191002120213.GB5812@SARKAR","subject":"Re: git checkout with an ambiguous rev","fromName":"Rohit Sarkar","fromEmail":"rohitsarkar5398@gmail.com","sentAt":"2019-10-02T13:28:32Z","receivedAt":"2019-10-02T13:28:39Z","isPatch":false,"sender":{"key":"rohitsarkar5398@gmail.com","avatar":null},"body":"On Wed, Oct 02, 2019 at 05:32:13PM +0530, Rohit Sarkar wrote:\n> Hi,\n> I was looking into writing a patch for the issue [1] where if an user has\n> multiple remotes each with a remote tracking branch of the same name say\n> xyz, 'git checkout xyz' fails with \"error: pathspec 'xyz' did not match any\n> file(s) known to git.\"\n> \n> This can sort of be handled by setting checkout.defaultRemote so that\n> the ambiguity is removed. Although when checkout.defaultRemote is not\n> set or there are more than 2 remotes I think it would be helpful if git\n> gives a message listing out the possible revs instead of the pathspec\n> error. What do you guys think?\n> \n> [1] : https://public-inbox.org/git/CACcTrKdzVCKUR8EfwhqBQR7vWzRqTLcwRJ_r-hx3VztD=xvNuQ@mail.gmail.com/\n\nNvm. This was already handled in https://github.com/git/git/commit/ad8d5104b42108851b082d895018655ad5f9e4f3\nby Avar\n\nThanks,\nRohit\n"}]}