{"thread":{"id":"34691","subject":"About *git clone --depth=n* puzzle","startedAt":"2013-08-14T08:20:33Z","lastAt":"2013-08-15T02:08:38Z","messageCount":6,"participants":["XinLingchao","Stefan Beller","Jeff King","Duy Nguyen"],"isPatch":false,"patchVersion":null,"patchTotal":null},"messages":[{"id":"225188","messageId":"BAY169-W472B90AB796C71E8D0D038B4450@phx.gbl","threadId":"34691","inReplyTo":null,"subject":"About *git clone --depth=n* puzzle","fromName":"XinLingchao","fromEmail":"douglarek@outlook.com","sentAt":"2013-08-14T08:20:33Z","receivedAt":"2013-08-14T08:20:33Z","isPatch":false,"sender":{"key":"douglarek@outlook.com","avatar":"https://gravatar.com/avatar/c57152a8ebd39968b4bd0858134d3e0024d4069b85467b41c3844736e6c039ba?d=mp&s=160"},"body":"Hi Guys,\n\nI think I have got some trouble when I use `git clone --depth=n` command. Take a real repo for example:\n\n\n`git clone https://github.com/douglarek/vimrc.git --depth=1`\n\n\nthen I use `git log`:\n  \n```  \n    commit d04ca09ecc723739123fae11ad56784eb0c9b36a\n    Author: Lingchao Xin <douglarek@outlook.com>\n    Date:   Fri Jun 7 09:39:22 2013 +0800\n\n        Update vnudle to master branch, add wm shortcut, pylint optimization\n\n    commit c66d827dc212f6ae8aab6b5c44631564bcbe2acd\n    Author: icocoa <lingchax@outlook.com>\n    Date:   Tue Mar 12 01:36:34 2013 -0700\n\n        Merge pull request #1 from douglarek/master\n\n        Add markdown, flake8, pylint plugin\n\n```\n    but when I clone it with `file://`:\n\n    git clone https://github.com/douglarek/vimrc.git\n    git clone file://vimrc.git --depth=1 vimrc1\n\n    I got this log:\n```\n    commit d04ca09ecc723739123fae11ad56784eb0c9b36a\nAuthor: Lingchao Xin <douglarek@outlook.com>\nDate:   Fri Jun 7 09:39:22 2013 +0800\n\n    Update vnudle to master branch, add wm shortcut, pylint optimization\n```\n\nso the two results are not same, is it a bug? or it should be so?\n\nMy os is openSUSE 12.3 and git version 1.8.3.4; and myabe it occured in git 1.8.1.4 +.\n\n\nThanks and Best regards\n\nLingchao Xin \t\t \t   \t\t  "},{"id":"225190","messageId":"520B4529.9080304@googlemail.com","threadId":"34691","inReplyTo":"BAY169-W472B90AB796C71E8D0D038B4450@phx.gbl","subject":"Re: About *git clone --depth=n* puzzle","fromName":"Stefan Beller","fromEmail":"stefanbeller@googlemail.com","sentAt":"2013-08-14T08:51:53Z","receivedAt":"2013-08-14T08:51:53Z","isPatch":false,"sender":{"key":"stefanbeller@gmail.com","avatar":"https://avatars.githubusercontent.com/u/455868?v=4"},"body":"On 08/14/2013 10:20 AM, XinLingchao wrote:\n> Hi Guys,\n> \n> I think I have got some trouble when I use `git clone --depth=n` command. Take a real repo for example:\n> \n> \n> `git clone https://github.com/douglarek/vimrc.git --depth=1`\n> \n> \n> then I use `git log`:\n>   \n> ```  \n>     commit d04ca09ecc723739123fae11ad56784eb0c9b36a\n>     Author: Lingchao Xin <douglarek@outlook.com>\n>     Date:   Fri Jun 7 09:39:22 2013 +0800\n> \n>         Update vnudle to master branch, add wm shortcut, pylint optimization\n> \n>     commit c66d827dc212f6ae8aab6b5c44631564bcbe2acd\n>     Author: icocoa <lingchax@outlook.com>\n>     Date:   Tue Mar 12 01:36:34 2013 -0700\n> \n>         Merge pull request #1 from douglarek/master\n> \n>         Add markdown, flake8, pylint plugin\n> \n> ```\n>     but when I clone it with `file://`:\n> \n>     git clone https://github.com/douglarek/vimrc.git\n>     git clone file://vimrc.git --depth=1 vimrc1\n> \n>     I got this log:\n> ```\n>     commit d04ca09ecc723739123fae11ad56784eb0c9b36a\n> Author: Lingchao Xin <douglarek@outlook.com>\n> Date:   Fri Jun 7 09:39:22 2013 +0800\n> \n>     Update vnudle to master branch, add wm shortcut, pylint optimization\n> ```\n> \n> so the two results are not same, is it a bug? or it should be so?\n> \n> My os is openSUSE 12.3 and git version 1.8.3.4; and myabe it occured in git 1.8.1.4 +.\n> \n> \n> Thanks and Best regards\n> \n> Lingchao Xin \t\t \t   \t\t  --\n\nThere was a similar discussion going on in July this year,\nmaybe this is an interesting read with respect to this topic\nhttp://www.spinics.net/lists/git/msg196138.html\n\nStefan\n\n\n"},{"id":"225193","messageId":"BAY169-W647D5A2BFDC793ADFA5078B4450@phx.gbl","threadId":"34691","inReplyTo":"520B4529.9080304@googlemail.com","subject":"RE: About *git clone --depth=n* puzzle","fromName":"XinLingchao","fromEmail":"douglarek@outlook.com","sentAt":"2013-08-14T09:19:36Z","receivedAt":"2013-08-14T09:19:36Z","isPatch":false,"sender":{"key":"douglarek@outlook.com","avatar":"https://gravatar.com/avatar/c57152a8ebd39968b4bd0858134d3e0024d4069b85467b41c3844736e6c039ba?d=mp&s=160"},"body":"---------------------------------------\n> Date: Wed, 14 Aug 2013 10:51:53 +0200\n> From: stefanbeller@googlemail.com\n> To: douglarek@outlook.com\n> CC: git@vger.kernel.org; junchunx.guan@gmail.com\n> Subject: Re: About *git clone --depth=n* puzzle\n>\n> On 08/14/2013 10:20 AM, XinLingchao wrote:\n>> Hi Guys,\n>>\n>> I think I have got some trouble when I use `git clone --depth=n` command. Take a real repo for example:\n>>\n>>\n>> `git clone https://github.com/douglarek/vimrc.git --depth=1`\n>>\n>>\n>> then I use `git log`:\n>>\n>> ```\n>> commit d04ca09ecc723739123fae11ad56784eb0c9b36a\n>> Author: Lingchao Xin <douglarek@outlook.com>\n>> Date: Fri Jun 7 09:39:22 2013 +0800\n>>\n>> Update vnudle to master branch, add wm shortcut, pylint optimization\n>>\n>> commit c66d827dc212f6ae8aab6b5c44631564bcbe2acd\n>> Author: icocoa <lingchax@outlook.com>\n>> Date: Tue Mar 12 01:36:34 2013 -0700\n>>\n>> Merge pull request #1 from douglarek/master\n>>\n>> Add markdown, flake8, pylint plugin\n>>\n>> ```\n>> but when I clone it with `file://`:\n>>\n>> git clone https://github.com/douglarek/vimrc.git\n>> git clone file://vimrc.git --depth=1 vimrc1\n>>\n>> I got this log:\n>> ```\n>> commit d04ca09ecc723739123fae11ad56784eb0c9b36a\n>> Author: Lingchao Xin <douglarek@outlook.com>\n>> Date: Fri Jun 7 09:39:22 2013 +0800\n>>\n>> Update vnudle to master branch, add wm shortcut, pylint optimization\n>> ```\n>>\n>> so the two results are not same, is it a bug? or it should be so?\n>>\n>> My os is openSUSE 12.3 and git version 1.8.3.4; and myabe it occured in git 1.8.1.4 +.\n>>\n>>\n>> Thanks and Best regards\n>>\n>> Lingchao Xin --\n>\n> There was a similar discussion going on in July this year,\n> maybe this is an interesting read with respect to this topic\n> http://www.spinics.net/lists/git/msg196138.html\n>\n> Stefan\n>\n>\n\nStefan, I do NOT think so, the key point is not about the depth limit, it is about whether remote clone depth equals local clone depth.\n\ncheers\n\nLingchao Xin \t\t \t   \t\t  "},{"id":"225198","messageId":"20130814115956.GA29295@sigill.intra.peff.net","threadId":"34691","inReplyTo":"BAY169-W647D5A2BFDC793ADFA5078B4450@phx.gbl","subject":"Re: About *git clone --depth=n* puzzle","fromName":"Jeff King","fromEmail":"peff@peff.net","sentAt":"2013-08-14T11:59:56Z","receivedAt":"2013-08-14T11:59:56Z","isPatch":false,"sender":{"key":"peff@peff.net","avatar":"https://avatars.githubusercontent.com/u/45925?v=4"},"body":"On Wed, Aug 14, 2013 at 05:19:36PM +0800, XinLingchao wrote:\n\n> > There was a similar discussion going on in July this year,\n> > maybe this is an interesting read with respect to this topic\n> > http://www.spinics.net/lists/git/msg196138.html\n> >\n> Stefan, I do NOT think so, the key point is not about the depth limit,\n> it is about whether remote clone depth equals local clone depth.\n\nI do not think it is about local vs remote, but rather about which\nversion of git the remote side is running. Prior to 682c7d2\n(upload-pack: fix off-by-one depth calculation in shallow clone,\n2013-01-11), a shallow clone always returned one extra commit. That fix\nwent into v1.8.2.\n\nSo if you have a post-v1.8.2 git client, a local clone will use the same\ngit version as the \"remote\" side of the connection. But if you are\ncontacting a remote server, the results you get will depend on what\nversion of git is running on the remote server.\n\nAnd as the example you showed uses github.com as the remote, and as I\nhappen to know that GitHub's servers do not currently have 682c7d2, you\nwould see the old behavior.\n\n-Peff\n"},{"id":"225199","messageId":"BAY169-W3481BBD06C4449E7C5D6F5B4450@phx.gbl","threadId":"34691","inReplyTo":"20130814115956.GA29295@sigill.intra.peff.net","subject":"RE: About *git clone --depth=n* puzzle","fromName":"XinLingchao","fromEmail":"douglarek@outlook.com","sentAt":"2013-08-14T12:45:46Z","receivedAt":"2013-08-14T12:45:46Z","isPatch":false,"sender":{"key":"douglarek@outlook.com","avatar":"https://gravatar.com/avatar/c57152a8ebd39968b4bd0858134d3e0024d4069b85467b41c3844736e6c039ba?d=mp&s=160"},"body":"Peff, thanks for your detial explain,  and I think I have got the point :P\n\n-Lingchao Xin\n\n----------------------------------------\n> Date: Wed, 14 Aug 2013 07:59:56 -0400\n> From: peff@peff.net\n> To: douglarek@outlook.com\n> CC: stefanbeller@googlemail.com; git@vger.kernel.org; junchunx.guan@gmail.com\n> Subject: Re: About *git clone --depth=n* puzzle\n>\n> On Wed, Aug 14, 2013 at 05:19:36PM +0800, XinLingchao wrote:\n>\n>>> There was a similar discussion going on in July this year,\n>>> maybe this is an interesting read with respect to this topic\n>>> http://www.spinics.net/lists/git/msg196138.html\n>>>\n>> Stefan, I do NOT think so, the key point is not about the depth limit,\n>> it is about whether remote clone depth equals local clone depth.\n>\n> I do not think it is about local vs remote, but rather about which\n> version of git the remote side is running. Prior to 682c7d2\n> (upload-pack: fix off-by-one depth calculation in shallow clone,\n> 2013-01-11), a shallow clone always returned one extra commit. That fix\n> went into v1.8.2.\n>\n> So if you have a post-v1.8.2 git client, a local clone will use the same\n> git version as the \"remote\" side of the connection. But if you are\n> contacting a remote server, the results you get will depend on what\n> version of git is running on the remote server.\n>\n> And as the example you showed uses github.com as the remote, and as I\n> happen to know that GitHub's servers do not currently have 682c7d2, you\n> would see the old behavior.\n>\n> -Peff \t\t \t   \t\t  "},{"id":"225241","messageId":"CACsJy8DDf64M1qruUNH7M=eB=1cJpYuYXLEkpPUPfrREeSLEew@mail.gmail.com","threadId":"34691","inReplyTo":"BAY169-W472B90AB796C71E8D0D038B4450@phx.gbl","subject":"Re: About *git clone --depth=n* puzzle","fromName":"Duy Nguyen","fromEmail":"pclouds@gmail.com","sentAt":"2013-08-15T02:08:38Z","receivedAt":"2013-08-15T02:08:38Z","isPatch":false,"sender":{"key":"pclouds@gmail.com","avatar":"https://avatars.githubusercontent.com/u/720?v=4"},"body":"On Wed, Aug 14, 2013 at 3:20 PM, XinLingchao <douglarek@outlook.com> wrote:\n> Hi Guys,\n>\n> I think I have got some trouble when I use `git clone --depth=n` command. Take a real repo for example:\n>\n>\n> `git clone https://github.com/douglarek/vimrc.git --depth=1`\n>\n>\n> then I use `git log`:\n>\n> ```\n>     commit d04ca09ecc723739123fae11ad56784eb0c9b36a\n>     Author: Lingchao Xin <douglarek@outlook.com>\n>     Date:   Fri Jun 7 09:39:22 2013 +0800\n>\n>         Update vnudle to master branch, add wm shortcut, pylint optimization\n>\n>     commit c66d827dc212f6ae8aab6b5c44631564bcbe2acd\n>     Author: icocoa <lingchax@outlook.com>\n>     Date:   Tue Mar 12 01:36:34 2013 -0700\n>\n>         Merge pull request #1 from douglarek/master\n>\n>         Add markdown, flake8, pylint plugin\n>\n> ```\n>     but when I clone it with `file://`:\n>\n>     git clone https://github.com/douglarek/vimrc.git\n>     git clone file://vimrc.git --depth=1 vimrc1\n>\n>     I got this log:\n> ```\n>     commit d04ca09ecc723739123fae11ad56784eb0c9b36a\n> Author: Lingchao Xin <douglarek@outlook.com>\n> Date:   Fri Jun 7 09:39:22 2013 +0800\n>\n>     Update vnudle to master branch, add wm shortcut, pylint optimization\n> ```\n>\n> so the two results are not same, is it a bug? or it should be so?\n>\n> My os is openSUSE 12.3 and git version 1.8.3.4; and myabe it occured in git 1.8.1.4 +.\n\nThe fix is at the server side. >=1.8.2 corrects --depth, which is what\nyou use for file://. github is still on 1.8.1.6, which does not have\nthat fix. Oh and the commit is 682c7d2 (upload-pack: fix off-by-one\ndepth calculation in shallow clone - 2013-01-11)\n-- \nDuy\n"}]}