{"thread":{"id":"11236","subject":"[PATCH] Fix clone not to ignore depth when performing a local clone","startedAt":"2007-12-11T06:47:31Z","lastAt":"2007-12-11T18:26:03Z","messageCount":3,"participants":["Charles Bailey","Johannes Schindelin"],"isPatch":true,"patchVersion":1,"patchTotal":null},"messages":[{"id":"62684","messageId":"20071211064731.GA30525@hashpling.org","threadId":"11236","inReplyTo":null,"subject":"[PATCH] Fix clone not to ignore depth when performing a local clone","fromName":"Charles Bailey","fromEmail":"charles@hashpling.org","sentAt":"2007-12-11T06:47:31Z","receivedAt":"2007-12-11T06:47:31Z","isPatch":true,"sender":{"key":"charles@hashpling.org","avatar":"https://avatars.githubusercontent.com/u/1668475?v=4"},"body":"When git-clone detects that it can perform a local clone it\nfollows a path that silently ignores the depth parameter.\n\nPresumably if the user explicitly requests a shallow clone they\nhave a reason to prefer a space efficient clone of just the recent\nhistory so bypass the local magic if the user specifies the depth\nparameter.\n\nSigned-off-by: Charles Bailey <charles@hashpling.org>\n---\n git-clone.sh |    5 ++++-\n 1 files changed, 4 insertions(+), 1 deletions(-)\n\ndiff --git a/git-clone.sh b/git-clone.sh\nindex ecf9d89..fb124d8 100755\n--- a/git-clone.sh\n+++ b/git-clone.sh\n@@ -205,7 +205,10 @@ fi\n # it is local\n if base=$(get_repo_base \"$repo\"); then\n \trepo=\"$base\"\n-\tlocal=yes\n+\tif test -z \"$depth\"\n+\tthen\n+\t\tlocal=yes\n+\tfi\n fi\n \n dir=\"$2\"\n-- \n1.5.3.7.2242.gcc945-dirty\n"},{"id":"62701","messageId":"Pine.LNX.4.64.0712111154070.27959@racer.site","threadId":"11236","inReplyTo":"20071211064731.GA30525@hashpling.org","subject":"Re: [PATCH] Fix clone not to ignore depth when performing a local clone","fromName":"Johannes Schindelin","fromEmail":"johannes.schindelin@gmx.de","sentAt":"2007-12-11T11:54:54Z","receivedAt":"2007-12-11T11:54:54Z","isPatch":true,"sender":{"key":"johannes.schindelin@gmx.de","avatar":"https://avatars.githubusercontent.com/u/127790?v=4"},"body":"Hi,\n\nOn Tue, 11 Dec 2007, Charles Bailey wrote:\n\n> @@ -205,7 +205,10 @@ fi\n>  # it is local\n>  if base=$(get_repo_base \"$repo\"); then\n>  \trepo=\"$base\"\n> -\tlocal=yes\n> +\tif test -z \"$depth\"\n> +\tthen\n> +\t\tlocal=yes\n> +\tfi\n>  fi\n\nOr shorter:\n\n-\tlocal=yes\n+\ttest -z \"$depth\" && local=yes\n\nCiao,\nDscho\n"},{"id":"62760","messageId":"20071211182603.GA4063@hashpling.org","threadId":"11236","inReplyTo":"Pine.LNX.4.64.0712111154070.27959@racer.site","subject":"Re: [PATCH] Fix clone not to ignore depth when performing a local clone","fromName":"Charles Bailey","fromEmail":"charles@hashpling.org","sentAt":"2007-12-11T18:26:03Z","receivedAt":"2007-12-11T18:26:03Z","isPatch":true,"sender":{"key":"charles@hashpling.org","avatar":"https://avatars.githubusercontent.com/u/1668475?v=4"},"body":"On Tue, Dec 11, 2007 at 11:54:54AM +0000, Johannes Schindelin wrote:\n> Hi,\n> \n> On Tue, 11 Dec 2007, Charles Bailey wrote:\n> \n> > @@ -205,7 +205,10 @@ fi\n> >  # it is local\n> >  if base=$(get_repo_base \"$repo\"); then\n> >  \trepo=\"$base\"\n> > -\tlocal=yes\n> > +\tif test -z \"$depth\"\n> > +\tthen\n> > +\t\tlocal=yes\n> > +\tfi\n> >  fi\n> \n> Or shorter:\n> \n> -\tlocal=yes\n> +\ttest -z \"$depth\" && local=yes\n> \n> Ciao,\n> Dscho\n> \n\nYes, I have no particular preference. I was just following the\n'convention' of the -z \"$origin\" test a few lines above although\nI could see uses of both alternatives as well as instances of [...]\ninstead of test ... .\n\nCharles.\n"}]}