{"thread":{"id":"20251","subject":"[PATCH] Make \"git request-pull\" use the configured remote.REMOTE.uploadpack","startedAt":"2009-07-27T21:02:43Z","lastAt":"2009-07-29T05:05:47Z","messageCount":4,"participants":["Tom Grennan","Santi Béjar","Junio C Hamano"],"isPatch":true,"patchVersion":1,"patchTotal":null},"messages":[{"id":"118905","messageId":"1248728563-23906-1-git-send-email-tgrennan@redback.com","threadId":"20251","inReplyTo":null,"subject":"[PATCH] Make \"git request-pull\" use the configured remote.REMOTE.uploadpack","fromName":"Tom Grennan","fromEmail":"tgrennan@redback.com","sentAt":"2009-07-27T21:02:43Z","receivedAt":"2009-07-27T21:02:43Z","isPatch":true,"sender":{"key":"tmgrennan@gmail.com","avatar":"https://avatars.githubusercontent.com/u/422771?v=4"},"body":"git-request-pull.sh should use git-parse-remote:get_uploadpack() to\nload a configured remote.REMOTE.uploadpack like \"git remote show\" and\n\"git fetch\". This allows one to specify the path of git-upload-pack on\nthe remote side.\n\nSigned-off-by: Tom Grennan <tgrennan@redback.com>\n---\n git-request-pull.sh |    3 ++-\n 1 files changed, 2 insertions(+), 1 deletions(-)\n\ndiff --git a/git-request-pull.sh b/git-request-pull.sh\nindex a2cf5b8..612e94d 100755\n--- a/git-request-pull.sh\n+++ b/git-request-pull.sh\n@@ -25,8 +25,9 @@ headrev=`git rev-parse --verify \"$head\"^0` || exit\n merge_base=`git merge-base $baserev $headrev` ||\n die \"fatal: No commits in common between $base and $head\"\n \n+upload_pack=$(get_uploadpack \"$url\")\n url=$(get_remote_url \"$url\")\n-branch=$(git ls-remote \"$url\" \\\n+branch=$(git ls-remote --upload-pack=\"$upload_pack\" \"$url\" \\\n \t| sed -n -e \"/^$headrev\trefs.heads./{\n \t\ts/^.*\trefs.heads.//\n \t\tp\n-- \n1.6.2.1.dirty\n"},{"id":"119000","messageId":"adf1fd3d0907281713t378440eamb39baae3be6d41c4@mail.gmail.com","threadId":"20251","inReplyTo":"1248728563-23906-1-git-send-email-tgrennan@redback.com","subject":"Re: [PATCH] Make \"git request-pull\" use the configured remote.REMOTE.uploadpack","fromName":"Santi Béjar","fromEmail":"santi@agolina.net","sentAt":"2009-07-29T00:13:30Z","receivedAt":"2009-07-29T00:13:30Z","isPatch":true,"sender":{"key":"santi@agolina.net","avatar":null},"body":"2009/7/27 Tom Grennan <tgrennan@redback.com>:\n> git-request-pull.sh should use git-parse-remote:get_uploadpack() to\n> load a configured remote.REMOTE.uploadpack like \"git remote show\" and\n> \"git fetch\". This allows one to specify the path of git-upload-pack on\n> the remote side.\n\nSorry, but I removed all unused functions from git-parse-remote in 62d955f\n(parse-remote: remove unused functions, 2009-06-12), and it is in\nv1.6.4-rc1. I don't think there is much problem reverting part of that commit,\nbut I wonder if the problem is that \"git ls-remote\" does not read the\nremote.<remote>.uploadpack by itself as it reads the remote.<remote>.url.\n\nSanti\n"},{"id":"119002","messageId":"20090729013002.GM4850@redback.com","threadId":"20251","inReplyTo":"adf1fd3d0907281713t378440eamb39baae3be6d41c4@mail.gmail.com","subject":"Re: [PATCH] Make \"git request-pull\" use the configured remote.REMOTE.uploadpack","fromName":"Tom Grennan","fromEmail":"tgrennan@redback.com","sentAt":"2009-07-29T01:30:02Z","receivedAt":"2009-07-29T01:30:02Z","isPatch":true,"sender":{"key":"tmgrennan@gmail.com","avatar":"https://avatars.githubusercontent.com/u/422771?v=4"},"body":"On Tue, Jul 28, 2009 at 05:13:30PM -0700, Santi Béjar wrote:\n>2009/7/27 Tom Grennan <tgrennan@redback.com>:\n>> git-request-pull.sh should use git-parse-remote:get_uploadpack() to\n>> load a configured remote.REMOTE.uploadpack like \"git remote show\" and\n>> \"git fetch\". This allows one to specify the path of git-upload-pack on\n>> the remote side.\n>\n>Sorry, but I removed all unused functions from git-parse-remote in 62d955f\n>(parse-remote: remove unused functions, 2009-06-12), and it is in\n>v1.6.4-rc1. I don't think there is much problem reverting part of that commit,\n>but I wonder if the problem is that \"git ls-remote\" does not read the\n>remote.<remote>.uploadpack by itself as it reads the remote.<remote>.url.\n>\n>Santi\n\nThanks for the hint.\n\nYes, \"git ls-remote\" is retrieving remote.<remote>.uploadpack when\ndest is a configured remote.  However, git-request-pull runs ls-remote\nafter converting its URL argument from remote.<remote>.url\n\nThe following works with v1.6.4-rc3-12-gdf73af5\n\nIf you wish, I'll submit an alternative patch.\n\n-- \nTomG\n\ndiff --git a/git-request-pull.sh b/git-request-pull.sh\nindex 5917773..fd95bea 100755\n--- a/git-request-pull.sh\n+++ b/git-request-pull.sh\n@@ -28,13 +28,13 @@ headrev=`git rev-parse --verify \"$head\"^0` || exit\n merge_base=`git merge-base $baserev $headrev` ||\n die \"fatal: No commits in common between $base and $head\"\n \n-url=$(get_remote_url \"$url\")\n branch=$(git ls-remote \"$url\" \\\n \t| sed -n -e \"/^$headrev\trefs.heads./{\n \t\ts/^.*\trefs.heads.//\n \t\tp\n \t\tq\n \t}\")\n+url=$(get_remote_url \"$url\")\n if [ -z \"$branch\" ]; then\n \techo \"warn: No branch of $url is at:\" >&2\n \tgit log --max-count=1 --pretty='tformat:warn:   %h: %s' $headrev >&2\n"},{"id":"119014","messageId":"7vws5syt78.fsf@alter.siamese.dyndns.org","threadId":"20251","inReplyTo":"20090729013002.GM4850@redback.com","subject":"Re: [PATCH] Make \"git request-pull\" use the configured remote.REMOTE.uploadpack","fromName":"Junio C Hamano","fromEmail":"gitster@pobox.com","sentAt":"2009-07-29T05:05:47Z","receivedAt":"2009-07-29T05:05:47Z","isPatch":true,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"Tom Grennan <tgrennan@redback.com> writes:\n\n> On Tue, Jul 28, 2009 at 05:13:30PM -0700, Santi Béjar wrote:\n>>2009/7/27 Tom Grennan <tgrennan@redback.com>:\n>>> git-request-pull.sh should use git-parse-remote:get_uploadpack() to\n>>> load a configured remote.REMOTE.uploadpack like \"git remote show\" and\n>>> \"git fetch\". This allows one to specify the path of git-upload-pack on\n>>> the remote side.\n>>\n>>Sorry, but I removed all unused functions from git-parse-remote in 62d955f\n>>(parse-remote: remove unused functions, 2009-06-12), and it is in\n>>v1.6.4-rc1. I don't think there is much problem reverting part of that commit,\n>>but I wonder if the problem is that \"git ls-remote\" does not read the\n>>remote.<remote>.uploadpack by itself as it reads the remote.<remote>.url.\n>>\n>>Santi\n>\n> Thanks for the hint.\n>\n> Yes, \"git ls-remote\" is retrieving remote.<remote>.uploadpack when\n> dest is a configured remote.  However, git-request-pull runs ls-remote\n> after converting its URL argument from remote.<remote>.url\n\nThanks, both.\n\n-- >8 --\nFrom: Tom Grennan <tgrennan@redback.com>\nDate: Tue, 28 Jul 2009 18:30:02 -0700\nSubject: request-pull: allow ls-remote to notice remote.$nickname.uploadpack\n\nThe location to pull from should be converted from the configured nickname\nto URL in the message, but ls-remote should be fed the nickname so that\nthe command uses remote.$nickname.* variables, most notably \"uploadpack\".\n\nSigned-off-by: Tom Grennan <tgrennan@redback.com>\n---\n\ndiff --git a/git-request-pull.sh b/git-request-pull.sh\nindex 5917773..fd95bea 100755\n--- a/git-request-pull.sh\n+++ b/git-request-pull.sh\n@@ -28,13 +28,13 @@ headrev=`git rev-parse --verify \"$head\"^0` || exit\n merge_base=`git merge-base $baserev $headrev` ||\n die \"fatal: No commits in common between $base and $head\"\n \n-url=$(get_remote_url \"$url\")\n branch=$(git ls-remote \"$url\" \\\n \t| sed -n -e \"/^$headrev\trefs.heads./{\n \t\ts/^.*\trefs.heads.//\n \t\tp\n \t\tq\n \t}\")\n+url=$(get_remote_url \"$url\")\n if [ -z \"$branch\" ]; then\n \techo \"warn: No branch of $url is at:\" >&2\n \tgit log --max-count=1 --pretty='tformat:warn:   %h: %s' $headrev >&2\n"}]}