git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] Make "git request-pull" use the configured remote.REMOTE.uploadpack
@ 2009-07-27 21:02 Tom Grennan
  2009-07-29  0:13 ` Santi Béjar
  0 siblings, 1 reply; 4+ messages in thread
From: Tom Grennan @ 2009-07-27 21:02 UTC (permalink / raw)
  To: git, gitster

git-request-pull.sh should use git-parse-remote:get_uploadpack() to
load a configured remote.REMOTE.uploadpack like "git remote show" and
"git fetch". This allows one to specify the path of git-upload-pack on
the remote side.

Signed-off-by: Tom Grennan <tgrennan@redback.com>
---
 git-request-pull.sh |    3 ++-
 1 files changed, 2 insertions(+), 1 deletions(-)

diff --git a/git-request-pull.sh b/git-request-pull.sh
index a2cf5b8..612e94d 100755
--- a/git-request-pull.sh
+++ b/git-request-pull.sh
@@ -25,8 +25,9 @@ headrev=`git rev-parse --verify "$head"^0` || exit
 merge_base=`git merge-base $baserev $headrev` ||
 die "fatal: No commits in common between $base and $head"
 
+upload_pack=$(get_uploadpack "$url")
 url=$(get_remote_url "$url")
-branch=$(git ls-remote "$url" \
+branch=$(git ls-remote --upload-pack="$upload_pack" "$url" \
 	| sed -n -e "/^$headrev	refs.heads./{
 		s/^.*	refs.heads.//
 		p
-- 
1.6.2.1.dirty

^ permalink raw reply related	[flat|nested] 4+ messages in thread

* Re: [PATCH] Make "git request-pull" use the configured  remote.REMOTE.uploadpack
  2009-07-27 21:02 [PATCH] Make "git request-pull" use the configured remote.REMOTE.uploadpack Tom Grennan
@ 2009-07-29  0:13 ` Santi Béjar
  2009-07-29  1:30   ` Tom Grennan
  0 siblings, 1 reply; 4+ messages in thread
From: Santi Béjar @ 2009-07-29  0:13 UTC (permalink / raw)
  To: Tom Grennan; +Cc: git, gitster

2009/7/27 Tom Grennan <tgrennan@redback.com>:
> git-request-pull.sh should use git-parse-remote:get_uploadpack() to
> load a configured remote.REMOTE.uploadpack like "git remote show" and
> "git fetch". This allows one to specify the path of git-upload-pack on
> the remote side.

Sorry, but I removed all unused functions from git-parse-remote in 62d955f
(parse-remote: remove unused functions, 2009-06-12), and it is in
v1.6.4-rc1. I don't think there is much problem reverting part of that commit,
but I wonder if the problem is that "git ls-remote" does not read the
remote.<remote>.uploadpack by itself as it reads the remote.<remote>.url.

Santi

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [PATCH] Make "git request-pull" use the configured remote.REMOTE.uploadpack
  2009-07-29  0:13 ` Santi Béjar
@ 2009-07-29  1:30   ` Tom Grennan
  2009-07-29  5:05     ` Junio C Hamano
  0 siblings, 1 reply; 4+ messages in thread
From: Tom Grennan @ 2009-07-29  1:30 UTC (permalink / raw)
  To: Santi Béjar; +Cc: git@vger.kernel.org, gitster@pobox.com

On Tue, Jul 28, 2009 at 05:13:30PM -0700, Santi Béjar wrote:
>2009/7/27 Tom Grennan <tgrennan@redback.com>:
>> git-request-pull.sh should use git-parse-remote:get_uploadpack() to
>> load a configured remote.REMOTE.uploadpack like "git remote show" and
>> "git fetch". This allows one to specify the path of git-upload-pack on
>> the remote side.
>
>Sorry, but I removed all unused functions from git-parse-remote in 62d955f
>(parse-remote: remove unused functions, 2009-06-12), and it is in
>v1.6.4-rc1. I don't think there is much problem reverting part of that commit,
>but I wonder if the problem is that "git ls-remote" does not read the
>remote.<remote>.uploadpack by itself as it reads the remote.<remote>.url.
>
>Santi

Thanks for the hint.

Yes, "git ls-remote" is retrieving remote.<remote>.uploadpack when
dest is a configured remote.  However, git-request-pull runs ls-remote
after converting its URL argument from remote.<remote>.url

