git/list[1] front-page[2] threads[3] people[4] search[5] about
 

Re: [PATCH] Make "git request-pull" use the configured remote.REMOTE.uploadpack

From
Tom Grennan <tgrennan@redback.com>
Date
Jul 29, 2009, 01:30 UTC
Message-ID
<20090729013002.GM4850@redback.com>
In-Reply-To
<adf1fd3d0907281713t378440eamb39baae3be6d41c4@mail.gmail.com>
On Tue, Jul 28, 2009 at 05:13:30PM -0700, Santi Béjar wrote:
Show 13 quoted lines
>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
Previous: Santi BéjarNext: Junio C Hamano
Message 3 of 4 in “Make "git request-pull" use the configured remote.REMOTE.uploadpack”
  1. Make "git request-pull" use the configured remote.REMOTE.uploadpackTom Grennan, Jul 27, 2009
  2. Santi BéjarJul 29, 2009
  3. Tom GrennanJul 29, 2009
  4. Junio C HamanoJul 29, 2009

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.