{"thread":{"id":"13000","subject":"[bug] git-clone over ssh fails when repository has local commits","startedAt":"2008-04-06T13:45:22Z","lastAt":"2008-04-06T20:50:25Z","messageCount":11,"participants":["seventh guardian","Jeff King","Jakub Narebski"],"isPatch":false,"patchVersion":null,"patchTotal":null},"messages":[{"id":"73740","messageId":"1caff7430804060645s764f24f8y3d07ee8647ec8f25@mail.gmail.com","threadId":"13000","inReplyTo":null,"subject":"[bug] git-clone over ssh fails when repository has local commits","fromName":"seventh guardian","fromEmail":"seventhguardian@gmail.com","sentAt":"2008-04-06T13:45:22Z","receivedAt":"2008-04-06T13:45:22Z","isPatch":false,"sender":{"key":"seventhguardian@gmail.com","avatar":null},"body":"Hello,\n\nFirst of all I kindly ask you to put my e-mail in CC as I'm not\nsubscribed to the list. Secondly, I did try to find similar issues on\nthe archives, but failed to do so. I apologize if this is not a bug.\n\nI keep some local git repositories on my laptop, which are also used\nby other machines on my home network. In order to avoid unnecessary\nburden on the master servers, I've tried keeping a \"local master\" on\nthe laptop and clone the repo's over ssh on the other machines.\n\nI have some local commits on some of the \"local master\" repo's, and\nthat's where the problems start: while cloning over ssh works fine for\nthe unchanged repo's, those which have local commits are impossible to\nclone. The error on the \"slave\" machines is this:\n\n $ git-clone ssh://<host>/<path>\nInitialized empty Git repository in <path>/.git/\nPassword:\nremote: Counting objects: 132468, done.\nremote: Compressing objects: 100% (25543/25543), done.\nremote: Total 132468 (delta 107355), reused 130574 (delta 105466)\nReceiving objects: 100% (132468/132468), 42.12 MiB | 4161 KiB/s, done.\nResolving deltas: 100% (107355/107355), done.\nerror: Trying to write ref REMOTE_HEAD with nonexistant object\nf7a51afd56964cb0f10178353315d2680832ea54\nfatal: Cannot update the ref 'REMOTE_HEAD'.\nWarning: Remote HEAD refers to nonexistent ref, unable to checkout.\n\nwhere I've \"obfuscated\" the hostname and the repository path. I'm\nusing the latest version, 1.5.4.5.\n\nThanks,\n  Renato Caldas\n"},{"id":"73745","messageId":"20080406161120.GB24358@coredump.intra.peff.net","threadId":"13000","inReplyTo":"1caff7430804060645s764f24f8y3d07ee8647ec8f25@mail.gmail.com","subject":"Re: [bug] git-clone over ssh fails when repository has local commits","fromName":"Jeff King","fromEmail":"peff@peff.net","sentAt":"2008-04-06T16:11:20Z","receivedAt":"2008-04-06T16:11:20Z","isPatch":false,"sender":{"key":"peff@peff.net","avatar":"https://avatars.githubusercontent.com/u/45925?v=4"},"body":"On Sun, Apr 06, 2008 at 02:45:22PM +0100, seventh guardian wrote:\n\n>  $ git-clone ssh://<host>/<path>\n> Initialized empty Git repository in <path>/.git/\n> Password:\n> remote: Counting objects: 132468, done.\n> remote: Compressing objects: 100% (25543/25543), done.\n> remote: Total 132468 (delta 107355), reused 130574 (delta 105466)\n> Receiving objects: 100% (132468/132468), 42.12 MiB | 4161 KiB/s, done.\n> Resolving deltas: 100% (107355/107355), done.\n> error: Trying to write ref REMOTE_HEAD with nonexistant object\n> f7a51afd56964cb0f10178353315d2680832ea54\n> fatal: Cannot update the ref 'REMOTE_HEAD'.\n> Warning: Remote HEAD refers to nonexistent ref, unable to checkout.\n\nIt sounds like your remote repository has a bogus HEAD that points to a\nnon-existent object. Can you ssh to <host> and confirm that you can do a\n\"git show HEAD\" in the remote repo?\n\n-Peff\n"},{"id":"73746","messageId":"1caff7430804060922seba4978qa13b123103b8282b@mail.gmail.com","threadId":"13000","inReplyTo":"20080406161120.GB24358@coredump.intra.peff.net","subject":"Re: [bug] git-clone over ssh fails when repository has local commits","fromName":"seventh guardian","fromEmail":"seventhguardian@gmail.com","sentAt":"2008-04-06T16:22:39Z","receivedAt":"2008-04-06T16:22:39Z","isPatch":false,"sender":{"key":"seventhguardian@gmail.com","avatar":null},"body":"On Sun, Apr 6, 2008 at 5:11 PM, Jeff King <peff@peff.net> wrote:\n> On Sun, Apr 06, 2008 at 02:45:22PM +0100, seventh guardian wrote:\n>\n>  >  $ git-clone ssh://<host>/<path>\n>  > Initialized empty Git repository in <path>/.git/\n>  > Password:\n>  > remote: Counting objects: 132468, done.\n>  > remote: Compressing objects: 100% (25543/25543), done.\n>  > remote: Total 132468 (delta 107355), reused 130574 (delta 105466)\n>  > Receiving objects: 100% (132468/132468), 42.12 MiB | 4161 KiB/s, done.\n>  > Resolving deltas: 100% (107355/107355), done.\n>  > error: Trying to write ref REMOTE_HEAD with nonexistant object\n>  > f7a51afd56964cb0f10178353315d2680832ea54\n>  > fatal: Cannot update the ref 'REMOTE_HEAD'.\n>  > Warning: Remote HEAD refers to nonexistent ref, unable to checkout.\n>\n>  It sounds like your remote repository has a bogus HEAD that points to a\n>  non-existent object. Can you ssh to <host> and confirm that you can do a\n>  \"git show HEAD\" in the remote repo?\n\nI can, but it is a local commit. It seems like local commits aren't\nbeing \"cloned over\" to the slaves.. As I said, this only happens for\n\"local masters\" where I have local commits. If my master is untouched,\nthen I can successfuly clone the repo.\n\nThanks,\n  Renato\n"},{"id":"73748","messageId":"20080406165655.GA26060@coredump.intra.peff.net","threadId":"13000","inReplyTo":"1caff7430804060922seba4978qa13b123103b8282b@mail.gmail.com","subject":"Re: [bug] git-clone over ssh fails when repository has local commits","fromName":"Jeff King","fromEmail":"peff@peff.net","sentAt":"2008-04-06T16:56:55Z","receivedAt":"2008-04-06T16:56:55Z","isPatch":false,"sender":{"key":"peff@peff.net","avatar":"https://avatars.githubusercontent.com/u/45925?v=4"},"body":"On Sun, Apr 06, 2008 at 05:22:39PM +0100, seventh guardian wrote:\n\n> I can, but it is a local commit. It seems like local commits aren't\n> being \"cloned over\" to the slaves.. As I said, this only happens for\n> \"local masters\" where I have local commits. If my master is untouched,\n> then I can successfuly clone the repo.\n\nYou are going to have to clarify what you mean by \"local commit\" and\n\"local master\". Those aren't terms that are commonly used, so I don't\nunderstand what you are talking about. Can you describe which git\ncommands you used to create this situation?\n\n-Peff\n"},{"id":"73750","messageId":"1caff7430804061011ye82e74v289dd3536b253bcb@mail.gmail.com","threadId":"13000","inReplyTo":"20080406165655.GA26060@coredump.intra.peff.net","subject":"Re: [bug] git-clone over ssh fails when repository has local commits","fromName":"seventh guardian","fromEmail":"seventhguardian@gmail.com","sentAt":"2008-04-06T17:11:12Z","receivedAt":"2008-04-06T17:11:12Z","isPatch":false,"sender":{"key":"seventhguardian@gmail.com","avatar":null},"body":"On Sun, Apr 6, 2008 at 5:56 PM, Jeff King <peff@peff.net> wrote:\n> On Sun, Apr 06, 2008 at 05:22:39PM +0100, seventh guardian wrote:\n>\n>  > I can, but it is a local commit. It seems like local commits aren't\n>  > being \"cloned over\" to the slaves.. As I said, this only happens for\n>  > \"local masters\" where I have local commits. If my master is untouched,\n>  > then I can successfuly clone the repo.\n>\n>  You are going to have to clarify what you mean by \"local commit\" and\n>  \"local master\". Those aren't terms that are commonly used, so I don't\n>  understand what you are talking about. Can you describe which git\n>  commands you used to create this situation?\n\nI figured ;) Let me see if I can explain it better:\n\nremote master: the project git server, located remotely over the internet\nlocal master: my laptop repository, made by cloning the project master repo\nslave(s): my local machines, which clone the local master, instead of\nthe remote master (to save bandwidth)\n\nSo on the local master (my laptop) I did:\n$ git-clone http://remote.master.address/foo/bar.git\n\nBecause I had to do some local changes to the code (what I've called a\n\"local commit\"), I did this on the local master:\n$ git-commit -a\n\nNow I want a copy of the repository on another machine, \"slave\". So I do this:\n$ git-clone ssh://local.master.address/path/to/repo\n\nWhich gives the annoying error.. If I skipped the \"local commit\"\nstuff, then the cloning would work perfectly.\n\nI hope this is clear now.. Thanks!\n  Renato\n"},{"id":"73752","messageId":"20080406175136.GB32399@coredump.intra.peff.net","threadId":"13000","inReplyTo":"1caff7430804061011ye82e74v289dd3536b253bcb@mail.gmail.com","subject":"Re: [bug] git-clone over ssh fails when repository has local commits","fromName":"Jeff King","fromEmail":"peff@peff.net","sentAt":"2008-04-06T17:51:36Z","receivedAt":"2008-04-06T17:51:36Z","isPatch":false,"sender":{"key":"peff@peff.net","avatar":"https://avatars.githubusercontent.com/u/45925?v=4"},"body":"On Sun, Apr 06, 2008 at 06:11:12PM +0100, seventh guardian wrote:\n\n> I figured ;) Let me see if I can explain it better:\n> \n> remote master: the project git server, located remotely over the internet\n> local master: my laptop repository, made by cloning the project master repo\n> slave(s): my local machines, which clone the local master, instead of\n> the remote master (to save bandwidth)\n\nOK, I understand now. I think that is a reasonable terminology for your\nsituation, but keep in mind that git doesn't really understand the\nconcept of a \"master\". From the perspective of your slaves, there is\nonly your \"local master\" as the remote \"origin\", and they can't tell any\ndifference between that and the original \"remote master\".\n\n> So on the local master (my laptop) I did:\n> $ git-clone http://remote.master.address/foo/bar.git\n> \n> Because I had to do some local changes to the code (what I've called a\n> \"local commit\"), I did this on the local master:\n> $ git-commit -a\n> \n> Now I want a copy of the repository on another machine, \"slave\". So I do this:\n> $ git-clone ssh://local.master.address/path/to/repo\n> \n> Which gives the annoying error.. If I skipped the \"local commit\"\n> stuff, then the cloning would work perfectly.\n\nHmm. This _should_ just work, but something funny is going on. For some\nreason the \"local master\" is telling us that his HEAD points to\nf7a51afd, but we don't actually get that object. But I'm not quite sure\nhow we get into that situation; my guess is that there is something\nconfusing going on at the remote master, since the http fetching code is\nnot as strict and might fail to notice a missing object there. Is it\npossible for us to see the remote master so we can take a look?\n\n-Peff\n"},{"id":"73753","messageId":"1caff7430804061106m49a60bc0wbbd9001394e83589@mail.gmail.com","threadId":"13000","inReplyTo":"20080406175136.GB32399@coredump.intra.peff.net","subject":"Re: [bug] git-clone over ssh fails when repository has local commits","fromName":"seventh guardian","fromEmail":"seventhguardian@gmail.com","sentAt":"2008-04-06T18:06:40Z","receivedAt":"2008-04-06T18:06:40Z","isPatch":false,"sender":{"key":"seventhguardian@gmail.com","avatar":null},"body":"On Sun, Apr 6, 2008 at 6:51 PM, Jeff King <peff@peff.net> wrote:\n> On Sun, Apr 06, 2008 at 06:11:12PM +0100, seventh guardian wrote:\n>\n>  Hmm. This _should_ just work, but something funny is going on. For some\n>  reason the \"local master\" is telling us that his HEAD points to\n>  f7a51afd, but we don't actually get that object.\n\nThis object is the correct HEAD, but it is a local commit (I rebase\nall local changes so that they stay \"on top\" of the original code).\n\n>  But I'm not quite sure\n>  how we get into that situation; my guess is that there is something\n>  confusing going on at the remote master, since the http fetching code is\n>  not as strict and might fail to notice a missing object there. Is it\n>  possible for us to see the remote master so we can take a look?\n\nSure, I just thought it would confuse more than it would help. I was\nobviously wrong, as I'm actually using git:// instead of http://....\nsorry... ;)\n\n I'm experiencing this with both these repo's, as I have committed\nsome local changes to them:\n\ngit://anongit.freedesktop.org/git/nouveau/mesa\ngit://anongit.freedesktop.org/git/nouveau/xf86-video-nouveau/\n\nOn the other hand, I don't have this issue with this repo, which\ndoesn't have any local commit:\n\ngit://anongit.freedesktop.org/git/mesa/drm/\n\nNow that I look at the addresses, the \"nouveau\" part is common to the\nproblematic repo's. I'll make a local change on the last repo and see\nif it also exhibits the problem. I'll report back ASAP.\n\nCheers,\n  Renato\n"},{"id":"73754","messageId":"1caff7430804061111u743e6257vf34d35303c864b49@mail.gmail.com","threadId":"13000","inReplyTo":"1caff7430804061106m49a60bc0wbbd9001394e83589@mail.gmail.com","subject":"Re: [bug] git-clone over ssh fails when repository has local commits","fromName":"seventh guardian","fromEmail":"seventhguardian@gmail.com","sentAt":"2008-04-06T18:11:09Z","receivedAt":"2008-04-06T18:11:09Z","isPatch":false,"sender":{"key":"seventhguardian@gmail.com","avatar":null},"body":"On Sun, Apr 6, 2008 at 7:06 PM, seventh guardian\n<seventhguardian@gmail.com> wrote:\n>  Now that I look at the addresses, the \"nouveau\" part is common to the\n>  problematic repo's. I'll make a local change on the last repo and see\n>  if it also exhibits the problem. I'll report back ASAP.\n\nThe last repo also exhibits the problem after committing a local\nchange. A hard reset to \"origin\" fixes the problem, but also throws\naway the local changes..\n\nCheers,\n  Renato\n"},{"id":"73755","messageId":"20080406181749.GA2218@coredump.intra.peff.net","threadId":"13000","inReplyTo":"1caff7430804061106m49a60bc0wbbd9001394e83589@mail.gmail.com","subject":"Re: [bug] git-clone over ssh fails when repository has local commits","fromName":"Jeff King","fromEmail":"peff@peff.net","sentAt":"2008-04-06T18:17:49Z","receivedAt":"2008-04-06T18:17:49Z","isPatch":false,"sender":{"key":"peff@peff.net","avatar":"https://avatars.githubusercontent.com/u/45925?v=4"},"body":"On Sun, Apr 06, 2008 at 07:06:40PM +0100, seventh guardian wrote:\n\n> This object is the correct HEAD, but it is a local commit (I rebase\n> all local changes so that they stay \"on top\" of the original code).\n\nThat shouldn't matter to git; it doesn't care at all about where commits\nwere created.\n\n> Sure, I just thought it would confuse more than it would help. I was\n> obviously wrong, as I'm actually using git:// instead of http://....\n> sorry... ;)\n\nHeh. OK, scratch what I said before then. :)\n\n>  I'm experiencing this with both these repo's, as I have committed\n> some local changes to them:\n> \n> git://anongit.freedesktop.org/git/nouveau/mesa\n> git://anongit.freedesktop.org/git/nouveau/xf86-video-nouveau/\n\nCan you give an exact set of steps to reproduce? There doesn't seem to\nbe anything wrong with those repos, and I was able to do:\n\n  m1$ git clone git://anongit.freedesktop.org/git/nouveau/xf86-video-nouveau/\n  m1$ cd xf86-video-nouveau && echo foo >>COPYING && git commit -a -m foo\n  m2$ git clone ssh://m1/path/to/xf86-video-nouveau\n\nSo now my guess is when you make local changes, something funny is going\non. Can you describe that process in more detail?\n\n-Peff\n"},{"id":"73763","messageId":"1caff7430804061202x1370d34aw41bf082c8fd4bd64@mail.gmail.com","threadId":"13000","inReplyTo":"20080406181749.GA2218@coredump.intra.peff.net","subject":"Re: [bug] git-clone over ssh fails when repository has local commits","fromName":"seventh guardian","fromEmail":"seventhguardian@gmail.com","sentAt":"2008-04-06T19:02:41Z","receivedAt":"2008-04-06T19:02:41Z","isPatch":false,"sender":{"key":"seventhguardian@gmail.com","avatar":null},"body":"On Sun, Apr 6, 2008 at 7:17 PM, Jeff King <peff@peff.net> wrote:\n> On Sun, Apr 06, 2008 at 07:06:40PM +0100, seventh guardian wrote:\n>\n>  Can you give an exact set of steps to reproduce? There doesn't seem to\n>  be anything wrong with those repos, and I was able to do:\n>\n>   m1$ git clone git://anongit.freedesktop.org/git/nouveau/xf86-video-nouveau/\n>   m1$ cd xf86-video-nouveau && echo foo >>COPYING && git commit -a -m foo\n>   m2$ git clone ssh://m1/path/to/xf86-video-nouveau\n>\n>  So now my guess is when you make local changes, something funny is going\n>  on. Can you describe that process in more detail?\n\nMy process is the same as yours, except for the \"time-torture\" the\nrepositories have suffered. Surprisingly, everything worked on a fresh\nclone. So I suspect my \"local master\" repo's are somewhat messed up..\nWill try to investigate further.\n\nThanks!\n  Renato\n"},{"id":"73776","messageId":"ftbd2e$b9k$1@ger.gmane.org","threadId":"13000","inReplyTo":"1caff7430804061111u743e6257vf34d35303c864b49@mail.gmail.com","subject":"Re: [bug] git-clone over ssh fails when repository has local commits","fromName":"Jakub Narebski","fromEmail":"jnareb@gmail.com","sentAt":"2008-04-06T20:50:25Z","receivedAt":"2008-04-06T20:50:25Z","isPatch":false,"sender":{"key":"jnareb@gmail.com","avatar":"https://avatars.githubusercontent.com/u/2706?v=4"},"body":"<opublikowany i wysłany>\n\nseventh guardian wrote:\n\n> On Sun, Apr 6, 2008 at 7:06 PM, seventh guardian\n> <seventhguardian@gmail.com> wrote:\n>>  Now that I look at the addresses, the \"nouveau\" part is common to the\n>>  problematic repo's. I'll make a local change on the last repo and see\n>>  if it also exhibits the problem. I'll report back ASAP.\n> \n> The last repo also exhibits the problem after committing a local\n> change. A hard reset to \"origin\" fixes the problem, but also throws\n> away the local changes..\n\nIt looks for me as permission problems, as thought loose objects\nget created unreadable by git daemon, or something...\n\n-- \nJakub Narebski\nWarsaw, Poland\nShadeHawk on #git\n"}]}