{"thread":{"id":"22276","subject":"\"warning: Updating the currently checked out branch may cause confusion\" on bare repositories","startedAt":"2010-01-18T22:41:26Z","lastAt":"2010-01-19T22:43:44Z","messageCount":5,"participants":["Adam Megacz","Shawn O. Pearce","Jeff King"],"isPatch":false,"patchVersion":null,"patchTotal":null},"messages":[{"id":"132056","messageId":"xuu2ska3doix.fsf@nowhere.com","threadId":"22276","inReplyTo":null,"subject":"\"warning: Updating the currently checked out branch may cause confusion\" on bare repositories","fromName":"Adam Megacz","fromEmail":"adam@megacz.com","sentAt":"2010-01-18T22:41:26Z","receivedAt":"2010-01-18T22:41:26Z","isPatch":false,"sender":{"key":"adam@megacz.com","avatar":null},"body":"\nIt seems that the message \"warning: Updating the currently checked out\nbranch may cause confusion\" is unnecessary when pushing to a bare\n\"myproject.git\" repository (instead of a \"myproject/.git\" repository).\n\nIs this the case?\n\nIf so, perhaps the warning should be omitted when the target is a bare\nrepository.\n\n  - a\n"},{"id":"132074","messageId":"20100119062904.GB23212@spearce.org","threadId":"22276","inReplyTo":"xuu2ska3doix.fsf@nowhere.com","subject":"Re: \"warning: Updating the currently checked out branch may cause confusion\" on bare repositories","fromName":"Shawn O. Pearce","fromEmail":"spearce@spearce.org","sentAt":"2010-01-19T06:29:04Z","receivedAt":"2010-01-19T06:29:04Z","isPatch":false,"sender":{"key":"spearce@spearce.org","avatar":"https://avatars.githubusercontent.com/u/34844?v=4"},"body":"Adam Megacz <adam@megacz.com> wrote:\n> \n> It seems that the message \"warning: Updating the currently checked out\n> branch may cause confusion\" is unnecessary when pushing to a bare\n> \"myproject.git\" repository (instead of a \"myproject/.git\" repository).\n> \n> Is this the case?\n> \n> If so, perhaps the warning should be omitted when the target is a bare\n> repository.\n\nThat should already be the case.  Did you create the bare repository\nby taking a copy of a non-bare's .git directory?  Check your bare\nrepository's config file and see if core.bare = false, if so set\nit to true to signal it really is bare.\n\n-- \nShawn.\n"},{"id":"132128","messageId":"xuu2my093owy.fsf@nowhere.com","threadId":"22276","inReplyTo":"20100119062904.GB23212@spearce.org","subject":"Re: \"warning: Updating the currently checked out branch may cause confusion\" on bare repositories","fromName":"Adam Megacz","fromEmail":"adam@megacz.com","sentAt":"2010-01-19T18:55:25Z","receivedAt":"2010-01-19T18:55:25Z","isPatch":false,"sender":{"key":"adam@megacz.com","avatar":null},"body":"\n\"Shawn O. Pearce\" <spearce@spearce.org> writes:\n> That should already be the case.  Did you create the bare repository\n> by taking a copy of a non-bare's .git directory?  Check your bare\n> repository's config file and see if core.bare = false, if so set\n> it to true to signal it really is bare.\n\nHrm, is there a reason why this is explicitly configured rather than\ndetected?\n\nI was under the impression that you could create a bare repository by\nsimply throwing away the working tree and renaming \".git\" to any other\nname, but I guess I was wrong.\n\n  - a\n"},{"id":"132129","messageId":"20100119185906.GF23466@spearce.org","threadId":"22276","inReplyTo":"xuu2my093owy.fsf@nowhere.com","subject":"Re: \"warning: Updating the currently checked out branch may cause confusion\" on bare repositories","fromName":"Shawn O. Pearce","fromEmail":"spearce@spearce.org","sentAt":"2010-01-19T18:59:06Z","receivedAt":"2010-01-19T18:59:06Z","isPatch":false,"sender":{"key":"spearce@spearce.org","avatar":"https://avatars.githubusercontent.com/u/34844?v=4"},"body":"Adam Megacz <adam@megacz.com> wrote:\n> \"Shawn O. Pearce\" <spearce@spearce.org> writes:\n> > That should already be the case.  Did you create the bare repository\n> > by taking a copy of a non-bare's .git directory?  Check your bare\n> > repository's config file and see if core.bare = false, if so set\n> > it to true to signal it really is bare.\n> \n> Hrm, is there a reason why this is explicitly configured rather than\n> detected?\n\nI don't know why we do this.  I think its because the guessing\nlogic can guess wrong sometimes.\n \n> I was under the impression that you could create a bare repository by\n> simply throwing away the working tree and renaming \".git\" to any other\n> name, but I guess I was wrong.\n\nIf you delete the setting from the configuration file, Git usually\nalmost always guesses correctly.  :-)\n\nIts rare to see it fail.  But I think it can fail if you create\na file called HEAD in the top level of your source code tree.\n(For example.)\n\n-- \nShawn.\n"},{"id":"132145","messageId":"20100119224343.GA11758@coredump.intra.peff.net","threadId":"22276","inReplyTo":"20100119185906.GF23466@spearce.org","subject":"Re: \"warning: Updating the currently checked out branch may cause confusion\" on bare repositories","fromName":"Jeff King","fromEmail":"peff@peff.net","sentAt":"2010-01-19T22:43:44Z","receivedAt":"2010-01-19T22:43:44Z","isPatch":false,"sender":{"key":"peff@peff.net","avatar":"https://avatars.githubusercontent.com/u/45925?v=4"},"body":"On Tue, Jan 19, 2010 at 10:59:06AM -0800, Shawn O. Pearce wrote:\n\n> Adam Megacz <adam@megacz.com> wrote:\n> > \"Shawn O. Pearce\" <spearce@spearce.org> writes:\n> > > That should already be the case.  Did you create the bare repository\n> > > by taking a copy of a non-bare's .git directory?  Check your bare\n> > > repository's config file and see if core.bare = false, if so set\n> > > it to true to signal it really is bare.\n> > \n> > Hrm, is there a reason why this is explicitly configured rather than\n> > detected?\n> \n> I don't know why we do this.  I think its because the guessing\n> logic can guess wrong sometimes.\n\nYup, although I am having trouble finding any actual discussion of when\nit can go wrong. There is some mention here:\n\n  http://article.gmane.org/gmane.comp.version-control.git/35993\n\nand a little bit here in the 1.5.0 release notes:\n\n  http://article.gmane.org/gmane.comp.version-control.git/39612\n\nBut the latter talks about the heuristic being \"does it end with .git\",\nwhich I don't think we actually use anymore. So who knows if the\nheuristic failures are even trigger-able anymore. I tried looking at the\nsetup code for an answer, but my eyes started bleeding from the horrible\nspaghetti code and I couldn't make out any of the text.\n\n> Its rare to see it fail.  But I think it can fail if you create\n> a file called HEAD in the top level of your source code tree.\n> (For example.)\n\nI don't think that would do it. When looking for a git dir we check for\na well-formed HEAD, as well as objects and refs directories. The is_bare\ncheck seems to be more about \"did we actually find a workdir\" these\ndays.\n\n-Peff\n"}]}