The following works with v1.6.4-rc3-12-gdf73af5

If you wish, I'll submit an alternative patch.

-- 
TomG

diff --git a/git-request-pull.sh b/git-request-pull.sh
index 5917773..fd95bea 100755
--- a/git-request-pull.sh
+++ b/git-request-pull.sh
@@ -28,13 +28,13 @@ headrev=`git rev-parse --verify "$head"^0` || exit
 merge_base=`git merge-base $baserev $headrev` ||
 die "fatal: No commits in common between $base and $head"
 
-url=$(get_remote_url "$url")
 branch=$(git ls-remote "$url" \
 	| sed -n -e "/^$headrev	refs.heads./{
 		s/^.*	refs.heads.//
 		p
 		q
 	}")
+url=$(get_remote_url "$url")
 if [ -z "$branch" ]; then
 	echo "warn: No branch of $url is at:" >&2
 	git log --max-count=1 --pretty='tformat:warn:   %h: %s' $headrev >&2

^ permalink raw reply related	[flat|nested] 4+ messages in thread

* Re: [PATCH] Make "git request-pull" use the configured remote.REMOTE.uploadpack
  2009-07-29  1:30   ` Tom Grennan
@ 2009-07-29  5:05     ` Junio C Hamano
  0 siblings, 0 replies; 4+ messages in thread
From: Junio C Hamano @ 2009-07-29  5:05 UTC (permalink / raw)
  To: Tom Grennan; +Cc: Santi Béjar, git@vger.kernel.org

Tom Grennan <tgrennan@redback.com> writes:

> On Tue, Jul 28, 2009 at 05:13:30PM -0700, Santi Béjar wrote:
>>2009/7/27 Tom Grennan <tgrennan@redback.com>:
>>> git-request-pull.sh should use git-parse-remote:get_uploadpack() to
>>> load a configured remote.REMOTE.uploadpack like "git remote show" and
>>> "git fetch". This allows one to specify the path of git-upload-pack on
>>> the remote side.
>>
>>Sorry, but I removed all unused functions from git-parse-remote in 62d955f
>>(parse-remote: remove unused functions, 2009-06-12), and it is in
>>v1.6.4-rc1. I don't think there is much problem reverting part of that commit,
>>but I wonder if the problem is that "git ls-remote" does not read the
>>remote.<remote>.uploadpack by itself as it reads the remote.<remote>.url.
>>
>>Santi
>
> Thanks for the hint.
>
> Yes, "git ls-remote" is retrieving remote.<remote>.uploadpack when
> dest is a configured remote.  However, git-request-pull runs ls-remote
> after converting its URL argument from remote.<remote>.url

Thanks, both.

-- >8 --
From: Tom Grennan <tgrennan@redback.com>
Date: Tue, 28 Jul 2009 18:30:02 -0700
Subject: request-pull: allow ls-remote to notice remote.$nickname.uploadpack

The location to pull from should be converted from the configured nickname
to URL in the message, but ls-remote should be fed the nickname so that
the command uses remote.$nickname.* variables, most notably "uploadpack".

Signed-off-by: Tom Grennan <tgrennan@redback.com>
---

diff --git a/git-request-pull.sh b/git-request-pull.sh
index 5917773..fd95bea 100755
--- a/git-request-pull.sh
+++ b/git-request-pull.sh
@@ -28,13 +28,13 @@ headrev=`git rev-parse --verify "$head"^0` || exit
 merge_base=`git merge-base $baserev $headrev` ||
 die "fatal: No commits in common between $base and $head"
 
-url=$(get_remote_url "$url")
 branch=$(git ls-remote "$url" \
 	| sed -n -e "/^$headrev	refs.heads./{
 		s/^.*	refs.heads.//
 		p
 		q
 	}")
+url=$(get_remote_url "$url")
 if [ -z "$branch" ]; then
 	echo "warn: No branch of $url is at:" >&2
 	git log --max-count=1 --pretty='tformat:warn:   %h: %s' $headrev >&2

^ permalink raw reply related	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2009-07-29  5:06 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2009-07-27 21:02 [PATCH] Make "git request-pull" use the configured remote.REMOTE.uploadpack Tom Grennan
2009-07-29  0:13 ` Santi Béjar
2009-07-29  1:30   ` Tom Grennan
2009-07-29  5:05     ` Junio C Hamano

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).