{"thread":{"id":"43474","subject":"Re: [PATCH] FIX git pull failure with shallow clone changes","startedAt":"2006-11-09T04:02:45Z","lastAt":"2006-11-13T12:26:17Z","messageCount":4,"participants":["Johannes Schindelin","Aneesh Kumar K.V"],"isPatch":true,"patchVersion":1,"patchTotal":null},"messages":[{"id":"298002","messageId":"4552A865.5000201@gmail.com","threadId":"43474","inReplyTo":null,"subject":"shallow clone failed git pull","fromName":"Aneesh Kumar K.V","fromEmail":"aneesh.kumar@gmail.com","sentAt":"2006-11-09T04:02:45Z","receivedAt":"2006-11-09T04:02:45Z","isPatch":false,"sender":{"key":"aneesh.kumar@gmail.com","avatar":"https://gravatar.com/avatar/0621fc0b2f14ead1e9024382f16053a808c148596da30c1b92572fa075621f68?d=mp&s=160"},"body":"I was using the pu branch i tried to update the git repository and i got this error.\n\nalk 9e950efa20dc8037c27509666cba6999da9368e8\nwalk 3b6a792f6ace33584897d1af08630c9acc0ce221\n* refs/heads/origin: fast forward to branch 'master' of http://repo.or.cz/r/linux-2.6\n  old..new: 3d42488..088406b\nAuto-following refs/tags/v2.6.19-rc5\nshallow clone with http not supported\n\n\nThis repository was not cloned with -depth. I only updated the git tools using the pu branch\n\n"},{"id":"297482","messageId":"45541503.4020604@gmail.com","threadId":"43474","inReplyTo":"4552A865.5000201@gmail.com","subject":"Re: shallow clone failed git pull","fromName":"Aneesh Kumar K.V","fromEmail":"aneesh.kumar@gmail.com","sentAt":"2006-11-10T05:58:27Z","receivedAt":"2006-11-10T05:58:27Z","isPatch":false,"sender":{"key":"aneesh.kumar@gmail.com","avatar":"https://gravatar.com/avatar/0621fc0b2f14ead1e9024382f16053a808c148596da30c1b92572fa075621f68?d=mp&s=160"},"body":"Aneesh Kumar K.V wrote:\n> I was using the pu branch i tried to update the git repository and i got \n> this error.\n> \n> alk 9e950efa20dc8037c27509666cba6999da9368e8\n> walk 3b6a792f6ace33584897d1af08630c9acc0ce221\n> * refs/heads/origin: fast forward to branch 'master' of \n> http://repo.or.cz/r/linux-2.6\n>  old..new: 3d42488..088406b\n> Auto-following refs/tags/v2.6.19-rc5\n> shallow clone with http not supported\n> \n> \n> This repository was not cloned with -depth. I only updated the git tools \n> using the pu branch\n> \n\nThe attached patch gets it working. I am not sure whether the fix is the right one. I \nam a little bit confused regarding the $depth being incremented. \n\n-aneesh\n\n\ndiff --git a/git-fetch.sh b/git-fetch.sh\nindex 8b46e73..6459994 100755\n--- a/git-fetch.sh\n+++ b/git-fetch.sh\n@@ -21,7 +21,7 @@ update_head_ok=\n exec=\n upload_pack=\n keep=\n-depth=\n+depth=0\n while case \"$#\" in 0) break ;; esac\n do\n \tcase \"$1\" in\n@@ -304,7 +304,7 @@ fetch_main () {\n       # There are transports that can fetch only one head at a time...\n       case \"$remote\" in\n       http://* | https://* | ftp://*)\n-\t  test -n \"$depth\" && die \"shallow clone with http not supported\"\n+\t  [ x\"$depth\" != x0 ] && die \"shallow clone with http not supported\"\n \t  proto=`expr \"$remote\" : '\\([^:]*\\):'`\n \t  if [ -n \"$GIT_SSL_NO_VERIFY\" ]; then\n \t      curl_extra_args=\"-k\"\n@@ -325,7 +325,7 @@ fetch_main () {\n \t      print \"$u\";\n \t  ' \"$head\")\n \t    head=$(curl -nsfL $curl_extra_args $noepsv_opt \"$remote/$remote_name_quoted\")\n-\t    depth=$( expr \\( $depth + 1 \\) )\n+\t   # depth=$( expr \\( $depth + 1 \\) )\n \t  done\n \t  expr \"z$head\" : \"z$_x40\\$\" >/dev/null ||\n \t      die \"Failed to fetch $remote_name from $remote\"\n@@ -333,7 +333,7 @@ fetch_main () {\n \t  git-http-fetch -v -a \"$head\" \"$remote/\" || exit\n \t  ;;\n       rsync://*)\n-\t  test -n \"$depth\" && die \"shallow clone with rsync not supported\"\n+\t  [ x\"$depth\" != x0 ] && die \"shallow clone with http not supported\"\n \t  TMP_HEAD=\"$GIT_DIR/TMP_HEAD\"\n \t  rsync -L -q \"$remote/$remote_name\" \"$TMP_HEAD\" || exit 1\n \t  head=$(git-rev-parse --verify TMP_HEAD)\n"},{"id":"296356","messageId":"45541BBE.4070303@gmail.com","threadId":"43474","inReplyTo":"45541503.4020604@gmail.com","subject":"[PATCH] FIX git pull failure with shallow clone changes","fromName":"Aneesh Kumar K.V","fromEmail":"aneesh.kumar@gmail.com","sentAt":"2006-11-10T06:27:10Z","receivedAt":"2006-11-10T06:27:10Z","isPatch":true,"sender":{"key":"aneesh.kumar@gmail.com","avatar":"https://gravatar.com/avatar/0621fc0b2f14ead1e9024382f16053a808c148596da30c1b92572fa075621f68?d=mp&s=160"},"body":"\n\n\nI was using the pu branch i tried to update the git repository and i\ngot this error.\n\nwalk 9e950efa20dc8037c27509666cba6999da9368e8\nwalk 3b6a792f6ace33584897d1af08630c9acc0ce221\n* refs/heads/origin: fast forward to branch 'master' of\nhttp://repo.or.cz/r/linux-2.6\nold..new: 3d42488..088406b\nAuto-following refs/tags/v2.6.19-rc5\nshallow clone with http not supported\n\nThis repository was not cloned with -depth. I only updated the git\ntools using the pu branch\n\nSigned-off-by: Aneesh Kumar K.V <aneesh.kumar@gmail.com>\n---\n git-fetch.sh |    6 +++---\n 1 files changed, 3 insertions(+), 3 deletions(-)\n\ndiff --git a/git-fetch.sh b/git-fetch.sh\nindex 8b46e73..14ba4b2 100755\n--- a/git-fetch.sh\n+++ b/git-fetch.sh\n@@ -314,9 +314,9 @@ fetch_main () {\n \t      noepsv_opt=\"--disable-epsv\"\n \t  fi\n \t  max_depth=5\n-\t  depth=0\n+\t  cur_depth=0\n \t  head=\"ref: $remote_name\"\n-\t  while (expr \"z$head\" : \"zref:\" && expr $depth \\< $max_depth) >/dev/null\n+\t  while (expr \"z$head\" : \"zref:\" && expr $cur_depth \\< $max_depth) >/dev/null\n \t  do\n \t    remote_name_quoted=$(@@PERL@@ -e '\n \t      my $u = $ARGV[0];\n@@ -325,7 +325,7 @@ fetch_main () {\n \t      print \"$u\";\n \t  ' \"$head\")\n \t    head=$(curl -nsfL $curl_extra_args $noepsv_opt \"$remote/$remote_name_quoted\")\n-\t    depth=$( expr \\( $depth + 1 \\) )\n+\t    cur_depth=$( expr \\( $cur_depth + 1 \\) )\n \t  done\n \t  expr \"z$head\" : \"z$_x40\\$\" >/dev/null ||\n \t      die \"Failed to fetch $remote_name from $remote\"\n-- \n1.4.4.rc1.g368c-dirty\n\n"},{"id":"294994","messageId":"Pine.LNX.4.63.0611131325110.13772@wbgn013.biozentrum.uni-wuerzburg.de","threadId":"43474","inReplyTo":"45541BBE.4070303@gmail.com","subject":"Re: [PATCH] FIX git pull failure with shallow clone changes","fromName":"Johannes Schindelin","fromEmail":"johannes.schindelin@gmx.de","sentAt":"2006-11-13T12:26:17Z","receivedAt":"2006-11-13T12:26:17Z","isPatch":true,"sender":{"key":"johannes.schindelin@gmx.de","avatar":"https://avatars.githubusercontent.com/u/127790?v=4"},"body":"Hi,\n\nI overlooked that the http transport uses the variable \"depth\" already, \nwhich your patch fixes.\n\nAcked-by: Johannes Schindelin <johannes.schindelin@gmx.de>\n\nCiao,\nDscho\n"}]}