From: Sven Verdoolaege <skimo@kotnet.org>
Signed-off-by: Sven Verdoolaege <skimo@kotnet.org>
---
git-clone.sh | 20 ++++++++++++--------
git-fetch.sh | 28 ++++++++++++++++++++++------
2 files changed, 34 insertions(+), 14 deletions(-)
diff --git a/git-clone.sh b/git-clone.sh
index fdd354f..44127c5 100755
--- a/git-clone.sh
+++ b/git-clone.sh
@@ -159,6 +159,11 @@ then
no_checkout=yes
use_separate_remote=
fi
+if test t = "$use_separate_remote"; then
+ separate_remote_flag="--use-separate-remote"
+else
+ separate_remote_flag="--no-separate-remote"
+fi
if test -z "$origin"
then
@@ -219,6 +224,10 @@ then
fi
fi
+# Write out $origin URL
+GIT_CONFIG="$GIT_DIR/config"
+git-config remote."$origin".url "$repo" || exit
+
rm -f "$GIT_DIR/CLONE_HEAD"
# We do local magic only when the user tells us to.
@@ -299,11 +308,9 @@ yes,yes)
fi
;;
*)
- case "$upload_pack" in
- '') git-fetch-pack --all -k $quiet $depth $no_progress "$repo";;
- *) git-fetch-pack --all -k $quiet "$upload_pack" $depth $no_progress "$repo" ;;
- esac >"$GIT_DIR/CLONE_HEAD" ||
- die "fetch-pack from '$repo' failed."
+ git-fetch --all -k $quiet "$upload_pack" $depth \
+ $separate_remote_flag "$origin" ||
+ die "fetch from '$repo' failed."
;;
esac
;;
@@ -387,9 +394,6 @@ then
origin_track="$remote_top/$head_points_at" &&
git-update-ref HEAD "$head_sha1" &&
- # Upstream URL
- git-config remote."$origin".url "$repo" &&
-
# Set up the mappings to track the remote branches.
git-config remote."$origin".fetch \
"+refs/heads/*:$remote_top/*" '^$' &&
diff --git a/git-fetch.sh b/git-fetch.sh
index dbeca14..e169848 100755
--- a/git-fetch.sh
+++ b/git-fetch.sh
@@ -15,6 +15,7 @@ LF='
'
IFS="$LF"
+all=
no_tags=
tags=
append=
@@ -25,6 +26,7 @@ exec=
keep=
shallow_depth=
no_progress=
+use_separate_remote=
test -t 1 || no_progress=--no-progress
quiet=
while case "$#" in 0) break ;; esac
@@ -33,6 +35,9 @@ do
-a|--a|--ap|--app|--appe|--appen|--append)
append=t
;;
+ --al|--all)
+ all=--all
+ ;;
--upl|--uplo|--uploa|--upload|--upload-|--upload-p|\
--upload-pa|--upload-pac|--upload-pack)
shift
@@ -63,6 +68,12 @@ do
-v|--verbose)
verbose=Yes
;;
+ --use-separate-remote)
+ use_separate_remote="--use-separate-remote"
+ ;;
+ --no-separate-remote)
+ use_separate_remote="--no-separate-remote"
+ ;;
-k|--k|--ke|--kee|--keep)
keep='-k -k'
;;
@@ -143,7 +154,9 @@ esac
# branches file, and just fetch those and refspecs explicitly given.
# Otherwise we do what we always did.
-reflist=$(get_remote_refs_for_fetch "$@")
+if test -z "$all"; then
+ reflist=$(get_remote_refs_for_fetch "$@")
+fi
if test "$tags"
then
taglist=`IFS=' ' &&
@@ -165,8 +178,10 @@ fi
fetch_all_at_once () {
- eval=$(echo "$1" | git-fetch--tool parse-reflist "-")
- eval "$eval"
+ if test -z "$all"; then
+ eval=$(echo "$1" | git-fetch--tool parse-reflist "-")
+ eval "$eval"
+ fi
( : subshell because we muck with IFS
IFS=" $LF"
@@ -179,7 +194,8 @@ fetch_all_at_once () {
git-bundle unbundle "$remote" $rref ||
echo failed "$remote"
else
- if test -d "$remote" &&
+ if test -z "$all" &&
+ test -d "$remote" &&
# The remote might be our alternate. With
# this optimization we will bypass fetch-pack
@@ -203,7 +219,7 @@ fetch_all_at_once () {
echo "$ls_remote_result" | \
git-fetch--tool pick-rref "$rref" "-"
else
- git-fetch-pack --thin $exec $keep $shallow_depth \
+ git-fetch-pack --thin $all $exec $keep $shallow_depth \
$quiet $no_progress "$remote" $rref ||
echo failed "$remote"
fi
@@ -214,7 +230,7 @@ fetch_all_at_once () {
test -n "$verbose" && flags="$flags -v"
test -n "$force" && flags="$flags -f"
GIT_REFLOG_ACTION="$GIT_REFLOG_ACTION" \
- git-fetch--tool $flags native-store \
+ git-fetch--tool $flags $all $use_separate_remote native-store \
"$remote" "$remote_nick" "$refs"
)
) || exit
--
1.5.2.rc3.783.gc7476-dirty
-
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
| Linus Torvalds | Linux 2.6.27-rc8 |
| Andi Kleen | [PATCH x86] [2/16] Add a counter for per cpu clocksource watchdog checks and repor... |
| David Miller | Slow DOWN, please!!! |
| Greg KH | Re: [Patch v2] Make PCI extended config space (MMCONFIG) a driver opt-in |
git: | |
| Jeff King | Re: [PATCH] Color support added to git-add--interactive. |
| Yann Dirson | Re: irc usage.. |
| Peter Stahlir | Git as a filesystem |
| Junio C Hamano | Re: [PATCH 3/3] Teach "git branch" about --new-workdir |
| new_guy | Code signing in OpenBSD |
| Jason Dixon | Wasting our Freedom |
| Nick Guenther | Re: Real men don't attack straw men |
| Daniel Ouellet | identifying sparse files and get ride of them trick available? |
| Wolfgang Walter | Re: Kernel oops with 2.6.26, padlock and ipsec: probably problem with fpu state ch... |
| KOSAKI Motohiro | [bug?] tg3: Failed to load firmware "tigon/tg3_tso.bin" |
| Tomasz Grobelny | [PATCH 0/5] [DCCP]: Queuing policies |
| Arjan van de Ven | Re: [GIT]: Networking |
| high memory | 8 hours ago | Linux kernel |
| semaphore access speed | 11 hours ago | Applications and Utilities |
| the kernel how to power off the machine | 12 hours ago | Linux kernel |
| Easter Eggs in windows XP | 15 hours ago | Windows |
| Shared swap partition | 16 hours ago | Linux general |
| Root password | 16 hours ago | Linux general |
| Where/when DNOTIFY is used? | 18 hours ago | Linux kernel |
| How to convert Linux Kernel built-in module into a loadable module | 20 hours ago | Linux kernel |
| Linux 2.6.24 and I/O schedulers | 21 hours ago | Linux kernel |
| USB Driver -- Interrupt Polling -- A Little Help Please | 1 day ago | Linux general |
