From: Jakub Narebski <jnareb@gmail.com>
To: Junio C Hamano <junkio@cox.net>
Cc: git@vger.kernel.org
Subject: [PATCH 1/2] Use tabs for indent in shell scripts
Date: Tue, 1 Aug 2006 11:34:48 +0200 [thread overview]
Message-ID: <200608011134.52006.jnareb@gmail.com> (raw)
In-Reply-To: <7vd5bk3mqo.fsf@assigned-by-dhcp.cox.net>
Consistently use tabs for indenting in some shell scripts. Needs
checking for consistency (command1 && command2 && command3 split into
lines).
Signed-off-by: Jakub Narebski <jnareb@gmail.com>
---
git-clone.sh | 94 +++++-----
git-fetch.sh | 493 +++++++++++++++++++++++++++---------------------------
git-ls-remote.sh | 50 +++--
3 files changed, 319 insertions(+), 318 deletions(-)
diff --git a/git-clone.sh b/git-clone.sh
index a92b22a..adb752d 100755
--- a/git-clone.sh
+++ b/git-clone.sh
@@ -18,7 +18,7 @@ get_repo_base() {
}
if [ -n "$GIT_SSL_NO_VERIFY" ]; then
- curl_extra_args="-k"
+ curl_extra_args="-k"
fi
http_fetch () {
@@ -43,7 +43,7 @@ Perhaps git-update-server-info needs to
*^*) continue;;
esac
if test -n "$use_separate_remote" &&
- branch_name=`expr "z$name" : 'zheads/\(.*\)'`
+ branch_name=`expr "z$name" : 'zheads/\(.*\)'`
then
tname="remotes/$origin/$branch_name"
else
@@ -119,13 +119,13 @@ while
*,--na|*,--nak|*,--nake|*,--naked|\
*,-b|*,--b|*,--ba|*,--bar|*,--bare) bare=yes ;;
*,-l|*,--l|*,--lo|*,--loc|*,--loca|*,--local) use_local=yes ;;
- *,-s|*,--s|*,--sh|*,--sha|*,--shar|*,--share|*,--shared)
- local_shared=yes; use_local=yes ;;
+ *,-s|*,--s|*,--sh|*,--sha|*,--shar|*,--share|*,--shared)
+ local_shared=yes; use_local=yes ;;
1,--template) usage ;;
*,--template)
shift; template="--template=$1" ;;
*,--template=*)
- template="$1" ;;
+ template="$1" ;;
*,-q|*,--quiet) quiet=-q ;;
*,--use-separate-remote)
use_separate_remote=t ;;
@@ -137,18 +137,18 @@ while
*,-o|*,--or|*,--ori|*,--orig|*,--origi|*,--origin)
case "$2" in
'')
- usage ;;
+ usage ;;
*/*)
- echo >&2 "'$2' is not suitable for an origin name"
- exit 1
+ echo >&2 "'$2' is not suitable for an origin name"
+ exit 1
esac
git-check-ref-format "heads/$2" || {
- echo >&2 "'$2' is not suitable for a branch name"
- exit 1
+ echo >&2 "'$2' is not suitable for a branch name"
+ exit 1
}
test -z "$origin_override" || {
- echo >&2 "Do not give more than one --origin options."
- exit 1
+ echo >&2 "Do not give more than one --origin options."
+ exit 1
}
origin_override=yes
origin="$2"; shift
@@ -167,8 +167,8 @@ done
repo="$1"
if test -z "$repo"
then
- echo >&2 'you must specify a repository to clone.'
- exit 1
+ echo >&2 'you must specify a repository to clone.'
+ exit 1
fi
# --bare implies --no-checkout
@@ -225,9 +225,9 @@ then
echo "$reference/objects" >"$GIT_DIR/objects/info/alternates"
(cd "$reference" && tar cf - refs) |
(cd "$GIT_DIR/refs" &&
- mkdir reference-tmp &&
- cd reference-tmp &&
- tar xf -)
+ mkdir reference-tmp &&
+ cd reference-tmp &&
+ tar xf -)
else
echo >&2 "$reference: not a local directory." && usage
fi
@@ -245,26 +245,26 @@ yes,yes)
case "$local_shared" in
no)
- # See if we can hardlink and drop "l" if not.
- sample_file=$(cd "$repo" && \
- find objects -type f -print | sed -e 1q)
+ # See if we can hardlink and drop "l" if not.
+ sample_file=$(cd "$repo" && \
+ find objects -type f -print | sed -e 1q)
- # objects directory should not be empty since we are cloning!
- test -f "$repo/$sample_file" || exit
+ # objects directory should not be empty since we are cloning!
+ test -f "$repo/$sample_file" || exit
- l=
- if ln "$repo/$sample_file" "$GIT_DIR/objects/sample" 2>/dev/null
- then
- l=l
- fi &&
- rm -f "$GIT_DIR/objects/sample" &&
- cd "$repo" &&
- find objects -depth -print | cpio -pumd$l "$GIT_DIR/" || exit 1
- ;;
+ l=
+ if ln "$repo/$sample_file" "$GIT_DIR/objects/sample" 2>/dev/null
+ then
+ l=l
+ fi &&
+ rm -f "$GIT_DIR/objects/sample" &&
+ cd "$repo" &&
+ find objects -depth -print | cpio -pumd$l "$GIT_DIR/" || exit 1
+ ;;
yes)
- mkdir -p "$GIT_DIR/objects/info"
- echo "$repo/objects" >> "$GIT_DIR/objects/info/alternates"
- ;;
+ mkdir -p "$GIT_DIR/objects/info"
+ echo "$repo/objects" >> "$GIT_DIR/objects/info/alternates"
+ ;;
esac
git-ls-remote "$repo" >"$GIT_DIR/CLONE_HEAD" || exit 1
;;
@@ -282,19 +282,19 @@ yes,yes)
rm -f "$GIT_DIR/TMP_ALT"
if test -f "$GIT_DIR/TMP_ALT"
then
- ( cd "$D" &&
- . git-parse-remote &&
- resolve_alternates "$repo" <"$GIT_DIR/TMP_ALT" ) |
- while read alt
- do
- case "$alt" in 'bad alternate: '*) die "$alt";; esac
- case "$quiet" in
- '') echo >&2 "Getting alternate: $alt" ;;
- esac
- rsync $quiet -av --ignore-existing \
- --exclude info "$alt" "$GIT_DIR/objects" || exit
- done
- rm -f "$GIT_DIR/TMP_ALT"
+ ( cd "$D" &&
+ . git-parse-remote &&
+ resolve_alternates "$repo" <"$GIT_DIR/TMP_ALT" ) |
+ while read alt
+ do
+ case "$alt" in 'bad alternate: '*) die "$alt";; esac
+ case "$quiet" in
+ '') echo >&2 "Getting alternate: $alt" ;;
+ esac
+ rsync $quiet -av --ignore-existing \
+ --exclude info "$alt" "$GIT_DIR/objects" || exit
+ done
+ rm -f "$GIT_DIR/TMP_ALT"
fi
git-ls-remote "$repo" >"$GIT_DIR/CLONE_HEAD" || exit 1
;;
diff --git a/git-fetch.sh b/git-fetch.sh
index c2eebee..cea6e0b 100755
--- a/git-fetch.sh
+++ b/git-fetch.sh
@@ -90,124 +90,124 @@ then
fi
append_fetch_head () {
- head_="$1"
- remote_="$2"
- remote_name_="$3"
- remote_nick_="$4"
- local_name_="$5"
- case "$6" in
- t) not_for_merge_='not-for-merge' ;;
- '') not_for_merge_= ;;
- esac
+ head_="$1"
+ remote_="$2"
+ remote_name_="$3"
+ remote_nick_="$4"
+ local_name_="$5"
+ case "$6" in
+ t) not_for_merge_='not-for-merge' ;;
+ '') not_for_merge_= ;;
+ esac
- # remote-nick is the URL given on the command line (or a shorthand)
- # remote-name is the $GIT_DIR relative refs/ path we computed
- # for this refspec.
+ # remote-nick is the URL given on the command line (or a shorthand)
+ # remote-name is the $GIT_DIR relative refs/ path we computed
+ # for this refspec.
- # the $note_ variable will be fed to git-fmt-merge-msg for further
- # processing.
- case "$remote_name_" in
- HEAD)
- note_= ;;
- refs/heads/*)
- note_="$(expr "$remote_name_" : 'refs/heads/\(.*\)')"
- note_="branch '$note_' of " ;;
- refs/tags/*)
- note_="$(expr "$remote_name_" : 'refs/tags/\(.*\)')"
- note_="tag '$note_' of " ;;
- refs/remotes/*)
- note_="$(expr "$remote_name_" : 'refs/remotes/\(.*\)')"
- note_="remote branch '$note_' of " ;;
- *)
- note_="$remote_name of " ;;
- esac
- remote_1_=$(expr "z$remote_" : 'z\(.*\)\.git/*$') &&
+ # the $note_ variable will be fed to git-fmt-merge-msg for further
+ # processing.
+ case "$remote_name_" in
+ HEAD)
+ note_= ;;
+ refs/heads/*)
+ note_="$(expr "$remote_name_" : 'refs/heads/\(.*\)')"
+ note_="branch '$note_' of " ;;
+ refs/tags/*)
+ note_="$(expr "$remote_name_" : 'refs/tags/\(.*\)')"
+ note_="tag '$note_' of " ;;
+ refs/remotes/*)
+ note_="$(expr "$remote_name_" : 'refs/remotes/\(.*\)')"
+ note_="remote branch '$note_' of " ;;
+ *)
+ note_="$remote_name of " ;;
+ esac
+ remote_1_=$(expr "z$remote_" : 'z\(.*\)\.git/*$') &&
remote_="$remote_1_"
- note_="$note_$remote_"
+ note_="$note_$remote_"
- # 2.6.11-tree tag would not be happy to be fed to resolve.
- if git-cat-file commit "$head_" >/dev/null 2>&1
- then
- headc_=$(git-rev-parse --verify "$head_^0") || exit
- echo "$headc_ $not_for_merge_ $note_" >>"$GIT_DIR/FETCH_HEAD"
- [ "$verbose" ] && echo >&2 "* committish: $head_"
- [ "$verbose" ] && echo >&2 " $note_"
- else
- echo "$head_ not-for-merge $note_" >>"$GIT_DIR/FETCH_HEAD"
- [ "$verbose" ] && echo >&2 "* non-commit: $head_"
- [ "$verbose" ] && echo >&2 " $note_"
- fi
- if test "$local_name_" != ""
- then
- # We are storing the head locally. Make sure that it is
- # a fast forward (aka "reverse push").
- fast_forward_local "$local_name_" "$head_" "$note_"
- fi
+ # 2.6.11-tree tag would not be happy to be fed to resolve.
+ if git-cat-file commit "$head_" >/dev/null 2>&1
+ then
+ headc_=$(git-rev-parse --verify "$head_^0") || exit
+ echo "$headc_ $not_for_merge_ $note_" >>"$GIT_DIR/FETCH_HEAD"
+ [ "$verbose" ] && echo >&2 "* committish: $head_"
+ [ "$verbose" ] && echo >&2 " $note_"
+ else
+ echo "$head_ not-for-merge $note_" >>"$GIT_DIR/FETCH_HEAD"
+ [ "$verbose" ] && echo >&2 "* non-commit: $head_"
+ [ "$verbose" ] && echo >&2 " $note_"
+ fi
+ if test "$local_name_" != ""
+ then
+ # We are storing the head locally. Make sure that it is
+ # a fast forward (aka "reverse push").
+ fast_forward_local "$local_name_" "$head_" "$note_"
+ fi
}
fast_forward_local () {
- mkdir -p "$(dirname "$GIT_DIR/$1")"
- case "$1" in
- refs/tags/*)
- # Tags need not be pointing at commits so there
- # is no way to guarantee "fast-forward" anyway.
- if test -f "$GIT_DIR/$1"
- then
- if now_=$(cat "$GIT_DIR/$1") && test "$now_" = "$2"
+ mkdir -p "$(dirname "$GIT_DIR/$1")"
+ case "$1" in
+ refs/tags/*)
+ # Tags need not be pointing at commits so there
+ # is no way to guarantee "fast-forward" anyway.
+ if test -f "$GIT_DIR/$1"
then
- [ "$verbose" ] && echo >&2 "* $1: same as $3" ||:
+ if now_=$(cat "$GIT_DIR/$1") && test "$now_" = "$2"
+ then
+ [ "$verbose" ] && echo >&2 "* $1: same as $3" ||:
+ else
+ echo >&2 "* $1: updating with $3"
+ git-update-ref -m "$rloga: updating tag" "$1" "$2"
+ fi
else
- echo >&2 "* $1: updating with $3"
- git-update-ref -m "$rloga: updating tag" "$1" "$2"
+ echo >&2 "* $1: storing $3"
+ git-update-ref -m "$rloga: storing tag" "$1" "$2"
fi
- else
- echo >&2 "* $1: storing $3"
- git-update-ref -m "$rloga: storing tag" "$1" "$2"
- fi
- ;;
+ ;;
- refs/heads/* | refs/remotes/*)
- # $1 is the ref being updated.
- # $2 is the new value for the ref.
- local=$(git-rev-parse --verify "$1^0" 2>/dev/null)
- if test "$local"
- then
- # Require fast-forward.
- mb=$(git-merge-base "$local" "$2") &&
- case "$2,$mb" in
- $local,*)
- if test -n "$verbose"
+ refs/heads/* | refs/remotes/*)
+ # $1 is the ref being updated.
+ # $2 is the new value for the ref.
+ local=$(git-rev-parse --verify "$1^0" 2>/dev/null)
+ if test "$local"
then
- echo >&2 "* $1: same as $3"
+ # Require fast-forward.
+ mb=$(git-merge-base "$local" "$2") &&
+ case "$2,$mb" in
+ $local,*)
+ if test -n "$verbose"
+ then
+ echo >&2 "* $1: same as $3"
+ fi
+ ;;
+ *,$local)
+ echo >&2 "* $1: fast forward to $3"
+ echo >&2 " from $local to $2"
+ git-update-ref -m "$rloga: fast-forward" "$1" "$2" "$local"
+ ;;
+ *)
+ false
+ ;;
+ esac || {
+ echo >&2 "* $1: does not fast forward to $3;"
+ case ",$force,$single_force," in
+ *,t,*)
+ echo >&2 " forcing update."
+ git-update-ref -m "$rloga: forced-update" "$1" "$2" "$local"
+ ;;
+ *)
+ echo >&2 " not updating."
+ exit 1
+ ;;
+ esac
+ }
+ else
+ echo >&2 "* $1: storing $3"
+ git-update-ref -m "$rloga: storing head" "$1" "$2"
fi
;;
- *,$local)
- echo >&2 "* $1: fast forward to $3"
- echo >&2 " from $local to $2"
- git-update-ref -m "$rloga: fast-forward" "$1" "$2" "$local"
- ;;
- *)
- false
- ;;
- esac || {
- echo >&2 "* $1: does not fast forward to $3;"
- case ",$force,$single_force," in
- *,t,*)
- echo >&2 " forcing update."
- git-update-ref -m "$rloga: forced-update" "$1" "$2" "$local"
- ;;
- *)
- echo >&2 " not updating."
- exit 1
- ;;
- esac
- }
- else
- echo >&2 "* $1: storing $3"
- git-update-ref -m "$rloga: storing head" "$1" "$2"
- fi
- ;;
- esac
+ esac
}
case "$update_head_ok" in
@@ -225,26 +225,27 @@ reflist=$(get_remote_refs_for_fetch "$@"
if test "$tags"
then
taglist=`IFS=" " &&
- (
+ (
git-ls-remote $upload_pack --tags "$remote" ||
echo fail ouch
- ) |
- while read sha1 name
- do
+ ) |
+ while read sha1 name
+ do
case "$sha1" in
fail)
exit 1
esac
case "$name" in
- *^*) continue ;;
+ *^*)
+ continue ;;
esac
- if git-check-ref-format "$name"
+ if git-check-ref-format "$name"
then
- echo ".${name}:${name}"
+ echo ".${name}:${name}"
else
- echo >&2 "warning: tag ${name} ignored"
+ echo >&2 "warning: tag ${name} ignored"
fi
- done` || exit
+ done` || exit
if test "$#" -gt 1
then
# remote URL plus explicit refspecs; we need to merge them.
@@ -256,146 +257,146 @@ then
fi
fetch_main () {
- reflist="$1"
- refs=
+ reflist="$1"
+ refs=
- for ref in $reflist
- do
- refs="$refs$LF$ref"
+ for ref in $reflist
+ do
+ refs="$refs$LF$ref"
- # These are relative path from $GIT_DIR, typically starting at refs/
- # but may be HEAD
- if expr "z$ref" : 'z\.' >/dev/null
- then
- not_for_merge=t
- ref=$(expr "z$ref" : 'z\.\(.*\)')
- else
- not_for_merge=
- fi
- if expr "z$ref" : 'z+' >/dev/null
- then
- single_force=t
- ref=$(expr "z$ref" : 'z+\(.*\)')
- else
- single_force=
- fi
- remote_name=$(expr "z$ref" : 'z\([^:]*\):')
- local_name=$(expr "z$ref" : 'z[^:]*:\(.*\)')
+ # These are relative path from $GIT_DIR, typically starting at refs/
+ # but may be HEAD
+ if expr "z$ref" : 'z\.' >/dev/null
+ then
+ not_for_merge=t
+ ref=$(expr "z$ref" : 'z\.\(.*\)')
+ else
+ not_for_merge=
+ fi
+ if expr "z$ref" : 'z+' >/dev/null
+ then
+ single_force=t
+ ref=$(expr "z$ref" : 'z+\(.*\)')
+ else
+ single_force=
+ fi
+ remote_name=$(expr "z$ref" : 'z\([^:]*\):')
+ local_name=$(expr "z$ref" : 'z[^:]*:\(.*\)')
- rref="$rref$LF$remote_name"
+ rref="$rref$LF$remote_name"
- # There are transports that can fetch only one head at a time...
- case "$remote" in
- http://* | https://*)
- if [ -n "$GIT_SSL_NO_VERIFY" ]; then
- curl_extra_args="-k"
- fi
- max_depth=5
- depth=0
- head="ref: $remote_name"
- while (expr "z$head" : "zref:" && expr $depth \< $max_depth) >/dev/null
- do
- remote_name_quoted=$(@@PERL@@ -e '
- my $u = $ARGV[0];
- $u =~ s/^ref:\s*//;
- $u =~ s{([^-a-zA-Z0-9/.])}{sprintf"%%%02x",ord($1)}eg;
- print "$u";
- ' "$head")
- head=$(curl -nsfL $curl_extra_args "$remote/$remote_name_quoted")
- depth=$( expr \( $depth + 1 \) )
- done
- expr "z$head" : "z$_x40\$" >/dev/null ||
- die "Failed to fetch $remote_name from $remote"
- echo >&2 Fetching "$remote_name from $remote" using http
- git-http-fetch -v -a "$head" "$remote/" || exit
- ;;
- rsync://*)
- TMP_HEAD="$GIT_DIR/TMP_HEAD"
- rsync -L -q "$remote/$remote_name" "$TMP_HEAD" || exit 1
- head=$(git-rev-parse --verify TMP_HEAD)
- rm -f "$TMP_HEAD"
- test "$rsync_slurped_objects" || {
- rsync -av --ignore-existing --exclude info \
- "$remote/objects/" "$GIT_OBJECT_DIRECTORY/" || exit
+ # There are transports that can fetch only one head at a time...
+ case "$remote" in
+ http://* | https://*)
+ if [ -n "$GIT_SSL_NO_VERIFY" ]; then
+ curl_extra_args="-k"
+ fi
+ max_depth=5
+ depth=0
+ head="ref: $remote_name"
+ while (expr "z$head" : "zref:" && expr $depth \< $max_depth) >/dev/null
+ do
+ remote_name_quoted=$(@@PERL@@ -e '
+ my $u = $ARGV[0];
+ $u =~ s/^ref:\s*//;
+ $u =~ s{([^-a-zA-Z0-9/.])}{sprintf"%%%02x",ord($1)}eg;
+ print "$u";
+ ' "$head")
+ head=$(curl -nsfL $curl_extra_args "$remote/$remote_name_quoted")
+ depth=$( expr \( $depth + 1 \) )
+ done
+ expr "z$head" : "z$_x40\$" >/dev/null ||
+ die "Failed to fetch $remote_name from $remote"
+ echo >&2 Fetching "$remote_name from $remote" using http
+ git-http-fetch -v -a "$head" "$remote/" || exit
+ ;;
+ rsync://*)
+ TMP_HEAD="$GIT_DIR/TMP_HEAD"
+ rsync -L -q "$remote/$remote_name" "$TMP_HEAD" || exit 1
+ head=$(git-rev-parse --verify TMP_HEAD)
+ rm -f "$TMP_HEAD"
+ test "$rsync_slurped_objects" || {
+ rsync -av --ignore-existing --exclude info \
+ "$remote/objects/" "$GIT_OBJECT_DIRECTORY/" || exit
- # Look at objects/info/alternates for rsync -- http will
- # support it natively and git native ones will do it on
- # the remote end. Not having that file is not a crime.
- rsync -q "$remote/objects/info/alternates" \
- "$GIT_DIR/TMP_ALT" 2>/dev/null ||
- rm -f "$GIT_DIR/TMP_ALT"
- if test -f "$GIT_DIR/TMP_ALT"
- then
- resolve_alternates "$remote" <"$GIT_DIR/TMP_ALT" |
- while read alt
- do
- case "$alt" in 'bad alternate: '*) die "$alt";; esac
- echo >&2 "Getting alternate: $alt"
- rsync -av --ignore-existing --exclude info \
- "$alt" "$GIT_OBJECT_DIRECTORY/" || exit
- done
- rm -f "$GIT_DIR/TMP_ALT"
- fi
- rsync_slurped_objects=t
- }
- ;;
- *)
- # We will do git native transport with just one call later.
- continue ;;
- esac
+ # Look at objects/info/alternates for rsync -- http will
+ # support it natively and git native ones will do it on
+ # the remote end. Not having that file is not a crime.
+ rsync -q "$remote/objects/info/alternates" \
+ "$GIT_DIR/TMP_ALT" 2>/dev/null ||
+ rm -f "$GIT_DIR/TMP_ALT"
+ if test -f "$GIT_DIR/TMP_ALT"
+ then
+ resolve_alternates "$remote" <"$GIT_DIR/TMP_ALT" |
+ while read alt
+ do
+ case "$alt" in 'bad alternate: '*) die "$alt";; esac
+ echo >&2 "Getting alternate: $alt"
+ rsync -av --ignore-existing --exclude info \
+ "$alt" "$GIT_OBJECT_DIRECTORY/" || exit
+ done
+ rm -f "$GIT_DIR/TMP_ALT"
+ fi
+ rsync_slurped_objects=t
+ }
+ ;;
+ *)
+ # We will do git native transport with just one call later.
+ continue ;;
+ esac
- append_fetch_head "$head" "$remote" \
- "$remote_name" "$remote_nick" "$local_name" "$not_for_merge"
+ append_fetch_head "$head" "$remote" \
+ "$remote_name" "$remote_nick" "$local_name" "$not_for_merge"
- done
+ done
- case "$remote" in
- http://* | https://* | rsync://* )
- ;; # we are already done.
- *)
- ( : subshell because we muck with IFS
- IFS=" $LF"
- (
- git-fetch-pack $exec $keep "$remote" $rref || echo failed "$remote"
- ) |
- while read sha1 remote_name
- do
- case "$sha1" in
- failed)
- echo >&2 "Fetch failure: $remote"
- exit 1 ;;
- esac
- found=
- single_force=
- for ref in $refs
- do
- case "$ref" in
- +$remote_name:*)
- single_force=t
- not_for_merge=
- found="$ref"
- break ;;
- .+$remote_name:*)
- single_force=t
- not_for_merge=t
- found="$ref"
- break ;;
- .$remote_name:*)
- not_for_merge=t
- found="$ref"
- break ;;
- $remote_name:*)
- not_for_merge=
- found="$ref"
- break ;;
- esac
- done
- local_name=$(expr "z$found" : 'z[^:]*:\(.*\)')
- append_fetch_head "$sha1" "$remote" \
- "$remote_name" "$remote_nick" "$local_name" "$not_for_merge"
- done
- ) || exit ;;
- esac
+ case "$remote" in
+ http://* | https://* | rsync://* )
+ ;; # we are already done.
+ *)
+ ( : subshell because we muck with IFS
+ IFS=" $LF"
+ (
+ git-fetch-pack $exec $keep "$remote" $rref || echo failed "$remote"
+ ) |
+ while read sha1 remote_name
+ do
+ case "$sha1" in
+ failed)
+ echo >&2 "Fetch failure: $remote"
+ exit 1 ;;
+ esac
+ found=
+ single_force=
+ for ref in $refs
+ do
+ case "$ref" in
+ +$remote_name:*)
+ single_force=t
+ not_for_merge=
+ found="$ref"
+ break ;;
+ .+$remote_name:*)
+ single_force=t
+ not_for_merge=t
+ found="$ref"
+ break ;;
+ .$remote_name:*)
+ not_for_merge=t
+ found="$ref"
+ break ;;
+ $remote_name:*)
+ not_for_merge=
+ found="$ref"
+ break ;;
+ esac
+ done
+ local_name=$(expr "z$found" : 'z[^:]*:\(.*\)')
+ append_fetch_head "$sha1" "$remote" \
+ "$remote_name" "$remote_nick" "$local_name" "$not_for_merge"
+ done
+ ) || exit ;;
+ esac
}
@@ -439,7 +440,7 @@ case ",$update_head_ok,$orig_head," in
curr_head=$(git-rev-parse --verify HEAD 2>/dev/null)
if test "$curr_head" != "$orig_head"
then
- git-update-ref \
+ git-update-ref \
-m "$rloga: Undoing incorrectly fetched HEAD." \
HEAD "$orig_head"
die "Cannot fetch into the current branch."
diff --git a/git-ls-remote.sh b/git-ls-remote.sh
index 2fdcaf7..38122ad 100755
--- a/git-ls-remote.sh
+++ b/git-ls-remote.sh
@@ -2,36 +2,36 @@ #!/bin/sh
#
usage () {
- echo >&2 "usage: $0 [--heads] [--tags] [-u|--upload-pack <upload-pack>]"
- echo >&2 " <repository> <refs>..."
- exit 1;
+ echo >&2 "usage: $0 [--heads] [--tags] [-u|--upload-pack <upload-pack>]"
+ echo >&2 " <repository> <refs>..."
+ exit 1;
}
die () {
- echo >&2 "$*"
- exit 1
+ echo >&2 "$*"
+ exit 1
}
exec=
while case "$#" in 0) break;; esac
do
- case "$1" in
- -h|--h|--he|--hea|--head|--heads)
- heads=heads; shift ;;
- -t|--t|--ta|--tag|--tags)
- tags=tags; shift ;;
- -u|--u|--up|--upl|--uploa|--upload|--upload-|--upload-p|--upload-pa|\
- --upload-pac|--upload-pack)
- shift
- exec="--exec=$1"
- shift;;
- --)
- shift; break ;;
- -*)
- usage ;;
- *)
- break ;;
- esac
+ case "$1" in
+ -h|--h|--he|--hea|--head|--heads)
+ heads=heads; shift ;;
+ -t|--t|--ta|--tag|--tags)
+ tags=tags; shift ;;
+ -u|--u|--up|--upl|--uploa|--upload|--upload-|--upload-p|--upload-pa|\
+ --upload-pac|--upload-pack)
+ shift
+ exec="--exec=$1"
+ shift;;
+ --)
+ shift; break ;;
+ -*)
+ usage ;;
+ *)
+ break ;;
+ esac
done
case "$#" in 0) usage ;; esac
@@ -50,9 +50,9 @@ tmpdir=$tmp-d
case "$peek_repo" in
http://* | https://* )
- if [ -n "$GIT_SSL_NO_VERIFY" ]; then
- curl_extra_args="-k"
- fi
+ if [ -n "$GIT_SSL_NO_VERIFY" ]; then
+ curl_extra_args="-k"
+ fi
curl -nsf $curl_extra_args --header "Pragma: no-cache" "$peek_repo/info/refs" ||
echo "failed slurping"
;;
--
1.4.1.1
next prev parent reply other threads:[~2006-08-01 9:36 UTC|newest]
Thread overview: 54+ messages / expand[flat|nested] mbox.gz Atom feed top
2006-07-29 20:39 [PATCH 0] Some gitweb patches Jakub Narebski
2006-07-29 20:43 ` [PATCH 1] gitweb: whitespace cleanup Jakub Narebski
2006-07-29 20:51 ` [PATCH 2] gitweb: Use list for of open for running git commands, thorougly Jakub Narebski
2006-07-30 2:12 ` Jakub Narebski
2006-07-31 10:53 ` Junio C Hamano
2006-07-31 11:42 ` Jakub Narebski
2006-07-31 12:10 ` Jakub Narebski
2006-07-31 12:38 ` Jakub Narebski
2006-07-31 12:59 ` Jakub Narebski
2006-07-29 20:55 ` [PATCH 3] gitweb: simplify git_get_hash_by_path Jakub Narebski
2006-07-29 21:01 ` [PATCH 4] gitweb: More explicit error messages for open "-|" Jakub Narebski
2006-07-30 2:08 ` [PATCH 5] gitweb: Cleanup - chomp $line in consistent style Jakub Narebski
2006-07-30 2:11 ` [PATCH 6] gitweb: Correct error from changing "-|" open to list form in git_commit Jakub Narebski
2006-07-30 12:58 ` [PATCH 7] gitweb: Cleanup - chomp @lines in consistent style Jakub Narebski
2006-07-30 12:59 ` [PATCH 8] gitweb: Add git_page_nav for later use Jakub Narebski
2006-07-30 13:01 ` [PATCH 9] gitweb: Navbar refactoring - use git_page_nav to generate navigation bar Jakub Narebski
2006-07-30 13:02 ` [PATCH 10] gitweb: Replace form-feed character by ^L Jakub Narebski
2006-07-30 14:13 ` [PATCH 11] gitweb: Read project description using utf-8 encoding Jakub Narebski
2006-07-30 15:20 ` Jakub Narebski
2006-07-30 15:47 ` [PATCH 11] gitweb: Show project descriptions with utf-8 characters in project list correctly Jakub Narebski
2006-07-30 14:14 ` [PATCH 12] gitweb: Add "\n" after <br/> in git_page_nav Jakub Narebski
2006-07-30 15:49 ` [PATCH 13] gitweb: Pager refactoring - use git_get_paging_nav for pagination Jakub Narebski
2006-07-30 18:31 ` [PATCH 14] gitweb: Remove $project from git_get_paging_nav arguments Jakub Narebski
2006-07-30 18:32 ` [PATCH 15] gitweb: Headers refactoring - use git_header_div for header divs Jakub Narebski
2006-07-30 20:36 ` [PATCH 16] gitweb: Remove characters entities entirely when shortening string Jakub Narebski
2006-07-31 16:59 ` Jakub Narebski
2006-07-31 18:58 ` [PATCH 16b] gitweb: Remove characters entities entirely when shortening string -- correction Jakub Narebski
2006-07-31 0:21 ` [PATCH 17] gitweb: Ref refactoring - use git_get_referencing for marking tagged/head commits Jakub Narebski
2006-07-31 9:22 ` [PATCH 18] gitweb: Refactor generation of shortlog, tags and heads body Jakub Narebski
2006-07-31 16:33 ` [PATCH 19] gitweb: No need to quote path for list version of open "-|" Jakub Narebski
2006-07-31 18:55 ` Junio C Hamano
2006-07-31 19:00 ` Jakub Narebski
2006-08-01 2:17 ` Junio C Hamano
2006-08-01 2:18 ` There can be more than two levels of subdirectories Junio C Hamano
2006-07-31 18:48 ` [PATCH 20] gitweb: Reordering code and dividing it into categories Jakub Narebski
2006-07-31 19:22 ` [PATCH 20 (amend)] " Jakub Narebski
2006-07-31 21:46 ` [PATCH] gitweb: use a hash to lookup the sub for an action Matthias Lederhofer
2006-07-31 22:39 ` Junio C Hamano
2006-07-31 22:55 ` [PATCH 21] " Jakub Narebski
2006-08-01 2:50 ` [PATCH] " Luben Tuikov
2006-08-01 0:59 ` [PATCH 22] Jakub Narebski
2006-08-01 2:12 ` Perhaps an obvious cut and paste error Junio C Hamano
2006-08-01 7:23 ` Jakub Narebski
2006-08-01 4:24 ` A few more fixups to gitweb Junio C Hamano
2006-08-01 7:36 ` Jakub Narebski
2006-08-01 8:04 ` Junio C Hamano
2006-08-01 9:34 ` Jakub Narebski [this message]
2006-08-01 9:36 ` [PATCH 2/2] Set User-Agent string in shell scripts used for fetching Jakub Narebski
2006-08-01 9:51 ` Junio C Hamano
2006-08-01 9:50 ` [PATCH 1/2] Use tabs for indent in shell scripts Junio C Hamano
2006-08-01 10:01 ` Jakub Narebski
2006-08-01 20:10 ` A few more fixups to gitweb Luben Tuikov
2006-08-01 12:48 ` [PATCH] gitweb: clean up user configuration part Matthias Lederhofer
2006-08-01 13:53 ` [RFC/PATCH] gitweb: include perl files for configuration Matthias Lederhofer
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=200608011134.52006.jnareb@gmail.com \
--to=jnareb@gmail.com \
--cc=git@vger.kernel.org \
--cc=junkio@cox.net \
/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;
as well as URLs for NNTP newsgroup(s).