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

Re: [PATCH] Use --upload-pack in clone, fetch and ls-remote instead of --exec

From
Junio C Hamano <junkio@cox.net>
Date
Jan 23, 2007, 09:25 UTC
Message-ID
<7vlkjunlgk.fsf@assigned-by-dhcp.cox.net>
In-Reply-To
<7vveiynnju.fsf@assigned-by-dhcp.cox.net>
Junio C Hamano <junkio@cox.net> writes:
Show 10 quoted lines
> Uwe Kleine-König  <ukleinek@informatik.uni-freiburg.de> writes:
>
>> Signed-off-by: Uwe Kleine-König <ukleinek@informatik.uni-freiburg.de>
>> ---
>> I don't like the change to git-fetch.sh.  But currently git-fetch-pack
>> needs a = and ls-remote doesn't like it.  So it continues to have two
>> variables for the remote upload program.
>
> Then maybe something like this is in order to make things more
> consistent?
Merging these two together,...

-- >8 -- [PATCH] ls-remote and clone: accept --upload-pack=<path> as well.

This makes them consistent with other commands that take the path to the upload-pack program. We also pass --upload-pack instead of --exec to the underlying fetch-pack, although it is not strictly necessary.

[jc: original motivation from Uwe]
Signed-off-by: Junio C Hamano <junkio@cox.net>
---
 git-clone.sh     |    4 +++-
 git-fetch.sh     |   11 +++++++----
 git-ls-remote.sh |    6 +++++-
 3 files changed, 15 insertions(+), 6 deletions(-)
diff --git a/git-clone.sh b/git-clone.sh
index 0f7bbbf..ced7dfb 100755
--- a/git-clone.sh
+++ b/git-clone.sh
@@ -163,7 +163,9 @@ while
 	1,-u|1,--upload-pack) usage ;;
 	*,-u|*,--upload-pack)
 		shift
-		upload_pack="--exec=$1" ;;
+		upload_pack="--upload-pack=$1" ;;
+	*,--upload-pack=*)
+		upload_pack=--upload-pack=$(expr "$1" : '-[^=]*=\(.*\)') ;;
 	1,--depth) usage;;
 	*,--depth)
 		shift
diff --git a/git-fetch.sh b/git-fetch.sh
index 87b940b..07a1d05 100755
--- a/git-fetch.sh
+++ b/git-fetch.sh
@@ -22,7 +22,6 @@ force=
 verbose=
 update_head_ok=
 exec=
-upload_pack=
 keep=
 shallow_depth=
 while case "$#" in 0) break ;; esac
@@ -34,8 +33,12 @@ do
 	--upl|--uplo|--uploa|--upload|--upload-|--upload-p|\
 	--upload-pa|--upload-pac|--upload-pack)
 		shift
-		exec="--exec=$1" 
-		upload_pack="-u $1"
+		exec="--upload-pack=$1"
+		;;
+	--upl=*|--uplo=*|--uploa=*|--upload=*|\
+	--upload-=*|--upload-p=*|--upload-pa=*|--upload-pac=*|--upload-pack=*)
+		exec=--upload-pack=$(expr "$1" : '-[^=]*=\(.*\)')
+		shift
 		;;
 	-f|--f|--fo|--for|--forc|--force)
 		force=t
@@ -94,7 +97,7 @@ then
 fi
 
 # Global that is reused later
-ls_remote_result=$(git ls-remote $upload_pack "$remote") ||
+ls_remote_result=$(git ls-remote $exec "$remote") ||
 	die "Cannot get the repository state from $remote"
 
 append_fetch_head () {
diff --git a/git-ls-remote.sh b/git-ls-remote.sh
index 03b624e..dd22783 100755
--- a/git-ls-remote.sh
+++ b/git-ls-remote.sh
@@ -23,7 +23,11 @@ do
   -u|--u|--up|--upl|--uploa|--upload|--upload-|--upload-p|--upload-pa|\
   --upload-pac|--upload-pack)
 	shift
-	exec="--exec=$1"
+	exec="--upload-pack=$1"
+	shift;;
+  -u=*|--u=*|--up=*|--upl=*|--uplo=*|--uploa=*|--upload=*|\
+  --upload-=*|--upload-p=*|--upload-pa=*|--upload-pac=*|--upload-pack=*)
+	exec=--upload-pack=$(expr "$1" : '-[^=]*=\(.*\)')
 	shift;;
   --)
   shift; break ;;
-- 
1.5.0.rc2.g4e4d0
Previous: Junio C HamanoNext: Uwe Kleine-König
Message 8 of 9 in “Update documentation of fetch-pack, push and send-pack”
  1. Update documentation of fetch-pack, push and send-packUwe Kleine-König, Jan 19, 2007
  2. make --exec=... option to git-push configurableUwe Kleine-König, Jan 19, 2007
  3. rename --exec to --receive-pack for push and send-packUwe Kleine-König, Jan 19, 2007
  4. Junio C HamanoJan 19, 2007
  5. rename --exec to --upload-pack for fetch-pack and peek-remoteUwe Kleine-König, Jan 23, 2007
  6. Use --upload-pack in clone, fetch and ls-remote instead of --execUwe Kleine-König, Jan 23, 2007
  7. Junio C HamanoJan 23, 2007
  8. Junio C HamanoJan 23, 2007
  9. Uwe Kleine-KönigJan 23, 2007

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.