{"thread":{"id":"14265","subject":"[BUG] Git looks for repository in wrong directory","startedAt":"2008-07-03T00:16:26Z","lastAt":"2008-07-03T19:28:12Z","messageCount":4,"participants":["David ‘Bombe’ Roden","Junio C Hamano"],"isPatch":false,"patchVersion":null,"patchTotal":null},"messages":[{"id":"82048","messageId":"200807030216.28921.bombe@pterodactylus.net","threadId":"14265","inReplyTo":null,"subject":"[BUG] Git looks for repository in wrong directory","fromName":"David ‘Bombe’ Roden","fromEmail":"bombe@pterodactylus.net","sentAt":"2008-07-03T00:16:26Z","receivedAt":"2008-07-03T00:16:26Z","isPatch":false,"sender":{"key":"bombe@pterodactylus.net","avatar":"https://gravatar.com/avatar/6845b170b5e882edcb27b015cdad0fb918f2d079c2cf77e668dcc71ae645ed87?d=mp&s=160"},"body":"Hi.\n\nThe following sequence:\n\nmkdir r1\ncd r1\ngit init\necho a > a\ngit add a\ngit commit -m \"a\"\ncd ..\ngit clone r1 r1.git\ncd r1\necho b > b\ngit add b\ngit commit -m \"b\"\ncd ..\ngit ls-remote r1\ngit ls-remote r1/.\n\nshows that Git searches for a repository in the wrong place. I think the last \ntwo commands should output exactly the same but \"git ls-remote r1\" actually \nlists the contents of \"r1.git\". Is that a bug or is this (extremely \nconfusing) behaviour intended?\n\nThis also afflicts the behaviour of \"git-pull\" and friends. I cloned a \ndirectory and tried to pull new commits but I repeatedly got stuck with an \nolder commit. I have to move a second directory that was named like the first \ndirectory, only with an appended \".git\", out of the way so that I could \naccess the repository I asked for.\n\nUsed Git version is 1.5.6.1 on Linux 2.6.25.6 (Gentoo/x86).\n\n\n\tDavid\n"},{"id":"82051","messageId":"7vtzf76c60.fsf@gitster.siamese.dyndns.org","threadId":"14265","inReplyTo":"200807030216.28921.bombe@pterodactylus.net","subject":"Re: [BUG] Git looks for repository in wrong directory","fromName":"Junio C Hamano","fromEmail":"gitster@pobox.com","sentAt":"2008-07-03T00:31:35Z","receivedAt":"2008-07-03T00:31:35Z","isPatch":false,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"David ‘Bombe’ Roden  <bombe@pterodactylus.net> writes:\n\n> git clone r1 r1.git\n> cd r1\n> echo b > b\n> git add b\n> git commit -m \"b\"\n> cd ..\n> git ls-remote r1\n> git ls-remote r1/.\n>\n> shows that Git searches for a repository in the wrong place. I think the last \n> two commands should output exactly the same but \"git ls-remote r1\" actually \n> lists the contents of \"r1.git\". Is that a bug or is this (extremely \n> confusing) behaviour intended?\n\nThis is age old usability feature that lets you say \"ls-remote r1\" even\nwhen you do *not* have \"r1.git\", and is not limited to the local file\ntransport but also applicable when peeking a remote repository over the\nnative transport.\n\nIf you have both, you already have found the way to disambiguate ;-)\n"},{"id":"82053","messageId":"200807030305.17767.bombe@pterodactylus.net","threadId":"14265","inReplyTo":"7vtzf76c60.fsf@gitster.siamese.dyndns.org","subject":"Re: [BUG] Git looks for repository in wrong directory","fromName":"David ‘Bombe’ Roden","fromEmail":"bombe@pterodactylus.net","sentAt":"2008-07-03T01:05:15Z","receivedAt":"2008-07-03T01:05:15Z","isPatch":false,"sender":{"key":"bombe@pterodactylus.net","avatar":"https://gravatar.com/avatar/6845b170b5e882edcb27b015cdad0fb918f2d079c2cf77e668dcc71ae645ed87?d=mp&s=160"},"body":"On Thursday 03 July 2008 02:31:35 Junio C Hamano wrote:\n\n> This is age old usability feature that lets you say \"ls-remote r1\" even\n> when you do *not* have \"r1.git\"\n\nIs it just me or does that sentence not make any sense at all? ;)\n\nI mean, _of cource_ I want the contents of \"r1\" if I say \"give me the contents \nof r1\". I could understand if Git looked in \"r1.git\" if there was no \"r1\" but \nthe way it is currently done is plain wrong. IMHO, of course.\n\n\n> If you have both, you already have found the way to disambiguate ;-)\n\nYes, _now_ I know. In my opinion it’s very unintuitive and should be changed. \nAnd if—for some strange reason—this is to be kept as a compatibility feature \nit should at least be documented somewhere in large red blinking letters that \nunder certain circumstances Git doesn’t care about the path you give it but \nsimply chooses to look somewhere else. :)\n\n\n\tDavid\n"},{"id":"82146","messageId":"7v4p7622er.fsf@gitster.siamese.dyndns.org","threadId":"14265","inReplyTo":"200807030305.17767.bombe@pterodactylus.net","subject":"Re: [BUG] Git looks for repository in wrong directory","fromName":"Junio C Hamano","fromEmail":"gitster@pobox.com","sentAt":"2008-07-03T19:28:12Z","receivedAt":"2008-07-03T19:28:12Z","isPatch":false,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"David ‘Bombe’ Roden  <bombe@pterodactylus.net> writes:\n\n>> If you have both, you already have found the way to disambiguate ;-)\n>\n> Yes, _now_ I know. In my opinion it’s very unintuitive and should be changed. \nI'm of mixed mind about this.\n\nI am guessing that the original motivation was that people can have\nunversioned \"project/\" that perhaps is an extract from the tarball and\n\"project.git/\" that is version-controlled by git, and when they want to\ntalk about the repository they can say either \"project.git\" and \"project\"\nto get to the git-managed one, even if \"project/\" directory exists.\n\nIt may be an improvement if we checked to see if the original name does\nrefer to a git repository and use that without falling back.  Even though\nI do not personally care so deeply about this, I won't be opposed to such\nan improvement.\n"}]}