{"thread":{"id":"36773","subject":"Bug in shallow clone?","startedAt":"2014-05-28T14:02:03Z","lastAt":"2014-05-28T14:29:24Z","messageCount":3,"participants":["Thomas Kieffer","Duy Nguyen","Dennis Kaarsemaker"],"isPatch":false,"patchVersion":null,"patchTotal":null},"messages":[{"id":"242856","messageId":"5385EC5B.8050400@web.de","threadId":"36773","inReplyTo":null,"subject":"Bug in shallow clone?","fromName":"Thomas Kieffer","fromEmail":"thomaskieffer@web.de","sentAt":"2014-05-28T14:02:03Z","receivedAt":"2014-05-28T14:02:03Z","isPatch":false,"sender":{"key":"thomaskieffer@web.de","avatar":null},"body":"Hi there Git developers,\n\nI'm not sure if I found a bug in the command\n\ngit clone repo.git cloned_repo --depth 1\n\nI follow these steps:\n\ngit init\necho \"First commit\" >> test.txt\ngit add -A\ngit commit -am \"First commit\"\n\necho \"Second commit\" >> test.txt\ngit commit -am \"Second commit\"\n\necho \"Third commit\" >> test.txt\ngit commit -am \"Third commit\"\n\ngit clone --bare . ./bare.git\n\nI then clone the bare repository with --depth 1.\n\ngit clone file:///path/to/bare.git ./clone --depth 1\n\nIt always returns the last two commits. If I specify --depth 2 it \nreturns the last 3 commits.\n\nIf I use --depth 1 on a Github repository it works as expected.\n\nAm I doing something wrong or is it really a bug?\n\nKind Regards,\n\nThomas Kieffer\n\n\nBTW.: Git is amazing and I love it :)\n"},{"id":"242857","messageId":"CACsJy8AmxNDcxtT0XiR8-j=sO0Eo8t5E2apf5SuYU6+EogNm7w@mail.gmail.com","threadId":"36773","inReplyTo":"5385EC5B.8050400@web.de","subject":"Re: Bug in shallow clone?","fromName":"Duy Nguyen","fromEmail":"pclouds@gmail.com","sentAt":"2014-05-28T14:16:43Z","receivedAt":"2014-05-28T14:16:43Z","isPatch":false,"sender":{"key":"pclouds@gmail.com","avatar":"https://avatars.githubusercontent.com/u/720?v=4"},"body":"On Wed, May 28, 2014 at 9:02 PM, Thomas Kieffer <ThomasKieffer@web.de> wrote:\n> I then clone the bare repository with --depth 1.\n>\n> git clone file:///path/to/bare.git ./clone --depth 1\n>\n> It always returns the last two commits. If I specify --depth 2 it returns\n> the last 3 commits.\n>\n> If I use --depth 1 on a Github repository it works as expected.\n>\n> Am I doing something wrong or is it really a bug?\n\nDepth calculation has been corrected lately. It depends on your\nversion, maybe it's older than 1.8.2? If it's the latest, we screwed\nsomething up again..\n-- \nDuy\n"},{"id":"242859","messageId":"1401287364.3329.0.camel@seahawk","threadId":"36773","inReplyTo":"CACsJy8AmxNDcxtT0XiR8-j=sO0Eo8t5E2apf5SuYU6+EogNm7w@mail.gmail.com","subject":"Re: Bug in shallow clone?","fromName":"Dennis Kaarsemaker","fromEmail":"dennis@kaarsemaker.net","sentAt":"2014-05-28T14:29:24Z","receivedAt":"2014-05-28T14:29:24Z","isPatch":false,"sender":{"key":"dennis@kaarsemaker.net","avatar":"https://avatars.githubusercontent.com/u/200649?v=4"},"body":"On wo, 2014-05-28 at 21:16 +0700, Duy Nguyen wrote:\n> On Wed, May 28, 2014 at 9:02 PM, Thomas Kieffer <ThomasKieffer@web.de> wrote:\n> > I then clone the bare repository with --depth 1.\n> >\n> > git clone file:///path/to/bare.git ./clone --depth 1\n> >\n> > It always returns the last two commits. If I specify --depth 2 it returns\n> > the last 3 commits.\n> >\n> > If I use --depth 1 on a Github repository it works as expected.\n> >\n> > Am I doing something wrong or is it really a bug?\n> \n> Depth calculation has been corrected lately. It depends on your\n> version, maybe it's older than 1.8.2? If it's the latest, we screwed\n> something up again..\n\n2.0.0-rc4 does this correctly.\n-- \nDennis Kaarsemaker\nhttp://www.kaarsemaker.net\n"}]}