From: "Uwe Kleine-König" <ukleinek@informatik.uni-freiburg.de>
To: Junio C Hamano <junkio@cox.net>,
git@vger.kernel.org, "Shawn O. Pearce" <spearce@spearce.org>,
Johannes Schindelin <Johannes.Schindelin@gmx.de>
Subject: [PATCH] make --upload-pack option to git-fetch configurable
Date: Thu, 25 Jan 2007 05:45:39 +0100 [thread overview]
Message-ID: <20070125044539.GA11397@cepheus> (raw)
In-Reply-To: <20070118071723.GB3245@informatik.uni-freiburg.de>
This introduces the config item remote.<name>.uploadpack to override the
default value (which is "git-upload-pack").
Signed-off-by: Uwe Kleine-König <ukleinek@informatik.uni-freiburg.de>
---
> > diff --git a/git-fetch.sh b/git-fetch.sh
> > index 87b940b..7372c5f 100755
> > --- a/git-fetch.sh
> > +++ b/git-fetch.sh
> > @@ -82,6 +82,13 @@ case "$#" in
> > set x $origin ; shift ;;
> > esac
> >
> > +if test -z "$exec" && exec=$(git-repo-config "remote.$1.uploadpack")
> > +then
> > + # No command line override and we have configuration for the remote.
> > + upload_pack="-u $exec"
> > + exec="--exec=$exec"
> > +fi
> > +
> > remote_nick="$1"
> > remote=$(get_remote_url "$@")
> > refs=
>
> I thought that it would be cleaner to add this code to
> git-parse-remote.sh and only do it if $(get_data_source) == 'config'.
This is, what this patch does. Actually it was easier than I feared.
git-fetch.sh | 6 ++++++
git-parse-remote.sh | 13 +++++++++++++
2 files changed, 19 insertions(+), 0 deletions(-)
diff --git a/git-fetch.sh b/git-fetch.sh
index 07a1d05..61c8cf4 100755
--- a/git-fetch.sh
+++ b/git-fetch.sh
@@ -85,6 +85,12 @@ case "$#" in
set x $origin ; shift ;;
esac
+if test -z "$exec"
+then
+ # No command line override and we have configuration for the remote.
+ exec="--upload-pack=$(get_uploadpack $1)"
+fi
+
remote_nick="$1"
remote=$(get_remote_url "$@")
refs=
diff --git a/git-parse-remote.sh b/git-parse-remote.sh
index 4fc6020..1122c83 100755
--- a/git-parse-remote.sh
+++ b/git-parse-remote.sh
@@ -279,3 +279,16 @@ resolve_alternates () {
esac
done
}
+
+get_uploadpack () {
+ data_source=$(get_data_source "$1")
+ case "$data_source" in
+ config)
+ uplp=$(git-repo-config --get "remote.$1.uploadpack")
+ echo ${uplp:-git-upload-pack}
+ ;;
+ *)
+ echo "git-upload-pack"
+ ;;
+ esac
+}
--
1.5.0.rc2.g3ea949
Uwe Kleine-König wrote:
>
> Best regards
> Uwe
>
> --
> Uwe Kleine-König
>
> If a lawyer and an IRS agent were both drowning, and you could only save
> one of them, would you go to lunch or read the paper?
> -
> To unsubscribe from this list: send the line "unsubscribe git" in
> the body of a message to majordomo@vger.kernel.org
> More majordomo info at http://vger.kernel.org/majordomo-info.html
--
Uwe Kleine-König
http://www.google.com/search?q=12+divided+by+3
next prev parent reply other threads:[~2007-01-25 4:46 UTC|newest]
Thread overview: 19+ messages / expand[flat|nested] mbox.gz Atom feed top
2007-01-16 15:02 [PATCH RFC] new config option remote.<name>.pushexec Uwe Kleine-König
2007-01-16 15:16 ` Johannes Schindelin
2007-01-16 16:26 ` Uwe Kleine-König
2007-01-16 17:37 ` How to merge FETCH_HEAD? Michael S. Tsirkin
2007-01-16 19:59 ` Shawn O. Pearce
2007-01-16 21:33 ` Michael S. Tsirkin
2007-01-16 21:36 ` Johannes Schindelin
2007-01-17 5:09 ` Michael S. Tsirkin
2007-01-17 6:14 ` Junio C Hamano
2007-01-17 6:33 ` Michael S. Tsirkin
2007-01-16 20:15 ` Junio C Hamano
2007-01-16 20:08 ` [PATCH RFC] new config option remote.<name>.pushexec Shawn O. Pearce
2007-01-16 20:30 ` Johannes Schindelin
2007-01-17 16:44 ` Uwe Kleine-König
2007-01-17 17:32 ` Junio C Hamano
2007-01-18 7:17 ` Uwe Kleine-König
2007-01-25 4:45 ` Uwe Kleine-König [this message]
2007-01-25 4:53 ` [PATCH] make --upload-pack option to git-fetch configurable Uwe Kleine-König
2007-01-16 16:27 ` [PATCH RFC] new config option remote.<name>.pushexec Brian Gernhardt
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20070125044539.GA11397@cepheus \
--to=ukleinek@informatik.uni-freiburg.de \
--cc=Johannes.Schindelin@gmx.de \
--cc=git@vger.kernel.org \
--cc=junkio@cox.net \
--cc=spearce@spearce.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox