diff options
Diffstat (limited to 'contrib/examples')
-rw-r--r-- | contrib/examples/builtin-fetch--tool.c | 3 | ||||
-rwxr-xr-x | contrib/examples/git-checkout.sh | 10 | ||||
-rwxr-xr-x | contrib/examples/git-clone.sh | 20 | ||||
-rwxr-xr-x | contrib/examples/git-commit.sh | 12 | ||||
-rwxr-xr-x | contrib/examples/git-fetch.sh | 6 | ||||
-rwxr-xr-x | contrib/examples/git-ls-remote.sh | 4 | ||||
-rwxr-xr-x | contrib/examples/git-merge.sh | 4 | ||||
-rwxr-xr-x | contrib/examples/git-repack.sh | 2 | ||||
-rwxr-xr-x | contrib/examples/git-reset.sh | 4 | ||||
-rwxr-xr-x | contrib/examples/git-resolve.sh | 2 | ||||
-rwxr-xr-x | contrib/examples/git-revert.sh | 2 | ||||
-rwxr-xr-x | contrib/examples/git-tag.sh | 2 | ||||
-rwxr-xr-x | contrib/examples/git-whatchanged.sh | 4 |
13 files changed, 38 insertions, 37 deletions
diff --git a/contrib/examples/builtin-fetch--tool.c b/contrib/examples/builtin-fetch--tool.c index 8bc8c7533a..ee1916641e 100644 --- a/contrib/examples/builtin-fetch--tool.c +++ b/contrib/examples/builtin-fetch--tool.c @@ -31,7 +31,8 @@ static int update_ref_env(const char *action, rla = "(reflog update)"; if (snprintf(msg, sizeof(msg), "%s: %s", rla, action) >= sizeof(msg)) warning("reflog message too long: %.*s...", 50, msg); - return update_ref(msg, refname, sha1, oldval, 0, QUIET_ON_ERR); + return update_ref(msg, refname, sha1, oldval, 0, + UPDATE_REFS_QUIET_ON_ERR); } static int update_local_ref(const char *name, diff --git a/contrib/examples/git-checkout.sh b/contrib/examples/git-checkout.sh index 1a7689a48f..683cae7c3f 100755 --- a/contrib/examples/git-checkout.sh +++ b/contrib/examples/git-checkout.sh @@ -168,7 +168,7 @@ cd_to_toplevel # branch. However, if "git checkout HEAD" detaches the HEAD # from the current branch, even though that may be logically # correct, it feels somewhat funny. More importantly, we do not -# want "git checkout" nor "git checkout -f" to detach HEAD. +# want "git checkout" or "git checkout -f" to detach HEAD. detached= detach_warn= @@ -222,7 +222,7 @@ else # Match the index to the working tree, and do a three-way. git diff-files --name-only | git update-index --remove --stdin && - work=`git write-tree` && + work=$(git write-tree) && git read-tree $v --reset -u $new || exit eval GITHEAD_$new='${new_name:-${branch:-$new}}' && @@ -233,7 +233,7 @@ else # Do not register the cleanly merged paths in the index yet. # this is not a real merge before committing, but just carrying # the working tree changes along. - unmerged=`git ls-files -u` + unmerged=$(git ls-files -u) git read-tree $v --reset $new case "$unmerged" in '') ;; @@ -269,7 +269,7 @@ if [ "$?" -eq 0 ]; then fi if test -n "$branch" then - old_branch_name=`expr "z$oldbranch" : 'zrefs/heads/\(.*\)'` + old_branch_name=$(expr "z$oldbranch" : 'zrefs/heads/\(.*\)') GIT_DIR="$GIT_DIR" git symbolic-ref -m "checkout: moving from ${old_branch_name:-$old} to $branch" HEAD "refs/heads/$branch" if test -n "$quiet" then @@ -282,7 +282,7 @@ if [ "$?" -eq 0 ]; then fi elif test -n "$detached" then - old_branch_name=`expr "z$oldbranch" : 'zrefs/heads/\(.*\)'` + old_branch_name=$(expr "z$oldbranch" : 'zrefs/heads/\(.*\)') git update-ref --no-deref -m "checkout: moving from ${old_branch_name:-$old} to $arg" HEAD "$detached" || die "Cannot detach HEAD" if test -n "$detach_warn" diff --git a/contrib/examples/git-clone.sh b/contrib/examples/git-clone.sh index 547228e13c..b4c9376a2c 100755 --- a/contrib/examples/git-clone.sh +++ b/contrib/examples/git-clone.sh @@ -40,7 +40,7 @@ eval "$(echo "$OPTIONS_SPEC" | git rev-parse --parseopt -- "$@" || echo exit $?) get_repo_base() { ( - cd "`/bin/pwd`" && + cd "$(/bin/pwd)" && cd "$1" || cd "$1.git" && { cd .git @@ -50,7 +50,7 @@ get_repo_base() { } if [ -n "$GIT_SSL_NO_VERIFY" -o \ - "`git config --bool http.sslVerify`" = false ]; then + "$(git config --bool http.sslVerify)" = false ]; then curl_extra_args="-k" fi @@ -70,7 +70,7 @@ clone_dumb_http () { clone_tmp="$GIT_DIR/clone-tmp" && mkdir -p "$clone_tmp" || exit 1 if [ -n "$GIT_CURL_FTP_NO_EPSV" -o \ - "`git config --bool http.noEPSV`" = true ]; then + "$(git config --bool http.noEPSV)" = true ]; then curl_extra_args="${curl_extra_args} --disable-epsv" fi http_fetch "$1/info/refs" "$clone_tmp/refs" || @@ -79,7 +79,7 @@ Perhaps git-update-server-info needs to be run there?" test "z$quiet" = z && v=-v || v= while read sha1 refname do - name=`expr "z$refname" : 'zrefs/\(.*\)'` && + name=$(expr "z$refname" : 'zrefs/\(.*\)') && case "$name" in *^*) continue;; esac @@ -88,7 +88,7 @@ Perhaps git-update-server-info needs to be run there?" *) 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 @@ -100,7 +100,7 @@ Perhaps git-update-server-info needs to be run there?" http_fetch "$1/HEAD" "$GIT_DIR/REMOTE_HEAD" || rm -f "$GIT_DIR/REMOTE_HEAD" if test -f "$GIT_DIR/REMOTE_HEAD"; then - head_sha1=`cat "$GIT_DIR/REMOTE_HEAD"` + head_sha1=$(cat "$GIT_DIR/REMOTE_HEAD") case "$head_sha1" in 'ref: refs/'*) ;; @@ -444,15 +444,15 @@ then # a non-bare repository is always in separate-remote layout remote_top="refs/remotes/$origin" head_sha1= - test ! -r "$GIT_DIR/REMOTE_HEAD" || head_sha1=`cat "$GIT_DIR/REMOTE_HEAD"` + test ! -r "$GIT_DIR/REMOTE_HEAD" || head_sha1=$(cat "$GIT_DIR/REMOTE_HEAD") case "$head_sha1" in 'ref: refs/'*) # Uh-oh, the remote told us (http transport done against # new style repository with a symref HEAD). # Ideally we should skip the guesswork but for now # opt for minimum change. - head_sha1=`expr "z$head_sha1" : 'zref: refs/heads/\(.*\)'` - head_sha1=`cat "$GIT_DIR/$remote_top/$head_sha1"` + head_sha1=$(expr "z$head_sha1" : 'zref: refs/heads/\(.*\)') + head_sha1=$(cat "$GIT_DIR/$remote_top/$head_sha1") ;; esac @@ -467,7 +467,7 @@ then while read name do test t = $done && continue - branch_tip=`cat "$GIT_DIR/$remote_top/$name"` + branch_tip=$(cat "$GIT_DIR/$remote_top/$name") if test "$head_sha1" = "$branch_tip" then echo "$name" diff --git a/contrib/examples/git-commit.sh b/contrib/examples/git-commit.sh index 23ffb028d1..5cafe2eb77 100755 --- a/contrib/examples/git-commit.sh +++ b/contrib/examples/git-commit.sh @@ -91,7 +91,7 @@ signoff= force_author= only_include_assumed= untracked_files= -templatefile="`git config commit.template`" +templatefile="$(git config commit.template)" while test $# != 0 do case "$1" in @@ -280,7 +280,7 @@ case "$#,$also,$only,$amend" in 0,,,*) ;; *,,,*) - only_include_assumed="# Explicit paths specified without -i nor -o; assuming --only paths..." + only_include_assumed="# Explicit paths specified without -i or -o; assuming --only paths..." also= ;; esac @@ -350,7 +350,7 @@ t,) TMP_INDEX="$GIT_DIR/tmp-index$$" W= test -z "$initial_commit" && W=--with-tree=HEAD - commit_only=`git ls-files --error-unmatch $W -- "$@"` || exit + commit_only=$(git ls-files --error-unmatch $W -- "$@") || exit # Build a temporary index and update the real index # the same way. @@ -475,8 +475,8 @@ then fi if test '' != "$force_author" then - GIT_AUTHOR_NAME=`expr "z$force_author" : 'z\(.*[^ ]\) *<.*'` && - GIT_AUTHOR_EMAIL=`expr "z$force_author" : '.*\(<.*\)'` && + GIT_AUTHOR_NAME=$(expr "z$force_author" : 'z\(.*[^ ]\) *<.*') && + GIT_AUTHOR_EMAIL=$(expr "z$force_author" : '.*\(<.*\)') && test '' != "$GIT_AUTHOR_NAME" && test '' != "$GIT_AUTHOR_EMAIL" || die "malformed --author parameter" @@ -489,7 +489,7 @@ then rloga='commit' if [ -f "$GIT_DIR/MERGE_HEAD" ]; then rloga='commit (merge)' - PARENTS="-p HEAD "`sed -e 's/^/-p /' "$GIT_DIR/MERGE_HEAD"` + PARENTS="-p HEAD "$(sed -e 's/^/-p /' "$GIT_DIR/MERGE_HEAD") elif test -n "$amend"; then rloga='commit (amend)' PARENTS=$(git cat-file commit HEAD | diff --git a/contrib/examples/git-fetch.sh b/contrib/examples/git-fetch.sh index a314273bd5..554070909c 100755 --- a/contrib/examples/git-fetch.sh +++ b/contrib/examples/git-fetch.sh @@ -67,7 +67,7 @@ do keep='-k -k' ;; --depth=*) - shallow_depth="--depth=`expr "z$1" : 'z-[^=]*=\(.*\)'`" + shallow_depth="--depth=$(expr "z$1" : 'z-[^=]*=\(.*\)')" ;; --depth) shift @@ -262,12 +262,12 @@ fetch_per_ref () { http://* | https://* | ftp://*) test -n "$shallow_depth" && die "shallow clone with http not supported" - proto=`expr "$remote" : '\([^:]*\):'` + proto=$(expr "$remote" : '\([^:]*\):') if [ -n "$GIT_SSL_NO_VERIFY" ]; then curl_extra_args="-k" fi if [ -n "$GIT_CURL_FTP_NO_EPSV" -o \ - "`git config --bool http.noEPSV`" = true ]; then + "$(git config --bool http.noEPSV)" = true ]; then noepsv_opt="--disable-epsv" fi diff --git a/contrib/examples/git-ls-remote.sh b/contrib/examples/git-ls-remote.sh index fec70bbf88..2aa89a7df8 100755 --- a/contrib/examples/git-ls-remote.sh +++ b/contrib/examples/git-ls-remote.sh @@ -55,11 +55,11 @@ tmpdir=$tmp-d case "$peek_repo" in http://* | https://* | ftp://* ) if [ -n "$GIT_SSL_NO_VERIFY" -o \ - "`git config --bool http.sslVerify`" = false ]; then + "$(git config --bool http.sslVerify)" = false ]; then curl_extra_args="-k" fi if [ -n "$GIT_CURL_FTP_NO_EPSV" -o \ - "`git config --bool http.noEPSV`" = true ]; then + "$(git config --bool http.noEPSV)" = true ]; then curl_extra_args="${curl_extra_args} --disable-epsv" fi curl -nsf $curl_extra_args --header "Pragma: no-cache" "$peek_repo/info/refs" || diff --git a/contrib/examples/git-merge.sh b/contrib/examples/git-merge.sh index a5e42a9f01..7e40f40c78 100755 --- a/contrib/examples/git-merge.sh +++ b/contrib/examples/git-merge.sh @@ -341,7 +341,7 @@ case "$use_strategies" in '') case "$#" in 1) - var="`git config --get pull.twohead`" + var="$(git config --get pull.twohead)" if test -n "$var" then use_strategies="$var" @@ -349,7 +349,7 @@ case "$use_strategies" in use_strategies="$default_twohead_strategies" fi ;; *) - var="`git config --get pull.octopus`" + var="$(git config --get pull.octopus)" if test -n "$var" then use_strategies="$var" diff --git a/contrib/examples/git-repack.sh b/contrib/examples/git-repack.sh index 757933174e..f312405a25 100755 --- a/contrib/examples/git-repack.sh +++ b/contrib/examples/git-repack.sh @@ -49,7 +49,7 @@ do shift done -case "`git config --bool repack.usedeltabaseoffset || echo true`" in +case "$(git config --bool repack.usedeltabaseoffset || echo true)" in true) extra="$extra --delta-base-offset" ;; esac diff --git a/contrib/examples/git-reset.sh b/contrib/examples/git-reset.sh index bafeb52cd1..cb1bbf3b90 100755 --- a/contrib/examples/git-reset.sh +++ b/contrib/examples/git-reset.sh @@ -40,7 +40,7 @@ case "$1" in --) shift ;; esac # git reset --mixed tree [--] paths... can be used to # load chosen paths from the tree into the index without -# affecting the working tree nor HEAD. +# affecting the working tree or HEAD. if test $# != 0 then test "$reset_type" = "--mixed" || @@ -60,7 +60,7 @@ then update=-u fi -# Soft reset does not touch the index file nor the working tree +# Soft reset does not touch the index file or the working tree # at all, but requires them in a good order. Other resets reset # the index file to the tree object we are switching to. if test "$reset_type" = "--soft" diff --git a/contrib/examples/git-resolve.sh b/contrib/examples/git-resolve.sh index 8f98142f77..48d0fc971f 100755 --- a/contrib/examples/git-resolve.sh +++ b/contrib/examples/git-resolve.sh @@ -75,7 +75,7 @@ case "$common" in GIT_INDEX_FILE=$G git read-tree -m $c $head $merge \ 2>/dev/null || continue # Count the paths that are unmerged. - cnt=`GIT_INDEX_FILE=$G git ls-files --unmerged | wc -l` + cnt=$(GIT_INDEX_FILE=$G git ls-files --unmerged | wc -l) if test $best_cnt -le 0 -o $cnt -le $best_cnt then best=$c diff --git a/contrib/examples/git-revert.sh b/contrib/examples/git-revert.sh index 6bf155cbdb..7e2aad5491 100755 --- a/contrib/examples/git-revert.sh +++ b/contrib/examples/git-revert.sh @@ -137,7 +137,7 @@ cherry-pick) q }' - logmsg=`git show -s --pretty=raw --encoding="$encoding" "$commit"` + logmsg=$(git show -s --pretty=raw --encoding="$encoding" "$commit") set_author_env=`echo "$logmsg" | LANG=C LC_ALL=C sed -ne "$pick_author_script"` eval "$set_author_env" diff --git a/contrib/examples/git-tag.sh b/contrib/examples/git-tag.sh index 2c15bc955b..1bd8f3c58d 100755 --- a/contrib/examples/git-tag.sh +++ b/contrib/examples/git-tag.sh @@ -156,7 +156,7 @@ prev=0000000000000000000000000000000000000000 if git show-ref --verify --quiet -- "refs/tags/$name" then test -n "$force" || die "tag '$name' already exists" - prev=`git rev-parse "refs/tags/$name"` + prev=$(git rev-parse "refs/tags/$name") fi shift git check-ref-format "tags/$name" || diff --git a/contrib/examples/git-whatchanged.sh b/contrib/examples/git-whatchanged.sh index 1fb9feb348..2edbdc6d99 100755 --- a/contrib/examples/git-whatchanged.sh +++ b/contrib/examples/git-whatchanged.sh @@ -9,12 +9,12 @@ case "$0" in *whatchanged) count= test -z "$diff_tree_flags" && - diff_tree_flags=$(git-repo-config --get whatchanged.difftree) + diff_tree_flags=$(git config --get whatchanged.difftree) diff_tree_default_flags='-c -M --abbrev' ;; *show) count=-n1 test -z "$diff_tree_flags" && - diff_tree_flags=$(git-repo-config --get show.difftree) + diff_tree_flags=$(git config --get show.difftree) diff_tree_default_flags='--cc --always' ;; esac test -z "$diff_tree_flags" && |