commit - 92845f0980b93eaf2ac1688899791f74af66a521
commit + 8642913bb1bf2956d44d201e77b88c2b67b7c44d
blob - a52ad3f5f3953de8ae74d10f7a9f2b3d9f880cc1
blob + 709d4ccef8fe3657aabd7178ce86cd34b6abd820
--- regress/cmdline/blame.sh
+++ regress/cmdline/blame.sh
local wt="$testroot/wt"
local id=$(git_show_head "$repo")
- set -A ids "$(trim_obj_id 32 $id)"
+ set -- "$(trim_obj_id 32 $id)"
# :base requires work tree
echo "got: '-c :base' requires work tree" > "$testroot/stderr.expected"
fi
id=$(git_show_head "$repo")
- set -- "$ids" "$(trim_obj_id 32 $id)"
- ids=$*
+ set -- "$@" "$(trim_obj_id 32 $id)"
done
local author_time=$(git_show_author_time "$repo")
local d=$(date -u -r $author_time +"%G-%m-%d")
got blame -r "$repo" -c:head:-8 alpha > "$testroot/stdout"
- echo "1) $(pop_id 1 $ids) $d $GOT_AUTHOR_8 alpha" > \
+ echo "1) $(pop_idx 1 $@) $d $GOT_AUTHOR_8 alpha" > \
"$testroot/stdout.expected"
cmp -s $testroot/stdout.expected $testroot/stdout
(cd "$wt" && got blame -cmaster:-5 alpha > "$testroot/stdout")
- echo "1) $(pop_id 2 $ids) $d $GOT_AUTHOR_8 change 1" > \
+ echo "1) $(pop_idx 2 $@) $d $GOT_AUTHOR_8 change 1" > \
"$testroot/stdout.expected"
- echo "2) $(pop_id 3 $ids) $d $GOT_AUTHOR_8 change 2" >> \
+ echo "2) $(pop_idx 3 $@) $d $GOT_AUTHOR_8 change 2" >> \
"$testroot/stdout.expected"
- echo "3) $(pop_id 4 $ids) $d $GOT_AUTHOR_8 change 3" >> \
+ echo "3) $(pop_idx 4 $@) $d $GOT_AUTHOR_8 change 3" >> \
"$testroot/stdout.expected"
cmp -s $testroot/stdout.expected $testroot/stdout
(cd "$wt" && got blame -c:head:-4 alpha > "$testroot/stdout")
- echo "1) $(pop_id 2 $ids) $d $GOT_AUTHOR_8 change 1" > \
+ echo "1) $(pop_idx 2 $@) $d $GOT_AUTHOR_8 change 1" > \
"$testroot/stdout.expected"
- echo "2) $(pop_id 3 $ids) $d $GOT_AUTHOR_8 change 2" >> \
+ echo "2) $(pop_idx 3 $@) $d $GOT_AUTHOR_8 change 2" >> \
"$testroot/stdout.expected"
- echo "3) $(pop_id 4 $ids) $d $GOT_AUTHOR_8 change 3" >> \
+ echo "3) $(pop_idx 4 $@) $d $GOT_AUTHOR_8 change 3" >> \
"$testroot/stdout.expected"
- echo "4) $(pop_id 5 $ids) $d $GOT_AUTHOR_8 change 4" >> \
+ echo "4) $(pop_idx 5 $@) $d $GOT_AUTHOR_8 change 4" >> \
"$testroot/stdout.expected"
cmp -s $testroot/stdout.expected $testroot/stdout
(cd "$wt" && got up -c:head:-8 > /dev/null)
(cd "$wt" && got blame -c:base:+5 alpha > "$testroot/stdout")
- echo "1) $(pop_id 2 $ids) $d $GOT_AUTHOR_8 change 1" > \
+ echo "1) $(pop_idx 2 $@) $d $GOT_AUTHOR_8 change 1" > \
"$testroot/stdout.expected"
- echo "2) $(pop_id 3 $ids) $d $GOT_AUTHOR_8 change 2" >> \
+ echo "2) $(pop_idx 3 $@) $d $GOT_AUTHOR_8 change 2" >> \
"$testroot/stdout.expected"
- echo "3) $(pop_id 4 $ids) $d $GOT_AUTHOR_8 change 3" >> \
+ echo "3) $(pop_idx 4 $@) $d $GOT_AUTHOR_8 change 3" >> \
"$testroot/stdout.expected"
- echo "4) $(pop_id 5 $ids) $d $GOT_AUTHOR_8 change 4" >> \
+ echo "4) $(pop_idx 5 $@) $d $GOT_AUTHOR_8 change 4" >> \
"$testroot/stdout.expected"
- echo "5) $(pop_id 6 $ids) $d $GOT_AUTHOR_8 change 5" >> \
+ echo "5) $(pop_idx 6 $@) $d $GOT_AUTHOR_8 change 5" >> \
"$testroot/stdout.expected"
cmp -s $testroot/stdout.expected $testroot/stdout
blob - 4bc9143544d7cac2ae3c847fbeb41f48e55a1f0a
blob + 5ded37bff3fc54893ebb5730937274ffb904a1e1
--- regress/cmdline/branch.sh
+++ regress/cmdline/branch.sh
test_branch_commit_keywords() {
local testroot=$(test_init branch_commit_keywords)
- set -A ids "$(git_show_head $testroot/repo)"
+ set -- "$(git_show_head $testroot/repo)"
got checkout $testroot/repo $testroot/wt > /dev/null
ret=$?
test_done "$testroot" "$ret"
return 1
fi
- set -- "$ids" "$(git_show_head $testroot/repo)"
- ids=$*
+ set -- "$@" "$(git_show_head $testroot/repo)"
done
(cd "$testroot/wt" && got up > /dev/null)
- echo " kwbranch: $(pop_id 3 $ids)" > $testroot/stdout.expected
- echo " master: $(pop_id 5 $ids)" >> $testroot/stdout.expected
+ echo " kwbranch: $(pop_idx 3 $@)" > $testroot/stdout.expected
+ echo " master: $(pop_idx 5 $@)" >> $testroot/stdout.expected
(cd "$testroot/wt" && got br -nc :head:-2 kwbranch > /dev/null)
got br -r "$testroot/repo" -l > "$testroot/stdout"
return 1
fi
- echo " kwbranch2: $(pop_id 4 $ids)" > $testroot/stdout.expected
+ echo " kwbranch2: $(pop_idx 4 $@)" > $testroot/stdout.expected
got br -r "$testroot/repo" -c master:- kwbranch2 > /dev/null
got br -r "$testroot/repo" -l | grep kwbranch2 > "$testroot/stdout"
blob - 4b561d845788314e3f478551421310e1934634f2
blob + 5a8e3fca28fe70ffe66034d95186576fce8f8100
--- regress/cmdline/cat.sh
+++ regress/cmdline/cat.sh
local delta_id=$(got tree -r "$repo" -i gamma | \
grep 'delta$' | cut -d' ' -f 1)
- set -- "$delta_ids" "$delta_id"
- delta_ids=$*
+ set -- "$@" "$delta_id"
done
# cat blob by path
fi
# cat tree by path
- echo "$(pop_id 4 $delta_ids) 0100644 delta" > \
+ echo "$(pop_idx 4 $@) 0100644 delta" > \
"$testroot/stdout.expected"
(cd "$wt" && got cat -c:base:-4 gamma > "$testroot/stdout")
cmp -s "$testroot/stdout.expected" "$testroot/stdout"
blob - 9bdce2b8a07cd2893ca474983afc996ca236d190
blob + 993c64afcbd5f4598770774738e513c4afb9387c
--- regress/cmdline/checkout.sh
+++ regress/cmdline/checkout.sh
test_checkout_commit_keywords() {
local testroot=$(test_init checkout_commit_keywords)
- set -A ids "$(git_show_head $testroot/repo)"
+ set -- "$(git_show_head $testroot/repo)"
got checkout $testroot/repo $testroot/wt > /dev/null
ret=$?
test_done "$testroot" "$ret"
return 1
fi
- set -- "$ids" "$(git_show_head $testroot/repo)"
- ids=$*
+ set -- "$@" "$(git_show_head $testroot/repo)"
done
echo "A $testroot/wt2/alpha" > $testroot/stdout.expected
echo "A $testroot/wt2/beta" >> $testroot/stdout.expected
echo "A $testroot/wt2/epsilon/zeta" >> $testroot/stdout.expected
echo "A $testroot/wt2/gamma/delta" >> $testroot/stdout.expected
- echo "Checked out refs/heads/master: $(pop_id 4 $ids)" \
+ echo "Checked out refs/heads/master: $(pop_idx 4 $@)" \
>> $testroot/stdout.expected
echo "Now shut up and hack" >> $testroot/stdout.expected
echo "A $testroot/wt3/beta" >> $testroot/stdout.expected
echo "A $testroot/wt3/epsilon/zeta" >> $testroot/stdout.expected
echo "A $testroot/wt3/gamma/delta" >> $testroot/stdout.expected
- echo "Checked out refs/heads/master: $(pop_id 4 $ids)" \
+ echo "Checked out refs/heads/master: $(pop_idx 4 $@)" \
>> $testroot/stdout.expected
echo "Now shut up and hack" >> $testroot/stdout.expected
blob - 8de61842e9e87808d61b276b6d639e2f1b7d5e09
blob + 01c492937e9b0b533e2d98b5ab40a43cf5e03129
--- regress/cmdline/cherrypick.sh
+++ regress/cmdline/cherrypick.sh
test_cherrypick_commit_keywords() {
local testroot=`test_init cherrypick_commit_keywords`
- set -A ids "$(git_show_head $testroot/repo)"
+ set -- "$(git_show_head $testroot/repo)"
(cd $testroot/repo && git checkout -q -b branch-1)
echo "changed on branch-1" >> "$testroot/repo/alpha"
git_commit $testroot/repo -m "alpha changed on branch-1"
- set -- "$ids" "$(git_show_head $testroot/repo)"
- ids=$*
+ set -- "$@" "$(git_show_head $testroot/repo)"
for i in $(seq 4); do
echo "branch-1 change $i" >> "$testroot/repo/gamma/delta"
git_commit $testroot/repo -m "commit number $i"
- set -- "$ids" "$(git_show_head $testroot/repo)"
- ids=$*
+ set -- "$@" "$(git_show_head $testroot/repo)"
done
echo "G alpha" > $testroot/stdout.expected
- echo "Merged commit $(pop_id 2 $ids)" >> $testroot/stdout.expected
+ echo "Merged commit $(pop_idx 2 $@)" >> $testroot/stdout.expected
(cd "$testroot/wt" && got cy master:+ > $testroot/stdout)
ret=$?
(cd "$testroot/wt" && got rv alpha > /dev/null)
echo "C gamma/delta" > $testroot/stdout.expected
- echo "Merged commit $(pop_id 5 $ids)" >> $testroot/stdout.expected
+ echo "Merged commit $(pop_idx 5 $@)" >> $testroot/stdout.expected
echo "Files with new merge conflicts: 1" >> $testroot/stdout.expected
(cd "$testroot/wt" && got cy branch-1:- > $testroot/stdout)
blob - b2a87a49a5886634e759140de82dec6cb7fd5d8d
blob + 1953bc200e17164aa10a916bace8f33f989e2f20
--- regress/cmdline/common.sh
+++ regress/cmdline/common.sh
echo ${id%$pat}
}
-pop_id()
+pop_idx()
{
shift "$1"
printf '%s' "${1:-index-out-of-bounds}"
blob - c4c9f0b2ff7a958007c590e9b66a21cb9ad13a07
blob + 40d362b35f6816f824c7f4f341e1ec65900ed41e
--- regress/cmdline/diff.sh
+++ regress/cmdline/diff.sh
test_diff_commit_keywords() {
local testroot=`test_init diff_commit_keywords`
+ local repo="$testroot/repo"
+ local wt="$testroot/wt"
got checkout $testroot/repo $testroot/wt > /dev/null
ret=$?
return 1
fi
- set -A ids "$(git_show_head $testroot/repo)"
- set -A alpha_ids "$(get_blob_id $testroot/repo "" alpha)"
- set -A beta_ids "$(get_blob_id $testroot/repo "" beta)"
+ set -- "$(git_show_head $repo)"
+ local alpha_ids="$(get_blob_id "$repo" "" alpha)"
+ local beta_ids="$(get_blob_id "$repo" "" beta)"
for i in `seq 8`; do
if [ $(( i % 2 )) -eq 0 ]; then
fi
if [ $(( i % 2 )) -eq 0 ]; then
- set -- "$alpha_ids" \
- "$(get_blob_id $testroot/repo "" alpha)"
- alpha_ids=$*
+ alpha_ids="$alpha_ids $(get_blob_id "$repo" "" alpha)"
else
- set -- "$beta_ids" \
- "$(get_blob_id $testroot/repo "" beta)"
- beta_ids=$*
+ beta_ids="$beta_ids $(get_blob_id "$repo" "" beta)"
fi
- set -- "$ids" "$(git_show_head $testroot/repo)"
- ids=$*
+ set -- "$@" "$(git_show_head $repo)"
done
- echo "diff $(pop_id 7 $ids) $(pop_id 8 $ids)" > \
+ echo "diff $(pop_idx 7 $@) $(pop_idx 8 $@)" > \
$testroot/stdout.expected
- echo "commit - $(pop_id 7 $ids)" >> $testroot/stdout.expected
- echo "commit + $(pop_id 8 $ids)" >> $testroot/stdout.expected
- echo "blob - $(pop_id 4 $beta_ids)" >> $testroot/stdout.expected
- echo "blob + $(pop_id 5 $beta_ids)" >> $testroot/stdout.expected
+ echo "commit - $(pop_idx 7 $@)" >> $testroot/stdout.expected
+ echo "commit + $(pop_idx 8 $@)" >> $testroot/stdout.expected
+ echo "blob - $(pop_idx 4 $beta_ids)" >> $testroot/stdout.expected
+ echo "blob + $(pop_idx 5 $beta_ids)" >> $testroot/stdout.expected
echo '--- beta' >> $testroot/stdout.expected
echo '+++ beta' >> $testroot/stdout.expected
echo '@@ -1 +1 @@' >> $testroot/stdout.expected
return 1
fi
- echo "diff $(pop_id 1 $ids) $(pop_id 2 $ids)" > \
+ echo "diff $(pop_idx 1 $@) $(pop_idx 2 $@)" > \
$testroot/stdout.expected
- echo "commit - $(pop_id 1 $ids)" >> $testroot/stdout.expected
- echo "commit + $(pop_id 2 $ids)" >> $testroot/stdout.expected
- echo "blob - $(pop_id 1 $beta_ids)" >> $testroot/stdout.expected
- echo "blob + $(pop_id 2 $beta_ids)" >> $testroot/stdout.expected
+ echo "commit - $(pop_idx 1 $@)" >> $testroot/stdout.expected
+ echo "commit + $(pop_idx 2 $@)" >> $testroot/stdout.expected
+ echo "blob - $(pop_idx 1 $beta_ids)" >> $testroot/stdout.expected
+ echo "blob + $(pop_idx 2 $beta_ids)" >> $testroot/stdout.expected
echo '--- beta' >> $testroot/stdout.expected
echo '+++ beta' >> $testroot/stdout.expected
echo '@@ -1 +1 @@' >> $testroot/stdout.expected
return 1
fi
- echo "diff $(pop_id 3 $ids) $(pop_id 4 $ids)" > \
+ echo "diff $(pop_idx 3 $@) $(pop_idx 4 $@)" > \
$testroot/stdout.expected
- echo "commit - $(pop_id 3 $ids)" >> $testroot/stdout.expected
- echo "commit + $(pop_id 4 $ids)" >> $testroot/stdout.expected
- echo "blob - $(pop_id 2 $beta_ids)" >> $testroot/stdout.expected
- echo "blob + $(pop_id 3 $beta_ids)" >> $testroot/stdout.expected
+ echo "commit - $(pop_idx 3 $@)" >> $testroot/stdout.expected
+ echo "commit + $(pop_idx 4 $@)" >> $testroot/stdout.expected
+ echo "blob - $(pop_idx 2 $beta_ids)" >> $testroot/stdout.expected
+ echo "blob + $(pop_idx 3 $beta_ids)" >> $testroot/stdout.expected
echo '--- beta' >> $testroot/stdout.expected
echo '+++ beta' >> $testroot/stdout.expected
echo '@@ -1 +1 @@' >> $testroot/stdout.expected
fi
# if modifier extends beyond HEAD, we should use HEAD ref
- echo "diff $(pop_id 8 $ids) $(pop_id 9 $ids)" > \
+ echo "diff $(pop_idx 8 $@) $(pop_idx 9 $@)" > \
$testroot/stdout.expected
- echo "commit - $(pop_id 8 $ids)" >> $testroot/stdout.expected
- echo "commit + $(pop_id 9 $ids)" >> $testroot/stdout.expected
- echo "blob - $(pop_id 4 $alpha_ids)" >> $testroot/stdout.expected
- echo "blob + $(pop_id 5 $alpha_ids)" >> $testroot/stdout.expected
+ echo "commit - $(pop_idx 8 $@)" >> $testroot/stdout.expected
+ echo "commit + $(pop_idx 9 $@)" >> $testroot/stdout.expected
+ echo "blob - $(pop_idx 4 $alpha_ids)" >> $testroot/stdout.expected
+ echo "blob + $(pop_idx 5 $alpha_ids)" >> $testroot/stdout.expected
echo '--- alpha' >> $testroot/stdout.expected
echo '+++ alpha' >> $testroot/stdout.expected
echo '@@ -1 +1 @@' >> $testroot/stdout.expected
return 1
fi
- echo "diff $(pop_id 3 $ids) $(pop_id 9 $ids)" > \
+ echo "diff $(pop_idx 3 $@) $(pop_idx 9 $@)" > \
$testroot/stdout.expected
- echo "commit - $(pop_id 3 $ids)" >> $testroot/stdout.expected
- echo "commit + $(pop_id 9 $ids)" >> $testroot/stdout.expected
- echo "blob - $(pop_id 2 $alpha_ids)" >> $testroot/stdout.expected
- echo "blob + $(pop_id 5 $alpha_ids)" >> $testroot/stdout.expected
+ echo "commit - $(pop_idx 3 $@)" >> $testroot/stdout.expected
+ echo "commit + $(pop_idx 9 $@)" >> $testroot/stdout.expected
+ echo "blob - $(pop_idx 2 $alpha_ids)" >> $testroot/stdout.expected
+ echo "blob + $(pop_idx 5 $alpha_ids)" >> $testroot/stdout.expected
echo '--- alpha' >> $testroot/stdout.expected
echo '+++ alpha' >> $testroot/stdout.expected
echo '@@ -1 +1 @@' >> $testroot/stdout.expected
echo '-alpha change 2' >> $testroot/stdout.expected
echo '+alpha change 8' >> $testroot/stdout.expected
- echo "blob - $(pop_id 2 $beta_ids)" >> $testroot/stdout.expected
- echo "blob + $(pop_id 5 $beta_ids)" >> $testroot/stdout.expected
+ echo "blob - $(pop_idx 2 $beta_ids)" >> $testroot/stdout.expected
+ echo "blob + $(pop_idx 5 $beta_ids)" >> $testroot/stdout.expected
echo '--- beta' >> $testroot/stdout.expected
echo '+++ beta' >> $testroot/stdout.expected
echo '@@ -1 +1 @@' >> $testroot/stdout.expected
return 1
fi
- echo "diff $(pop_id 6 $ids) $(pop_id 8 $ids)" > \
+ echo "diff $(pop_idx 6 $@) $(pop_idx 8 $@)" > \
$testroot/stdout.expected
- echo "commit - $(pop_id 6 $ids)" >> $testroot/stdout.expected
- echo "commit + $(pop_id 8 $ids)" >> $testroot/stdout.expected
- echo "blob - $(pop_id 3 $alpha_ids)" >> $testroot/stdout.expected
- echo "blob + $(pop_id 4 $alpha_ids)" >> $testroot/stdout.expected
+ echo "commit - $(pop_idx 6 $@)" >> $testroot/stdout.expected
+ echo "commit + $(pop_idx 8 $@)" >> $testroot/stdout.expected
+ echo "blob - $(pop_idx 3 $alpha_ids)" >> $testroot/stdout.expected
+ echo "blob + $(pop_idx 4 $alpha_ids)" >> $testroot/stdout.expected
echo '--- alpha' >> $testroot/stdout.expected
echo '+++ alpha' >> $testroot/stdout.expected
echo '@@ -1 +1 @@' >> $testroot/stdout.expected
echo '-alpha change 4' >> $testroot/stdout.expected
echo '+alpha change 6' >> $testroot/stdout.expected
- echo "blob - $(pop_id 4 $beta_ids)" >> $testroot/stdout.expected
- echo "blob + $(pop_id 5 $beta_ids)" >> $testroot/stdout.expected
+ echo "blob - $(pop_idx 4 $beta_ids)" >> $testroot/stdout.expected
+ echo "blob + $(pop_idx 5 $beta_ids)" >> $testroot/stdout.expected
echo '--- beta' >> $testroot/stdout.expected
echo '+++ beta' >> $testroot/stdout.expected
echo '@@ -1 +1 @@' >> $testroot/stdout.expected
blob - 58e79bdb23ae3a08aa668ad20b439963c6eda8d1
blob + e2f69ad6bfabb6d873c7f6e79c7277eb9552ff14
--- regress/cmdline/log.sh
+++ regress/cmdline/log.sh
local commit_time=`git_show_author_time $testroot/repo`
local d=`date -u -r $commit_time +"%G-%m-%d"`
- set -A ids "$(git_show_head $testroot/repo)"
+ set -- "$(git_show_head $testroot/repo)"
got checkout $testroot/repo $testroot/wt > /dev/null
ret=$?
test_done "$testroot" "$ret"
return 1
fi
- set -- "$ids" "$(git_show_head $testroot/repo)"
- ids=$*
+ set -- "$@" "$(git_show_head $testroot/repo)"
done
for i in $(seq 16 2); do
printf '%s %.7s commit number %s\n' \
- "$d" $(pop_id $i $ids) "$(( i-1 ))" \
+ "$d" $(pop_idx $i $@) "$(( i-1 ))" \
>> $testroot/stdout.expected
done
for i in $(seq 9 2); do
printf '%s %.7s commit number %s\n' \
- "$d" $(pop_id $i $ids) "$(( i-1 ))" \
+ "$d" $(pop_idx $i $@) "$(( i-1 ))" \
>> $testroot/stdout.expected
done
- printf '%s %.7s adding the test tree\n' "$d" $(pop_id 1 $ids) >> \
+ printf '%s %.7s adding the test tree\n' "$d" $(pop_idx 1 $@) >> \
$testroot/stdout.expected
(cd $testroot/wt && got log -sc:base > $testroot/stdout)
# if + modifier is too great, use HEAD commit
printf '%s %-7s commit number %s\n' "$d" master 16 > \
$testroot/stdout.expected
- printf '%s %.7s commit number %s\n' "$d" $(pop_id 16 $ids) 15 >> \
+ printf '%s %.7s commit number %s\n' "$d" $(pop_idx 16 $@) 15 >> \
$testroot/stdout.expected
(cd $testroot/wt && got log -sc:base:+20 -l2 > $testroot/stdout)
fi
# if - modifier is too great, use root commit
- printf '%s %.7s adding the test tree\n' "$d" $(pop_id 1 $ids) > \
+ printf '%s %.7s adding the test tree\n' "$d" $(pop_idx 1 $@) > \
$testroot/stdout.expected
(cd $testroot/wt && got log -sc:base:-10 > $testroot/stdout)
return 1
fi
- got br -r "$testroot/repo" -c $(pop_id 1 $ids) base+
+ got br -r "$testroot/repo" -c $(pop_idx 1 $@) base+
- printf '%s %.7s commit number 1\n' "$d" $(pop_id 2 $ids) > \
+ printf '%s %.7s commit number 1\n' "$d" $(pop_idx 2 $@) > \
$testroot/stdout.expected
(cd $testroot/wt && got log -scbase+:+ -l1 > $testroot/stdout)
return 1
fi
- got br -r "$testroot/repo" -c $(pop_id 3 $ids) head-1
+ got br -r "$testroot/repo" -c $(pop_idx 3 $@) head-1
- printf '%s %.7s commit number 1\n' "$d" $(pop_id 2 $ids) > \
+ printf '%s %.7s commit number 1\n' "$d" $(pop_idx 2 $@) > \
$testroot/stdout.expected
(cd $testroot/wt && got log -schead-1:- -l1 > $testroot/stdout)
return 1
fi
- got br -r "$testroot/repo" -c $(pop_id 16 $ids) base-1+2
+ got br -r "$testroot/repo" -c $(pop_idx 16 $@) base-1+2
- printf '%s %.7s commit number 12\n' "$d" $(pop_id 13 $ids) > \
+ printf '%s %.7s commit number 12\n' "$d" $(pop_idx 13 $@) > \
$testroot/stdout.expected
(cd $testroot/wt && got log -scbase-1+2:-3 -l1 > $testroot/stdout)
blob - 40d49081040f0fd5396d77e82ad19b2f5c960858
blob + 0dcbb993cdc019b50ced407fa75909e73e435526
--- regress/cmdline/ref.sh
+++ regress/cmdline/ref.sh
return 1
fi
- set -- "$ids" "$(git_show_head $repo)"
- ids=$*
+ set -- "$@" "$(git_show_head $repo)"
done
(cd "$wt" && got ref -c:head:-4 refs/heads/head-4)
echo "HEAD: refs/heads/master" > $testroot/stdout.expected
echo -n "refs/got/worktree/base-" >> $testroot/stdout.expected
cat "$wt/.got/uuid" | tr -d '\n' >> $testroot/stdout.expected
- echo ": $(pop_id 4 $ids)" >> $testroot/stdout.expected
- echo "refs/heads/base+2: $(pop_id 6 $ids)" >> $testroot/stdout.expected
- echo "refs/heads/head-4: $(pop_id 4 $ids)" >> $testroot/stdout.expected
- echo "refs/heads/master: $(pop_id 8 $ids)" >> $testroot/stdout.expected
- echo "refs/heads/master-: $(pop_id 7 $ids)" >> $testroot/stdout.expected
+ echo ": $(pop_idx 4 $@)" >> $testroot/stdout.expected
+ echo "refs/heads/base+2: $(pop_idx 6 $@)" >> $testroot/stdout.expected
+ echo "refs/heads/head-4: $(pop_idx 4 $@)" >> $testroot/stdout.expected
+ echo "refs/heads/master: $(pop_idx 8 $@)" >> $testroot/stdout.expected
+ echo "refs/heads/master-: $(pop_idx 7 $@)" >> $testroot/stdout.expected
got ref -r "$repo" -l > $testroot/stdout
cmp -s $testroot/stdout $testroot/stdout.expected
blob - 9c979ff35454c34d02151d8a65d66ad2cdf10d86
blob + 812f69b2eacd6f0c5c490042706348d24de55019
--- regress/cmdline/update.sh
+++ regress/cmdline/update.sh
test_update_commit_keywords() {
local testroot=`test_init update_commit_keywords`
- set -A ids "$(git_show_head $testroot/repo)"
+ set -- "$(git_show_head $testroot/repo)"
got checkout $testroot/repo $testroot/wt > /dev/null
ret=$?
test_done "$testroot" "$ret"
return 1
fi
- set -- "$ids" "$(git_show_head $testroot/repo)"
- ids=$*
+ set -- "$@" "$(git_show_head $testroot/repo)"
done
echo "got: reference base not found" > $testroot/stderr.expected
echo "U alpha" > $testroot/stdout.expected
echo "U beta" >> $testroot/stdout.expected
echo -n "Updated to refs/heads/master: " >> $testroot/stdout.expected
- echo $(pop_id 7 $ids) >> "$testroot/stdout.expected"
+ echo $(pop_idx 7 $@) >> "$testroot/stdout.expected"
(cd $testroot/wt && got update -c:base:-2 > $testroot/stdout)
ret=$?
echo "U beta" > $testroot/stdout.expected
echo -n "Updated to refs/heads/master: " >> $testroot/stdout.expected
- echo $(pop_id 8 $ids) >> "$testroot/stdout.expected"
+ echo $(pop_idx 8 $@) >> "$testroot/stdout.expected"
(cd $testroot/wt && got update -cmaster:- > $testroot/stdout)
ret=$?
echo "U alpha" > $testroot/stdout.expected
echo "U beta" >> $testroot/stdout.expected
echo -n "Updated to refs/heads/master: " >> $testroot/stdout.expected
- echo $(pop_id 2 $ids) >> "$testroot/stdout.expected"
+ echo $(pop_idx 2 $@) >> "$testroot/stdout.expected"
(cd $testroot/wt && got update -c:base:-6 > $testroot/stdout)
ret=$?
echo "U alpha" > $testroot/stdout.expected
echo -n "Updated to refs/heads/master: " >> $testroot/stdout.expected
- echo $(pop_id 3 $ids) >> "$testroot/stdout.expected"
+ echo $(pop_idx 3 $@) >> "$testroot/stdout.expected"
(cd $testroot/wt && got update -c:base:+ > $testroot/stdout)
ret=$?
echo "U alpha" > $testroot/stdout.expected
echo "U beta" >> $testroot/stdout.expected
echo -n "Updated to refs/heads/master: " >> $testroot/stdout.expected
- echo $(pop_id 7 $ids) >> "$testroot/stdout.expected"
+ echo $(pop_idx 7 $@) >> "$testroot/stdout.expected"
(cd $testroot/wt && got update -c:head:-2 > $testroot/stdout)
ret=$?
echo "U alpha" > $testroot/stdout.expected
echo "U beta" >> $testroot/stdout.expected
echo -n "Updated to refs/heads/master: " >> $testroot/stdout.expected
- echo $(pop_id 1 $ids) >> "$testroot/stdout.expected"
+ echo $(pop_idx 1 $@) >> "$testroot/stdout.expected"
(cd $testroot/wt && got update -c:base:-20 > $testroot/stdout)
ret=$?
echo "U alpha" > $testroot/stdout.expected
echo "U beta" >> $testroot/stdout.expected
echo -n "Updated to refs/heads/master: " >> $testroot/stdout.expected
- echo $(pop_id 9 $ids) >> "$testroot/stdout.expected"
+ echo $(pop_idx 9 $@) >> "$testroot/stdout.expected"
(cd $testroot/wt && got update -c:head:+10 > $testroot/stdout)
ret=$?
blob - a329dca28bf36978b73b04fe71d37578bfbc712f
blob + 9f57e1d06d86371e2c8f959955561a8b2d951823
--- regress/tog/blame.sh
+++ regress/tog/blame.sh
local author_time=$(git_show_author_time "$repo")
local ymd=$(date -u -r $author_time +"%G-%m-%d")
- set -A ids "$id"
- set -A short_ids "$(trim_obj_id 32 $id)"
+ set -- "$id"
cat <<-EOF >$TOG_TEST_SCRIPT
WAIT_FOR_UI wait for blame to finish
cat <<-EOF >$testroot/view.expected
commit $id
[1/1] /alpha
- $(pop_id 1 $short_ids) alpha
+ $(trim_obj_id 32 $(pop_idx 1 $@)) alpha
fi
id=$(git_show_head "$repo")
- set -- "$ids" "$id"
- ids=$*
- set -- "$short_ids" "$(trim_obj_id 32 $id)"
- short_ids=$*
+ set -- "$@" "$id"
done
author_time=$(git_show_author_time "$repo")
# :base:- keyword in work tree
cat <<-EOF >$testroot/view.expected
- commit $(pop_id 8 $ids)
+ commit $(pop_idx 8 $@)
[1/7] /alpha
- $(pop_id 2 $short_ids) alpha 1
- $(pop_id 3 $short_ids) alpha 2
- $(pop_id 4 $short_ids) alpha 3
- $(pop_id 5 $short_ids) alpha 4
- $(pop_id 6 $short_ids) alpha 5
- $(pop_id 7 $short_ids) alpha 6
- $(pop_id 8 $short_ids) alpha 7
+ $(trim_obj_id 32 $(pop_idx 2 $@)) alpha 1
+ $(trim_obj_id 32 $(pop_idx 3 $@)) alpha 2
+ $(trim_obj_id 32 $(pop_idx 4 $@)) alpha 3
+ $(trim_obj_id 32 $(pop_idx 5 $@)) alpha 4
+ $(trim_obj_id 32 $(pop_idx 6 $@)) alpha 5
+ $(trim_obj_id 32 $(pop_idx 7 $@)) alpha 6
+ $(trim_obj_id 32 $(pop_idx 8 $@)) alpha 7
EOF
# :head:-4 keyword in work tree
cat <<-EOF >$testroot/view.expected
- commit $(pop_id 5 $ids)
+ commit $(pop_idx 5 $@)
[1/4] /alpha
- $(pop_id 2 $short_ids) alpha 1
- $(pop_id 3 $short_ids) alpha 2
- $(pop_id 4 $short_ids) alpha 3
- $(pop_id 5 $short_ids) alpha 4
+ $(trim_obj_id 32 $(pop_idx 2 $@)) alpha 1
+ $(trim_obj_id 32 $(pop_idx 3 $@)) alpha 2
+ $(trim_obj_id 32 $(pop_idx 4 $@)) alpha 3
+ $(trim_obj_id 32 $(pop_idx 5 $@)) alpha 4
# :base:+2 keyword in work tree
cat <<-EOF >$testroot/view.expected
- commit $(pop_id 5 $ids)
+ commit $(pop_idx 5 $@)
[1/4] /alpha
- $(pop_id 2 $short_ids) alpha 1
- $(pop_id 3 $short_ids) alpha 2
- $(pop_id 4 $short_ids) alpha 3
- $(pop_id 5 $short_ids) alpha 4
+ $(trim_obj_id 32 $(pop_idx 2 $@)) alpha 1
+ $(trim_obj_id 32 $(pop_idx 3 $@)) alpha 2
+ $(trim_obj_id 32 $(pop_idx 4 $@)) alpha 3
+ $(trim_obj_id 32 $(pop_idx 5 $@)) alpha 4
# master:-99 keyword in work tree
cat <<-EOF >$testroot/view.expected
- commit $(pop_id 1 $ids)
+ commit $(pop_idx 1 $@)
[1/1] /alpha
- $(pop_id 1 $short_ids) alpha
+ $(trim_obj_id 32 $(pop_idx 1 $@)) alpha
blob - 38287ad91c7e0eeaf2c7f133935f5622968b42dd
blob + 479afa04f1c6c1a787ee26b12295c42f732bfa08
--- regress/tog/diff.sh
+++ regress/tog/diff.sh
local wt="$testroot/wt"
local id=$(git_show_head "$repo")
local author_time=$(git_show_author_time "$repo")
+ local ids="$id"
+ local alpha_ids="$(get_blob_id "$repo" "" alpha)"
- set -A ids "$id"
- set -A alpha_ids $(get_blob_id "$repo" "" alpha)
- set -A dates "$author_time"
+ set -- "$author_time"
got checkout "$repo" "$wt" > /dev/null
ret=$?
fi
id=$(git_show_head "$repo")
- set -- "$ids" "$id"
- ids=$*
- set -- "$alpha_ids" "$(get_blob_id "$repo" "" alpha)"
- alpha_ids=$*
- set -- "$dates" $(git_show_author_time "$repo")
- dates=$*
+ ids="$ids $id"
+ alpha_ids="$alpha_ids $(get_blob_id "$repo" "" alpha)"
+ set -- "$@" $(git_show_author_time "$repo")
done
cat <<-EOF >$TOG_TEST_SCRIPT
EOF
# diff consecutive commits with keywords
- local lhs_id=$(pop_id 1 $ids)
- local rhs_id=$(pop_id 2 $ids)
- local date=$(date -u -r $(pop_id 2 $dates) +"%a %b %e %X %Y UTC")
+ local lhs_id=$(pop_idx 1 $ids)
+ local rhs_id=$(pop_idx 2 $ids)
+ local date=$(date -u -r $(pop_idx 2 $@) +"%a %b %e %X %Y UTC")
cat <<-EOF >$testroot/view.expected
[1/20] diff $lhs_id $rhs_id
commit - $lhs_id
commit + $rhs_id
- blob - $(pop_id 1 $alpha_ids)
- blob + $(pop_id 2 $alpha_ids)
+ blob - $(pop_idx 1 $alpha_ids)
+ blob + $(pop_idx 2 $alpha_ids)
--- alpha
+++ alpha
@@ -1 +1 @@
fi
# diff arbitrary commits with keywords
- lhs_id=$(pop_id 5 $ids)
- rhs_id=$(pop_id 8 $ids)
+ lhs_id=$(pop_idx 5 $ids)
+ rhs_id=$(pop_idx 8 $ids)
cat <<-EOF >$testroot/view.expected
[1/10] diff $lhs_id $rhs_id
commit - $lhs_id
commit + $rhs_id
- blob - $(pop_id 5 $alpha_ids)
- blob + $(pop_id 8 $alpha_ids)
+ blob - $(pop_idx 5 $alpha_ids)
+ blob + $(pop_idx 8 $alpha_ids)
--- alpha
+++ alpha
@@ -1 +1 @@
fi
# diff consecutive commits using keywords with -r repository
- lhs_id=$(pop_id 8 $ids)
- rhs_id=$(pop_id 9 $ids)
- date=$(date -u -r $(pop_id 9 $dates) +"%a %b %e %X %Y UTC")
+ lhs_id=$(pop_idx 8 $ids)
+ rhs_id=$(pop_idx 9 $ids)
+ date=$(date -u -r $(pop_idx 9 $@) +"%a %b %e %X %Y UTC")
cat <<-EOF >$testroot/view.expected
[1/20] diff $lhs_id refs/heads/master
commit - $lhs_id
commit + $rhs_id
- blob - $(pop_id 8 $alpha_ids)
- blob + $(pop_id 9 $alpha_ids)
+ blob - $(pop_idx 8 $alpha_ids)
+ blob + $(pop_idx 9 $alpha_ids)
--- alpha
+++ alpha
@@ -1 +1 @@
blob - a7c92801a63e2df3de71afd808cde146986b7efc
blob + c9e0f9386c09837c4f369034ac78348d9c7f2abd
--- regress/tog/log.sh
+++ regress/tog/log.sh
local author_time=$(git_show_author_time "$repo")
local ymd=$(date -u -r $author_time +"%G-%m-%d")
- set -A ids "$id"
- set -A short_ids "$(trim_obj_id 32 $id)"
+ set -- "$id"
got checkout "$repo" "$wt" > /dev/null
ret=$?
fi
id=$(git_show_head "$repo")
- set -- "$ids" "$id"
- ids=$*
- set -- "$short_ids" "$(trim_obj_id 32 $id)"
- short_ids=$*
+ set -- "$@" "$id"
done
cat <<-EOF >$TOG_TEST_SCRIPT
EOF
cat <<-EOF >$testroot/view.expected
- commit $(pop_id 5 $ids) [1/5]
- $ymd $(pop_id 5 $short_ids) flan_hacker commit 4
- $ymd $(pop_id 4 $short_ids) flan_hacker commit 3
- $ymd $(pop_id 3 $short_ids) flan_hacker commit 2
- $ymd $(pop_id 2 $short_ids) flan_hacker commit 1
- $ymd $(pop_id 1 $short_ids) flan_hacker adding the test tree
+ commit $(pop_idx 5 $@) [1/5]
+ $ymd $(trim_obj_id 32 $(pop_idx 5 $@)) flan_hacker commit 4
+ $ymd $(trim_obj_id 32 $(pop_idx 4 $@)) flan_hacker commit 3
+ $ymd $(trim_obj_id 32 $(pop_idx 3 $@)) flan_hacker commit 2
+ $ymd $(trim_obj_id 32 $(pop_idx 2 $@)) flan_hacker commit 1
+ $ymd $(trim_obj_id 32 $(pop_idx 1 $@)) flan_hacker adding the test tree
fi
cat <<-EOF >$testroot/view.expected
- commit $(pop_id 7 $ids) [1/7]
- $ymd $(pop_id 7 $short_ids) flan_hacker commit 6
- $ymd $(pop_id 6 $short_ids) flan_hacker commit 5
- $ymd $(pop_id 5 $short_ids) flan_hacker commit 4
- $ymd $(pop_id 4 $short_ids) flan_hacker commit 3
- $ymd $(pop_id 3 $short_ids) flan_hacker commit 2
- $ymd $(pop_id 2 $short_ids) flan_hacker commit 1
- $ymd $(pop_id 1 $short_ids) flan_hacker adding the test tree
+ commit $(pop_idx 7 $@) [1/7]
+ $ymd $(trim_obj_id 32 $(pop_idx 7 $@)) flan_hacker commit 6
+ $ymd $(trim_obj_id 32 $(pop_idx 6 $@)) flan_hacker commit 5
+ $ymd $(trim_obj_id 32 $(pop_idx 5 $@)) flan_hacker commit 4
+ $ymd $(trim_obj_id 32 $(pop_idx 4 $@)) flan_hacker commit 3
+ $ymd $(trim_obj_id 32 $(pop_idx 3 $@)) flan_hacker commit 2
+ $ymd $(trim_obj_id 32 $(pop_idx 2 $@)) flan_hacker commit 1
+ $ymd $(trim_obj_id 32 $(pop_idx 1 $@)) flan_hacker adding the test tree
EOF
fi
cat <<-EOF >$testroot/view.expected
- commit $(pop_id 5 $ids) [1/5]
- $ymd $(pop_id 5 $short_ids) flan_hacker commit 4
- $ymd $(pop_id 4 $short_ids) flan_hacker commit 3
- $ymd $(pop_id 3 $short_ids) flan_hacker ~commit 2
- $ymd $(pop_id 2 $short_ids) flan_hacker commit 1
- $ymd $(pop_id 1 $short_ids) flan_hacker adding the test tree
+ commit $(pop_idx 5 $@) [1/5]
+ $ymd $(trim_obj_id 32 $(pop_idx 5 $@)) flan_hacker commit 4
+ $ymd $(trim_obj_id 32 $(pop_idx 4 $@)) flan_hacker commit 3
+ $ymd $(trim_obj_id 32 $(pop_idx 3 $@)) flan_hacker ~commit 2
+ $ymd $(trim_obj_id 32 $(pop_idx 2 $@)) flan_hacker commit 1
+ $ymd $(trim_obj_id 32 $(pop_idx 1 $@)) flan_hacker adding the test tree
fi
cat <<-EOF >$testroot/view.expected
- commit $(pop_id 1 $ids) [1/1]
- $ymd $(pop_id 1 $short_ids) flan_hacker adding the test tree
+ commit $(pop_idx 1 $@) [1/1]
+ $ymd $(trim_obj_id 32 $(pop_idx 1 $@)) flan_hacker adding the test tree
blob - ab5481d9ca9da400e86ac14e7511cf21b1e24863
blob + dde6b39fc273ac652a3183be4339de99d649addc
--- regress/tog/tree.sh
+++ regress/tog/tree.sh
local wt="$testroot/wt"
local id=$(git_show_head "$repo")
- set -A ids "$id"
+ set -- "$id"
got checkout "$repo" "$wt" > /dev/null
ret=$?
fi
id=$(git_show_head "$repo")
- set -- "$ids" "$id"
- ids=$*
+ set -- "$@" "$id"
done
EOF
cat <<-EOF >$testroot/view.expected
- commit $(pop_id 8 $ids)
+ commit $(pop_idx 8 $@)
[1/7] /
alpha
fi
cat <<-EOF >$testroot/view.expected
- commit $(pop_id 6 $ids)
+ commit $(pop_idx 6 $@)
[1/6] /
alpha
fi
cat <<-EOF >$testroot/view.expected
- commit $(pop_id 9 $ids)
+ commit $(pop_idx 9 $@)
[1/8] /
alpha
fi
cat <<-EOF >$testroot/view.expected
- commit $(pop_id 4 $ids)
+ commit $(pop_idx 4 $@)
[1/5] /
alpha
fi
cat <<-EOF >$testroot/view.expected
- commit $(pop_id 1 $ids)
+ commit $(pop_idx 1 $@)
[1/4] /
alpha