From: Omar Polo Subject: Re: regress: change how trim_obj_id works To: gameoftrees@openbsd.org Date: Sat, 13 Jul 2024 16:09:24 +0200 Omar Polo wrote: > trim_obj_ids is a bit weird IMHO in that you have to specify how many > characters to drop *from the end* instead of how many to keep from the > beginning. This comes in the way of enabling some parts of the regress > for sha256 since object IDs are longer, and a `trim_obj_id 38` will not > yield 2 characters, but 26! > > Instead, what about using the numeric argument to mean the number of > characters to keep from the beginning? Then `trim_obj_id 2` will always > return the first two characters, regardless of the length of the hash. > > The diff boils down to > > @@ -132,13 +132,7 @@ trim_obj_id() > local trimcount=$1 > local id=$2 > > - local pat="" > - while [ "$trimcount" -gt 0 ]; do > - pat="[0-9a-f]$pat" > - trimcount=$((trimcount - 1)) > - done > - > - echo ${id%$pat} > + echo "$id" | sed -E "s/^([0-9a-f]{$trimcount}).*/\1/" > } > > plus a mechanical fix for all the places where it's used. Regress of > course passes. ok? forgot to stage a few files, here's a diff that fixes tog/ and gotd/ too. commit b080979bc778860cf2c4648e7dd1b82ee0b7131e from: Omar Polo date: Sat Jul 13 14:08:24 2024 UTC swap trim_obj_id behaviour diff a96c0eca406fbbdec4a21b0fc2589bdbc9c0d04a b080979bc778860cf2c4648e7dd1b82ee0b7131e commit - a96c0eca406fbbdec4a21b0fc2589bdbc9c0d04a commit + b080979bc778860cf2c4648e7dd1b82ee0b7131e blob - d60fc3d989f80b6803c66daddd2280f9ac6bee96 blob + d029636f37e1e06a4fba931a86782da565457b03 --- regress/cmdline/blame.sh +++ regress/cmdline/blame.sh @@ -61,9 +61,9 @@ test_blame_basic() { (cd $testroot/wt && got blame alpha > $testroot/stdout) - local short_commit1=`trim_obj_id 32 $commit1` - local short_commit2=`trim_obj_id 32 $commit2` - local short_commit3=`trim_obj_id 32 $commit3` + local short_commit1=`trim_obj_id 8 $commit1` + local short_commit2=`trim_obj_id 8 $commit2` + local short_commit3=`trim_obj_id 8 $commit3` d=`date -u -r $author_time +"%F"` echo "1) $short_commit1 $d $GOT_AUTHOR_8 1" > $testroot/stdout.expected @@ -110,8 +110,8 @@ test_blame_tag() { (cd $testroot/wt && got blame -c $tag alpha > $testroot/stdout) - local short_commit1=`trim_obj_id 32 $commit1` - local short_commit2=`trim_obj_id 32 $commit2` + local short_commit1=`trim_obj_id 8 $commit1` + local short_commit2=`trim_obj_id 8 $commit2` d=`date -u -r $author_time +"%F"` echo "1) $short_commit1 $d $GOT_AUTHOR_8 1" > $testroot/stdout.expected @@ -147,7 +147,7 @@ test_blame_file_single_line() { (cd $testroot/wt && got blame alpha > $testroot/stdout) - local short_commit1=`trim_obj_id 32 $commit1` + local short_commit1=`trim_obj_id 8 $commit1` d=`date -u -r $author_time +"%F"` echo "1) $short_commit1 $d $GOT_AUTHOR_8 1" > $testroot/stdout.expected @@ -182,7 +182,7 @@ test_blame_file_single_line_no_newline() { (cd $testroot/wt && got blame alpha > $testroot/stdout) - local short_commit1=`trim_obj_id 32 $commit1` + local short_commit1=`trim_obj_id 8 $commit1` d=`date -u -r $author_time +"%F"` echo "1) $short_commit1 $d $GOT_AUTHOR_8 1" > $testroot/stdout.expected @@ -208,7 +208,7 @@ test_blame_all_lines_replaced() { seq 8 > $testroot/wt/alpha (cd $testroot/wt && got commit -m "change 1" > /dev/null) local commit1=`git_show_head $testroot/repo` - local short_commit1=`trim_obj_id 32 $commit1` + local short_commit1=`trim_obj_id 8 $commit1` local author_time=`git_show_author_time $testroot/repo` (cd $testroot/wt && got blame alpha > $testroot/stdout) @@ -245,7 +245,7 @@ test_blame_lines_shifted_up() { seq 8 > $testroot/wt/alpha (cd $testroot/wt && got commit -m "change 1" > /dev/null) local commit1=`git_show_head $testroot/repo` - local short_commit1=`trim_obj_id 32 $commit1` + local short_commit1=`trim_obj_id 8 $commit1` local author_time=`git_show_author_time $testroot/repo` ed -s $testroot/wt/alpha <<-\EOF @@ -254,7 +254,7 @@ test_blame_lines_shifted_up() { EOF (cd $testroot/wt && got commit -m "change 2" > /dev/null) local commit2=`git_show_head $testroot/repo` - local short_commit2=`trim_obj_id 32 $commit2` + local short_commit2=`trim_obj_id 8 $commit2` seq 2 > $testroot/wt/alpha echo foo >> $testroot/wt/alpha @@ -263,7 +263,7 @@ test_blame_lines_shifted_up() { seq 6 8 >> $testroot/wt/alpha (cd $testroot/wt && got commit -m "change 3" > /dev/null) local commit3=`git_show_head $testroot/repo` - local short_commit3=`trim_obj_id 32 $commit3` + local short_commit3=`trim_obj_id 8 $commit3` local author_time=`git_show_author_time $testroot/repo` (cd $testroot/wt && got blame alpha > $testroot/stdout) @@ -304,7 +304,7 @@ test_blame_lines_shifted_down() { seq 8 > $testroot/wt/alpha (cd $testroot/wt && got commit -m "change 1" > /dev/null) local commit1=`git_show_head $testroot/repo` - local short_commit1=`trim_obj_id 32 $commit1` + local short_commit1=`trim_obj_id 8 $commit1` local author_time=`git_show_author_time $testroot/repo` ed -s $testroot/wt/alpha <<-\EOF @@ -313,7 +313,7 @@ test_blame_lines_shifted_down() { EOF (cd $testroot/wt && got commit -m "change 2" > /dev/null) local commit2=`git_show_head $testroot/repo` - local short_commit2=`trim_obj_id 32 $commit2` + local short_commit2=`trim_obj_id 8 $commit2` seq 2 > $testroot/wt/alpha echo foo >> $testroot/wt/alpha @@ -322,7 +322,7 @@ test_blame_lines_shifted_down() { seq 3 8 >> $testroot/wt/alpha (cd $testroot/wt && got commit -m "change 3" > /dev/null) local commit3=`git_show_head $testroot/repo` - local short_commit3=`trim_obj_id 32 $commit3` + local short_commit3=`trim_obj_id 8 $commit3` local author_time=`git_show_author_time $testroot/repo` (cd $testroot/wt && got blame alpha > $testroot/stdout) @@ -398,7 +398,7 @@ dvi: # do nothing to build dvi EOF (cd $testroot/wt && got commit -m "change 1" > /dev/null) local commit1=`git_show_head $testroot/repo` - local short_commit1=`trim_obj_id 32 $commit1` + local short_commit1=`trim_obj_id 8 $commit1` local author_time1=`git_show_author_time $testroot/repo` local d1=`date -u -r $author_time1 +"%F"` @@ -425,7 +425,7 @@ EOF # all changes in this commit will be subsumed by later commits (cd $testroot/wt && got commit -m "change 2" > /dev/null) local commit2=`git_show_head $testroot/repo` - local short_commit2=`trim_obj_id 32 $commit2` + local short_commit2=`trim_obj_id 8 $commit2` local author_time2=`git_show_author_time $testroot/repo` local d2=`date -u -r $author_time2 +"%F"` @@ -449,7 +449,7 @@ dvi: # do nothing to build dvi EOF (cd $testroot/wt && got commit -m "change 3" > /dev/null) local commit3=`git_show_head $testroot/repo` - local short_commit3=`trim_obj_id 32 $commit3` + local short_commit3=`trim_obj_id 8 $commit3` local author_time3=`git_show_author_time $testroot/repo` local d3=`date -u -r $author_time3 +"%F"` @@ -473,7 +473,7 @@ dvi: # do nothing to build dvi EOF (cd $testroot/wt && got commit -m "change 4" > /dev/null) local commit4=`git_show_head $testroot/repo` - local short_commit4=`trim_obj_id 32 $commit4` + local short_commit4=`trim_obj_id 8 $commit4` local author_time4=`git_show_author_time $testroot/repo` local d4=`date -u -r $author_time4 +"%F"` @@ -720,9 +720,9 @@ test_blame_added_on_branch() { (cd $testroot/wt && got blame new > $testroot/stdout) - local short_commit1=`trim_obj_id 32 $commit1` - local short_commit2=`trim_obj_id 32 $commit2` - local short_commit3=`trim_obj_id 32 $commit3` + local short_commit1=`trim_obj_id 8 $commit1` + local short_commit2=`trim_obj_id 8 $commit2` + local short_commit3=`trim_obj_id 8 $commit3` d=`date -u -r $author_time +"%F"` echo "1) $short_commit1 $d $GOT_AUTHOR_8 1" > $testroot/stdout.expected @@ -772,7 +772,7 @@ test_blame_submodule() { test_blame_symlink() { local testroot=`test_init blame_symlink` local commit_id0=`git_show_head $testroot/repo` - local short_commit0=`trim_obj_id 32 $commit_id0` + local short_commit0=`trim_obj_id 8 $commit_id0` (cd $testroot/repo && ln -s alpha alpha.link) (cd $testroot/repo && ln -s epsilon epsilon.link) @@ -783,7 +783,7 @@ test_blame_symlink() { git_commit $testroot/repo -m "add symlinks" local commit_id1=`git_show_head $testroot/repo` - local short_commit1=`trim_obj_id 32 $commit_id1` + local short_commit1=`trim_obj_id 8 $commit_id1` local author_time=`git_show_author_time $testroot/repo` # got blame dereferences symlink to a regular file @@ -907,7 +907,7 @@ D EOF (cd $testroot/wt && got commit -m "change 1" > /dev/null) local commit1=`git_show_head $testroot/repo` - local short_commit1=`trim_obj_id 32 $commit1` + local short_commit1=`trim_obj_id 8 $commit1` local author_time1=`git_show_author_time $testroot/repo` cat > $testroot/wt/alpha < /dev/null) local commit2=`git_show_head $testroot/repo` - local short_commit2=`trim_obj_id 32 $commit2` + local short_commit2=`trim_obj_id 8 $commit2` local author_time2=`git_show_author_time $testroot/repo` cat > $testroot/wt/alpha < /dev/null) local commit3=`git_show_head $testroot/repo` - local short_commit3=`trim_obj_id 32 $commit3` + local short_commit3=`trim_obj_id 8 $commit3` local author_time3=`git_show_author_time $testroot/repo` cat > $testroot/wt/alpha < /dev/null) local commit4=`git_show_head $testroot/repo` - local short_commit4=`trim_obj_id 32 $commit4` + local short_commit4=`trim_obj_id 8 $commit4` local author_time4=`git_show_author_time $testroot/repo` cat > $testroot/wt/alpha < /dev/null) local commit5=`git_show_head $testroot/repo` - local short_commit5=`trim_obj_id 32 $commit5` + local short_commit5=`trim_obj_id 8 $commit5` local author_time5=`git_show_author_time $testroot/repo` (cd $testroot/wt && got blame alpha > $testroot/stdout) @@ -997,7 +997,7 @@ test_blame_commit_keywords() { local wt="$testroot/wt" local id=$(git_show_head "$repo") - set -- "$(trim_obj_id 32 $id)" + set -- "$(trim_obj_id 8 $id)" # :base requires work tree echo "got: '-c :base' requires work tree" > "$testroot/stderr.expected" @@ -1038,7 +1038,7 @@ test_blame_commit_keywords() { fi id=$(git_show_head "$repo") - set -- "$@" "$(trim_obj_id 32 $id)" + set -- "$@" "$(trim_obj_id 8 $id)" done local author_time=$(git_show_author_time "$repo") blob - fa88b8e9da3292f78931b60f217cfd5ede722f86 blob + a43ed7a5edf97dd118bdc839444f242a3b12dbe4 --- regress/cmdline/common.sh +++ regress/cmdline/common.sh @@ -132,13 +132,7 @@ trim_obj_id() local trimcount=$1 local id=$2 - local pat="" - while [ "$trimcount" -gt 0 ]; do - pat="[0-9a-f]$pat" - trimcount=$((trimcount - 1)) - done - - echo ${id%$pat} + echo "$id" | sed -E "s/^([0-9a-f]{$trimcount}).*/\1/" } pop_idx() @@ -201,7 +195,7 @@ get_loose_object_path() { local repo="$1" local id="$2" - local id0=`trim_obj_id 38 $id` + local id0=`trim_obj_id 2 $id` local idrest=`echo ${id#[0-9a-f][0-9a-f]}` echo "$repo/.git/objects/$id0/$idrest" } blob - 758167f8b5e07885c9944d76d57660a8d0a7afc1 blob + c7454905559296ba3c95edb66a8cf17f0700d11a --- regress/cmdline/histedit.sh +++ regress/cmdline/histedit.sh @@ -55,10 +55,10 @@ test_histedit_no_op() { local new_commit2=`git_show_head $testroot/repo` local new_author_time2=`git_show_author_time $testroot/repo` - local short_old_commit1=`trim_obj_id 28 $old_commit1` - local short_old_commit2=`trim_obj_id 28 $old_commit2` - local short_new_commit1=`trim_obj_id 28 $new_commit1` - local short_new_commit2=`trim_obj_id 28 $new_commit2` + local short_old_commit1=`trim_obj_id 12 $old_commit1` + local short_old_commit2=`trim_obj_id 12 $old_commit2` + local short_new_commit1=`trim_obj_id 12 $new_commit1` + local short_new_commit2=`trim_obj_id 12 $new_commit2` echo "G alpha" > $testroot/stdout.expected echo "D beta" >> $testroot/stdout.expected @@ -267,10 +267,10 @@ test_histedit_swap() { local new_commit2=`git_show_parent_commit $testroot/repo` local new_commit1=`git_show_head $testroot/repo` - local short_old_commit1=`trim_obj_id 28 $old_commit1` - local short_old_commit2=`trim_obj_id 28 $old_commit2` - local short_new_commit1=`trim_obj_id 28 $new_commit1` - local short_new_commit2=`trim_obj_id 28 $new_commit2` + local short_old_commit1=`trim_obj_id 12 $old_commit1` + local short_old_commit2=`trim_obj_id 12 $old_commit2` + local short_new_commit1=`trim_obj_id 12 $new_commit1` + local short_new_commit2=`trim_obj_id 12 $new_commit2` echo "G epsilon/zeta" > $testroot/stdout.expected echo -n "$short_old_commit2 -> $short_new_commit2: " \ @@ -388,9 +388,9 @@ test_histedit_drop() { local new_commit2=`git_show_head $testroot/repo` - local short_old_commit1=`trim_obj_id 28 $old_commit1` - local short_old_commit2=`trim_obj_id 28 $old_commit2` - local short_new_commit2=`trim_obj_id 28 $new_commit2` + local short_old_commit1=`trim_obj_id 12 $old_commit1` + local short_old_commit2=`trim_obj_id 12 $old_commit2` + local short_new_commit2=`trim_obj_id 12 $new_commit2` echo "$short_old_commit1 -> drop commit: committing changes" \ > $testroot/stdout.expected @@ -511,11 +511,11 @@ EOF local new_commit1=`git_show_parent_commit $testroot/repo` local new_commit2=`git_show_head $testroot/repo` - local short_old_commit1=`trim_obj_id 28 $old_commit1` - local short_old_commit2=`trim_obj_id 28 $old_commit2` - local short_old_commit3=`trim_obj_id 28 $old_commit3` - local short_new_commit1=`trim_obj_id 28 $new_commit1` - local short_new_commit2=`trim_obj_id 28 $new_commit2` + local short_old_commit1=`trim_obj_id 12 $old_commit1` + local short_old_commit2=`trim_obj_id 12 $old_commit2` + local short_old_commit3=`trim_obj_id 12 $old_commit3` + local short_new_commit1=`trim_obj_id 12 $new_commit1` + local short_new_commit2=`trim_obj_id 12 $new_commit2` echo "G alpha" > $testroot/stdout.expected echo "D beta" >> $testroot/stdout.expected @@ -617,8 +617,8 @@ test_histedit_edit() { (cd $testroot/wt && got histedit -F $testroot/histedit-script \ > $testroot/stdout) - local short_old_commit1=`trim_obj_id 28 $old_commit1` - local short_old_commit2=`trim_obj_id 28 $old_commit2` + local short_old_commit1=`trim_obj_id 12 $old_commit1` + local short_old_commit2=`trim_obj_id 12 $old_commit2` echo "G alpha" > $testroot/stdout.expected echo "D beta" >> $testroot/stdout.expected @@ -675,8 +675,8 @@ EOF local new_commit1=`git_show_parent_commit $testroot/repo` local new_commit2=`git_show_head $testroot/repo` - local short_new_commit1=`trim_obj_id 28 $new_commit1` - local short_new_commit2=`trim_obj_id 28 $new_commit2` + local short_new_commit1=`trim_obj_id 12 $new_commit1` + local short_new_commit2=`trim_obj_id 12 $new_commit2` echo "$short_old_commit1 -> $short_new_commit1: committing changes" \ > $testroot/stdout.expected @@ -926,8 +926,8 @@ test_histedit_abort() { (cd $testroot/wt && got histedit -F $testroot/histedit-script \ > $testroot/stdout) - local short_old_commit1=`trim_obj_id 28 $old_commit1` - local short_old_commit2=`trim_obj_id 28 $old_commit2` + local short_old_commit1=`trim_obj_id 12 $old_commit1` + local short_old_commit2=`trim_obj_id 12 $old_commit2` echo "G alpha" > $testroot/stdout.expected echo "D beta" >> $testroot/stdout.expected @@ -1058,8 +1058,8 @@ test_histedit_path_prefix_drop() { (cd $testroot/wt && got histedit -F $testroot/histedit-script \ > $testroot/stdout) - local short_old_commit1=`trim_obj_id 28 $old_commit1` - local short_old_commit2=`trim_obj_id 28 $old_commit2` + local short_old_commit1=`trim_obj_id 12 $old_commit1` + local short_old_commit2=`trim_obj_id 12 $old_commit2` echo "$short_old_commit1 -> drop commit: changing zeta" \ > $testroot/stdout.expected @@ -1161,7 +1161,7 @@ test_histedit_path_prefix_edit() { (cd $testroot/wt && got histedit -F $testroot/histedit-script \ > $testroot/stdout) - local short_old_commit1=`trim_obj_id 28 $old_commit1` + local short_old_commit1=`trim_obj_id 12 $old_commit1` echo "G zeta" > $testroot/stdout.expected echo "Stopping histedit for amending commit $old_commit1" \ @@ -1212,7 +1212,7 @@ EOF got histedit -c > $testroot/stdout) local new_commit1=`git_show_head $testroot/repo` - local short_new_commit1=`trim_obj_id 28 $new_commit1` + local short_new_commit1=`trim_obj_id 12 $new_commit1` echo -n "$short_old_commit1 -> $short_new_commit1: " \ > $testroot/stdout.expected @@ -1359,9 +1359,9 @@ EOF local new_commit=`git_show_head $testroot/repo` - local short_old_commit1=`trim_obj_id 28 $old_commit1` - local short_old_commit2=`trim_obj_id 28 $old_commit2` - local short_new_commit=`trim_obj_id 28 $new_commit` + local short_old_commit1=`trim_obj_id 12 $old_commit1` + local short_old_commit2=`trim_obj_id 12 $old_commit2` + local short_new_commit=`trim_obj_id 12 $new_commit` echo "G epsilon/zeta" >> $testroot/stdout.expected echo -n "$short_old_commit2 -> fold commit: committing to zeta " \ @@ -1395,12 +1395,12 @@ test_histedit_split_commit() { git -C $testroot/repo add epsilon/new git_commit $testroot/repo -m "committing changes 1" local old_commit1=`git_show_head $testroot/repo` - local short_old_commit1=`trim_obj_id 28 $old_commit1` + local short_old_commit1=`trim_obj_id 12 $old_commit1` echo "modified zeta on master" > $testroot/repo/epsilon/zeta git_commit $testroot/repo -m "committing changes 2" local old_commit2=`git_show_head $testroot/repo` - local short_old_commit2=`trim_obj_id 28 $old_commit2` + local short_old_commit2=`trim_obj_id 12 $old_commit2` got checkout -c $orig_commit $testroot/repo $testroot/wt > /dev/null ret=$? @@ -1471,7 +1471,7 @@ test_histedit_split_commit() { return 1 fi local new_commit2=`git_show_head $testroot/repo` - local short_new_commit2=`trim_obj_id 28 $new_commit2` + local short_new_commit2=`trim_obj_id 12 $new_commit2` echo "$short_old_commit1 -> no-op change: committing changes 1" \ > $testroot/stdout.expected @@ -1587,10 +1587,10 @@ EOF local new_commit1=`git_show_head $testroot/repo` - local short_old_commit1=`trim_obj_id 28 $old_commit1` - local short_old_commit2=`trim_obj_id 28 $old_commit2` - local short_old_commit3=`trim_obj_id 28 $old_commit3` - local short_new_commit1=`trim_obj_id 28 $new_commit1` + local short_old_commit1=`trim_obj_id 12 $old_commit1` + local short_old_commit2=`trim_obj_id 12 $old_commit2` + local short_old_commit3=`trim_obj_id 12 $old_commit3` + local short_new_commit1=`trim_obj_id 12 $new_commit1` echo "A epsilon/psi" >> $testroot/stdout.expected echo "$short_old_commit1 -> fold commit: committing changes" \ @@ -1690,9 +1690,9 @@ EOF local new_commit1=`git_show_head $testroot/repo` - local short_old_commit1=`trim_obj_id 28 $old_commit1` - local short_old_commit2=`trim_obj_id 28 $old_commit2` - local short_new_commit1=`trim_obj_id 28 $new_commit1` + local short_old_commit1=`trim_obj_id 12 $old_commit1` + local short_old_commit2=`trim_obj_id 12 $old_commit2` + local short_new_commit1=`trim_obj_id 12 $new_commit1` echo "G alpha" >> $testroot/stdout.expected echo "$short_old_commit1 -> fold commit: modified alpha" \ @@ -1779,9 +1779,9 @@ EOF local new_commit1=`git_show_head $testroot/repo` - local short_old_commit1=`trim_obj_id 28 $old_commit1` - local short_old_commit2=`trim_obj_id 28 $old_commit2` - local short_new_commit1=`trim_obj_id 28 $new_commit1` + local short_old_commit1=`trim_obj_id 12 $old_commit1` + local short_old_commit2=`trim_obj_id 12 $old_commit2` + local short_new_commit1=`trim_obj_id 12 $new_commit1` echo "D alpha" > $testroot/stdout.expected echo "$short_old_commit1 -> fold commit: removing alpha" \ @@ -1859,11 +1859,11 @@ EOF local new_commit1=`git_show_head $testroot/repo` - local short_old_commit1=`trim_obj_id 28 $old_commit1` - local short_old_commit2=`trim_obj_id 28 $old_commit2` - local short_old_commit3=`trim_obj_id 28 $old_commit3` - local short_new_commit1=`trim_obj_id 28 $new_commit1` - local short_new_commit2=`trim_obj_id 28 $new_commit2` + local short_old_commit1=`trim_obj_id 12 $old_commit1` + local short_old_commit2=`trim_obj_id 12 $old_commit2` + local short_old_commit3=`trim_obj_id 12 $old_commit3` + local short_new_commit1=`trim_obj_id 12 $new_commit1` + local short_new_commit2=`trim_obj_id 12 $new_commit2` echo "G alpha" > $testroot/stdout.expected echo "D beta" >> $testroot/stdout.expected @@ -1978,12 +1978,12 @@ EOF local new_commit1=`git_show_head $testroot/repo` - local short_old_commit1=`trim_obj_id 28 $old_commit1` - local very_short_old_commit1=`trim_obj_id 29 $old_commit1` - local short_old_commit2=`trim_obj_id 28 $old_commit2` - local short_old_commit3=`trim_obj_id 28 $old_commit3` - local short_new_commit1=`trim_obj_id 28 $new_commit1` - local short_new_commit2=`trim_obj_id 28 $new_commit2` + local short_old_commit1=`trim_obj_id 12 $old_commit1` + local very_short_old_commit1=`trim_obj_id 11 $old_commit1` + local short_old_commit2=`trim_obj_id 12 $old_commit2` + local short_old_commit3=`trim_obj_id 12 $old_commit3` + local short_new_commit1=`trim_obj_id 12 $new_commit1` + local short_new_commit2=`trim_obj_id 12 $new_commit2` echo "G alpha" > $testroot/stdout.expected echo "D beta" >> $testroot/stdout.expected @@ -2083,8 +2083,8 @@ test_histedit_edit_only() { (cd $testroot/wt && got histedit -e > $testroot/stdout) - local short_old_commit1=`trim_obj_id 28 $old_commit1` - local short_old_commit2=`trim_obj_id 28 $old_commit2` + local short_old_commit1=`trim_obj_id 12 $old_commit1` + local short_old_commit2=`trim_obj_id 12 $old_commit2` echo "G alpha" > $testroot/stdout.expected echo "D beta" >> $testroot/stdout.expected @@ -2115,7 +2115,7 @@ EOF local new_commit1=$(cd $testroot/wt && got info | \ grep '^work tree base commit: ' | cut -d: -f2 | tr -d ' ') - local short_new_commit1=`trim_obj_id 28 $new_commit1` + local short_new_commit1=`trim_obj_id 12 $new_commit1` echo -n "$short_old_commit1 -> $short_new_commit1: " \ > $testroot/stdout.expected @@ -2146,7 +2146,7 @@ EOF VISUAL="$testroot/editor.sh" got histedit -c > $testroot/stdout) local new_commit2=`git_show_head $testroot/repo` - local short_new_commit2=`trim_obj_id 28 $new_commit2` + local short_new_commit2=`trim_obj_id 12 $new_commit2` echo -n "$short_old_commit2 -> $short_new_commit2: " \ > $testroot/stdout.expected @@ -2437,8 +2437,8 @@ EOF local new_commit1=`git_show_head $testroot/repo` local new_author_time1=`git_show_author_time $testroot/repo` - local short_old_commit1=`trim_obj_id 28 $old_commit1` - local short_new_commit1=`trim_obj_id 28 $new_commit1` + local short_old_commit1=`trim_obj_id 12 $old_commit1` + local short_new_commit1=`trim_obj_id 12 $new_commit1` echo "G alpha" > $testroot/stdout.expected echo "$short_old_commit1 -> $short_new_commit1: set executable bit on alpha" \ @@ -2530,9 +2530,9 @@ test_histedit_drop_only() { (cd $testroot/wt && got histedit -d > $testroot/stdout) local new_commit1=`git_show_head $testroot/repo` - local short_commit1=`trim_obj_id 28 $drop_commit1` - local short_commit2=`trim_obj_id 28 $drop_commit2` - local short_commit3=`trim_obj_id 28 $drop_commit3` + local short_commit1=`trim_obj_id 12 $drop_commit1` + local short_commit2=`trim_obj_id 12 $drop_commit2` + local short_commit3=`trim_obj_id 12 $drop_commit3` echo "$short_commit1 $drop $dropmsg 1" > $testroot/stdout.expected echo "$short_commit2 $drop $dropmsg 2" >> $testroot/stdout.expected @@ -2618,17 +2618,17 @@ test_histedit_conflict_revert() { echo "first change of alpha" > $testroot/repo/alpha git_commit $testroot/repo -m "committing changes" local old_commit1=`git_show_head $testroot/repo` - local short_old_commit1=`trim_obj_id 28 $old_commit1` + local short_old_commit1=`trim_obj_id 12 $old_commit1` echo "second change of alpha" > $testroot/repo/alpha git_commit $testroot/repo -m "committing changes" local old_commit2=`git_show_head $testroot/repo` - local short_old_commit2=`trim_obj_id 28 $old_commit2` + local short_old_commit2=`trim_obj_id 12 $old_commit2` echo "third change of alpha" > $testroot/repo/alpha git_commit $testroot/repo -m "committing changes" local old_commit3=`git_show_head $testroot/repo` - local short_old_commit3=`trim_obj_id 28 $old_commit3` + local short_old_commit3=`trim_obj_id 12 $old_commit3` got checkout -c $orig_commit $testroot/repo $testroot/wt > /dev/null ret=$? @@ -2672,7 +2672,7 @@ EOF local new_commit1=$(cd $testroot/wt && got info | \ grep 'work tree base commit:' | cut -d ' ' -f5) - local short_new_commit1=`trim_obj_id 28 $new_commit1` + local short_new_commit1=`trim_obj_id 12 $new_commit1` echo "$short_old_commit1 -> $short_new_commit1: committing changes" \ > $testroot/stdout.expected blob - d8eb96bab4f0e3966cb1fb48167fcf1be88c38f7 blob + b1c3c8ec3866e7ac66371da08256f2fa1212a13c --- regress/cmdline/log.sh +++ regress/cmdline/log.sh @@ -1275,10 +1275,10 @@ test_log_toposort() { local merge_commit=`git_show_head $testroot/repo` local merge_time=`git_show_author_time $testroot/repo` - local short_commit0=`trim_obj_id 33 $commit0` - local short_commit1=`trim_obj_id 33 $commit1` - local short_commit2=`trim_obj_id 33 $commit2` - local short_commit3=`trim_obj_id 33 $commit3` + local short_commit0=`trim_obj_id 7 $commit0` + local short_commit1=`trim_obj_id 7 $commit1` + local short_commit2=`trim_obj_id 7 $commit2` + local short_commit3=`trim_obj_id 7 $commit3` d_0=`date -u -r $author_time0 +"%F"` d_1=`date -u -r $author_time1 +"%F"` blob - fdc97d042d96cc880bf32dab15045285d6a80e27 blob + c824aaf0100a26fa4d112f62f5136272c5c82bbc --- regress/cmdline/rebase.sh +++ regress/cmdline/rebase.sh @@ -67,10 +67,10 @@ test_rebase_basic() { local new_commit2=`git_show_head $testroot/repo` local new_author_time2=`git_show_author_time $testroot/repo` - local short_orig_commit1=`trim_obj_id 28 $orig_commit1` - local short_orig_commit2=`trim_obj_id 28 $orig_commit2` - local short_new_commit1=`trim_obj_id 28 $new_commit1` - local short_new_commit2=`trim_obj_id 28 $new_commit2` + local short_orig_commit1=`trim_obj_id 12 $orig_commit1` + local short_orig_commit2=`trim_obj_id 12 $orig_commit2` + local short_new_commit1=`trim_obj_id 12 $new_commit1` + local short_new_commit2=`trim_obj_id 12 $new_commit2` echo "G gamma/delta" >> $testroot/stdout.expected echo -n "$short_orig_commit1 -> $short_new_commit1" \ @@ -293,7 +293,7 @@ test_rebase_continue() { echo "modified alpha on branch" > $testroot/repo/alpha git_commit $testroot/repo -m "committing to alpha on newbranch" local orig_commit1=`git_show_head $testroot/repo` - local short_orig_commit1=`trim_obj_id 28 $orig_commit1` + local short_orig_commit1=`trim_obj_id 12 $orig_commit1` git -C $testroot/repo checkout -q master echo "modified alpha on master" > $testroot/repo/alpha @@ -395,7 +395,7 @@ EOF git -C $testroot/repo checkout -q newbranch local new_commit1=`git_show_head $testroot/repo` - local short_new_commit1=`trim_obj_id 28 $new_commit1` + local short_new_commit1=`trim_obj_id 12 $new_commit1` echo -n "$short_orig_commit1 -> $short_new_commit1" \ > $testroot/stdout.expected @@ -432,7 +432,7 @@ test_rebase_abort() { echo "modified beta on branch" > $testroot/repo/beta git_commit $testroot/repo -m "committing to beta on newbranch" local orig_commit1=`git_show_head $testroot/repo` - local short_orig_commit1=`trim_obj_id 28 $orig_commit1` + local short_orig_commit1=`trim_obj_id 12 $orig_commit1` echo "modified alpha on branch" > $testroot/repo/alpha echo "new file on branch" > $testroot/repo/epsilon/new @@ -440,7 +440,7 @@ test_rebase_abort() { git_commit $testroot/repo \ -m "changing alpha and adding new on newbranch" local orig_commit2=`git_show_head $testroot/repo` - local short_orig_commit2=`trim_obj_id 28 $orig_commit2` + local short_orig_commit2=`trim_obj_id 12 $orig_commit2` git -C $testroot/repo checkout -q master echo "modified alpha on master" > $testroot/repo/alpha @@ -462,7 +462,7 @@ test_rebase_abort() { new_commit1=$(cd $testroot/wt && got info beta | \ grep '^based on commit:' | cut -d' ' -f4) - local short_new_commit1=`trim_obj_id 28 $new_commit1` + local short_new_commit1=`trim_obj_id 12 $new_commit1` echo "G beta" > $testroot/stdout.expected echo -n "$short_orig_commit1 -> $short_new_commit1" \ @@ -628,7 +628,7 @@ test_rebase_no_op_change() { echo "modified alpha on branch" > $testroot/repo/alpha git_commit $testroot/repo -m "committing to alpha on newbranch" local orig_commit1=`git_show_head $testroot/repo` - local short_orig_commit1=`trim_obj_id 28 $orig_commit1` + local short_orig_commit1=`trim_obj_id 12 $orig_commit1` git -C $testroot/repo checkout -q master echo "modified alpha on master" > $testroot/repo/alpha @@ -743,7 +743,7 @@ test_rebase_in_progress() { echo "modified alpha on branch" > $testroot/repo/alpha git_commit $testroot/repo -m "committing to alpha on newbranch" local orig_commit1=`git_show_head $testroot/repo` - local short_orig_commit1=`trim_obj_id 28 $orig_commit1` + local short_orig_commit1=`trim_obj_id 12 $orig_commit1` git -C $testroot/repo checkout -q master echo "modified alpha on master" > $testroot/repo/alpha @@ -904,8 +904,8 @@ test_rebase_path_prefix() { local new_commit1=`git_show_parent_commit $testroot/repo` local new_commit2=`git_show_head $testroot/repo` - local short_orig_commit2=`trim_obj_id 28 $orig_commit2` - local short_new_commit2=`trim_obj_id 28 $new_commit2` + local short_orig_commit2=`trim_obj_id 12 $orig_commit2` + local short_new_commit2=`trim_obj_id 12 $new_commit2` echo "G gamma/delta" > $testroot/stdout.expected echo -n "$short_orig_commit2 -> $short_new_commit2" \ @@ -1364,10 +1364,10 @@ test_rebase_trims_empty_dir() { local new_commit1=`git_show_parent_commit $testroot/repo` local new_commit2=`git_show_head $testroot/repo` - local short_orig_commit1=`trim_obj_id 28 $orig_commit1` - local short_orig_commit2=`trim_obj_id 28 $orig_commit2` - local short_new_commit1=`trim_obj_id 28 $new_commit1` - local short_new_commit2=`trim_obj_id 28 $new_commit2` + local short_orig_commit1=`trim_obj_id 12 $orig_commit1` + local short_orig_commit2=`trim_obj_id 12 $orig_commit2` + local short_new_commit1=`trim_obj_id 12 $new_commit1` + local short_new_commit2=`trim_obj_id 12 $new_commit2` echo "G gamma/delta" >> $testroot/stdout.expected echo -n "$short_orig_commit1 -> $short_new_commit1" \ @@ -1463,8 +1463,8 @@ test_rebase_delete_missing_file() { local orig_commit1=`git_show_parent_commit $testroot/repo` local orig_commit2=`git_show_head $testroot/repo` - local short_orig_commit1=`trim_obj_id 28 $orig_commit1` - local short_orig_commit2=`trim_obj_id 28 $orig_commit2` + local short_orig_commit1=`trim_obj_id 12 $orig_commit1` + local short_orig_commit2=`trim_obj_id 12 $orig_commit2` (cd $testroot/wt && got update -b master > /dev/null) (cd $testroot/wt && got rm beta d/f/g/new > /dev/null) @@ -1487,8 +1487,8 @@ test_rebase_delete_missing_file() { local new_commit1=$(cd $testroot/wt && got info | \ grep '^work tree base commit: ' | cut -d: -f2 | tr -d ' ') - local short_orig_commit2=`trim_obj_id 28 $orig_commit2` - local short_new_commit1=`trim_obj_id 28 $new_commit1` + local short_orig_commit2=`trim_obj_id 12 $orig_commit2` + local short_new_commit1=`trim_obj_id 12 $new_commit1` echo "G gamma/delta" >> $testroot/stdout.expected echo -n "$short_orig_commit1 -> $short_new_commit1" \ @@ -1572,7 +1572,7 @@ test_rebase_delete_missing_file() { git -C $testroot/repo checkout -q newbranch local new_commit1=`git_show_head $testroot/repo` - local short_new_commit1=`trim_obj_id 28 $new_commit1` + local short_new_commit1=`trim_obj_id 12 $new_commit1` (cd $testroot/wt && got log -l3 | grep ^commit > $testroot/stdout) echo "commit $new_commit1 (newbranch)" > $testroot/stdout.expected @@ -1633,12 +1633,12 @@ test_rebase_rm_add_rm_file() { git -C $testroot/repo checkout -q newbranch - local short_orig_commit1=`trim_obj_id 28 $orig_commit1` - local short_orig_commit2=`trim_obj_id 28 $orig_commit2` - local short_orig_commit3=`trim_obj_id 28 $orig_commit3` - local short_new_commit1=`trim_obj_id 28 $new_commit1` - local short_new_commit2=`trim_obj_id 28 $new_commit2` - local short_new_commit3=`trim_obj_id 28 $new_commit3` + local short_orig_commit1=`trim_obj_id 12 $orig_commit1` + local short_orig_commit2=`trim_obj_id 12 $orig_commit2` + local short_orig_commit3=`trim_obj_id 12 $orig_commit3` + local short_new_commit1=`trim_obj_id 12 $new_commit1` + local short_new_commit2=`trim_obj_id 12 $new_commit2` + local short_new_commit3=`trim_obj_id 12 $new_commit3` echo "D beta" > $testroot/stdout.expected echo -n "$short_orig_commit1 -> $short_new_commit1" \ @@ -1730,10 +1730,10 @@ test_rebase_resets_committer() { local new_commit2=`git_show_head $testroot/repo` local new_author_time2=`git_show_author_time $testroot/repo` - local short_orig_commit1=`trim_obj_id 28 $orig_commit1` - local short_orig_commit2=`trim_obj_id 28 $orig_commit2` - local short_new_commit1=`trim_obj_id 28 $new_commit1` - local short_new_commit2=`trim_obj_id 28 $new_commit2` + local short_orig_commit1=`trim_obj_id 12 $orig_commit1` + local short_orig_commit2=`trim_obj_id 12 $orig_commit2` + local short_new_commit1=`trim_obj_id 12 $new_commit1` + local short_new_commit2=`trim_obj_id 12 $new_commit2` echo "G gamma/delta" >> $testroot/stdout.expected echo -n "$short_orig_commit1 -> $short_new_commit1" \ @@ -1819,10 +1819,10 @@ test_rebase_no_author_info() { local new_commit2=`git_show_head $testroot/repo` local new_author_time2=`git_show_author_time $testroot/repo` - local short_orig_commit1=`trim_obj_id 28 $orig_commit1` - local short_orig_commit2=`trim_obj_id 28 $orig_commit2` - local short_new_commit1=`trim_obj_id 28 $new_commit1` - local short_new_commit2=`trim_obj_id 28 $new_commit2` + local short_orig_commit1=`trim_obj_id 12 $orig_commit1` + local short_orig_commit2=`trim_obj_id 12 $orig_commit2` + local short_new_commit1=`trim_obj_id 12 $new_commit1` + local short_new_commit2=`trim_obj_id 12 $new_commit2` echo "G gamma/delta" >> $testroot/stdout.expected echo -n "$short_orig_commit1 -> $short_new_commit1" \ @@ -2096,16 +2096,16 @@ test_rebase_merge_commit() { (cd $testroot/wt && got rebase newbranch2) > $testroot/stdout local new_commit5=`git_show_parent_commit $testroot/repo newbranch2` - local short_orig_commit5=`trim_obj_id 28 $commit5` - local short_new_commit5=`trim_obj_id 28 $new_commit5` + local short_orig_commit5=`trim_obj_id 12 $commit5` + local short_new_commit5=`trim_obj_id 12 $new_commit5` local new_commit4=`git_show_parent_commit $testroot/repo $new_commit5` - local short_orig_commit4=`trim_obj_id 28 $commit4` - local short_new_commit4=`trim_obj_id 28 $new_commit4` + local short_orig_commit4=`trim_obj_id 12 $commit4` + local short_new_commit4=`trim_obj_id 12 $new_commit4` local new_merge_commit=`git_show_branch_head $testroot/repo newbranch2` - local short_orig_merge_commit=`trim_obj_id 28 $merge_commit` - local short_new_merge_commit=`trim_obj_id 28 $new_merge_commit` + local short_orig_merge_commit=`trim_obj_id 12 $merge_commit` + local short_new_merge_commit=`trim_obj_id 12 $new_merge_commit` echo "G beta"> $testroot/stdout.expected echo "$short_orig_commit4 -> $short_new_commit4: edit beta" \ @@ -2193,8 +2193,8 @@ test_rebase_across_merge_commit() { (cd $testroot/wt && got rebase master) > $testroot/stdout local new_commit1=`git_show_head $testroot/repo` - local short_orig_commit1=`trim_obj_id 28 $commit1` - local short_new_commit1=`trim_obj_id 28 $new_commit1` + local short_orig_commit1=`trim_obj_id 12 $commit1` + local short_new_commit1=`trim_obj_id 12 $new_commit1` echo "G gamma/delta"> $testroot/stdout.expected echo "$short_orig_commit1 -> $short_new_commit1: edit delta" \ blob - 87b2d0ee33cba60718822df7626b15b93e0b09ba blob + 74a0bac7ae7cce3410954539245f192f58869070 --- regress/gotd/email_notification.sh +++ regress/gotd/email_notification.sh @@ -56,7 +56,7 @@ test_file_changed() { wait %1 # wait for nc -l - short_commit_id=`trim_obj_id 28 $commit_id` + short_commit_id=`trim_obj_id 12 $commit_id` HOSTNAME=`hostname` printf "HELO localhost\r\n" > $testroot/stdout.expected printf "MAIL FROM:<${GOTD_USER}@${HOSTNAME}>\r\n" \ @@ -138,7 +138,7 @@ test_many_commits_not_summarized() { wait %1 # wait for nc -l - short_commit_id=`trim_obj_id 28 $commit_id` + short_commit_id=`trim_obj_id 12 $commit_id` HOSTNAME=`hostname` printf "HELO localhost\r\n" > $testroot/stdout.expected printf "MAIL FROM:<${GOTD_USER}@${HOSTNAME}>\r\n" \ @@ -206,7 +206,7 @@ test_many_commits_summarized() { echo "alpha $i" > $testroot/wt/alpha (cd $testroot/wt && got commit -m 'make changes' > /dev/null) local commit_id=`git_show_head $testroot/repo-clone` - local short_commit_id=`trim_obj_id 33 $commit_id` + local short_commit_id=`trim_obj_id 7 $commit_id` local author_time=`git_show_author_time $testroot/repo-clone` d=`date -u -r $author_time +"%F"` set -- "$@" "$short_commit_id $d" @@ -227,7 +227,7 @@ test_many_commits_summarized() { wait %1 # wait for nc -l - short_commit_id=`trim_obj_id 28 $commit_id` + short_commit_id=`trim_obj_id 12 $commit_id` HOSTNAME=`hostname` printf "HELO localhost\r\n" > $testroot/stdout.expected printf "MAIL FROM:<${GOTD_USER}@${HOSTNAME}>\r\n" \ @@ -305,7 +305,7 @@ test_branch_created() { wait %1 # wait for nc -l - short_commit_id=`trim_obj_id 28 $commit_id` + short_commit_id=`trim_obj_id 12 $commit_id` HOSTNAME=`hostname` printf "HELO localhost\r\n" > $testroot/stdout.expected printf "MAIL FROM:<${GOTD_USER}@${HOSTNAME}>\r\n" \ @@ -361,7 +361,7 @@ test_branch_removed() { sleep 1 # server starts up local commit_id=`git_show_branch_head $testroot/repo-clone newbranch` - local short_commit_id=`trim_obj_id 28 $commit_id` + local short_commit_id=`trim_obj_id 12 $commit_id` got send -d newbranch -q -r $testroot/repo-clone ret=$? @@ -419,7 +419,7 @@ test_tag_created() { local tagger_time=`git_show_tagger_time $testroot/repo-clone 1.0` local tag_id=`got ref -r $testroot/repo-clone -l \ | grep "^refs/tags/$tag" | tr -d ' ' | cut -d: -f2` - local short_tag_id=`trim_obj_id 28 $tag_id` + local short_tag_id=`trim_obj_id 12 $tag_id` (printf "220\r\n250\r\n250\r\n250\r\n354\r\n250\r\n221\r\n" \ | timeout 5 nc -l "$GOTD_TEST_SMTP_PORT" > $testroot/stdout) & @@ -500,7 +500,7 @@ test_tag_changed() { local tagger_time=`git_show_tagger_time $testroot/repo-clone 1.0` local tag_id=`got ref -r $testroot/repo-clone -l \ | grep "^refs/tags/$tag" | tr -d ' ' | cut -d: -f2` - local short_tag_id=`trim_obj_id 28 $tag_id` + local short_tag_id=`trim_obj_id 12 $tag_id` (printf "220\r\n250\r\n250\r\n250\r\n354\r\n250\r\n221\r\n" \ | timeout 5 nc -l "$GOTD_TEST_SMTP_PORT" > $testroot/stdout) & blob - d3b27ff7a41130bee6fe4caab834d5f8a3f31319 blob + a358917969feee72a0c5245f6bcfb0062556fe9d --- regress/gotd/http_notification.sh +++ regress/gotd/http_notification.sh @@ -403,7 +403,7 @@ test_many_commits_summarized() { echo "alpha $i" > $testroot/wt/alpha (cd $testroot/wt && got commit -m 'make changes' > /dev/null) local commit_id=`git_show_head $testroot/repo-clone` - local short_commit_id=`trim_obj_id 33 $commit_id` + local short_commit_id=`trim_obj_id 7 $commit_id` local author_time=`git_show_author_time $testroot/repo-clone` set -- "$@" "$short_commit_id $author_time" done blob - 2a1df1daa4d10bc1df74a5b3e633844cb71a60eb blob + 359a2b83b449269ee09d493e39bd5831e042b621 --- regress/tog/blame.sh +++ regress/tog/blame.sh @@ -48,10 +48,10 @@ WAIT_FOR_UI wait for blame to finish SCREENDUMP EOF - local commit_id1_short=`trim_obj_id 32 $commit_id1` - local commit_id2_short=`trim_obj_id 32 $commit_id2` - local commit_id3_short=`trim_obj_id 32 $commit_id3` - local commit_id4_short=`trim_obj_id 32 $commit_id4` + local commit_id1_short=`trim_obj_id 8 $commit_id1` + local commit_id2_short=`trim_obj_id 8 $commit_id2` + local commit_id3_short=`trim_obj_id 8 $commit_id3` + local commit_id4_short=`trim_obj_id 8 $commit_id4` cat <$testroot/view.expected commit $commit_id4 @@ -114,7 +114,7 @@ test_blame_commit_keywords() cat <<-EOF >$testroot/view.expected commit $id [1/1] /alpha - $(trim_obj_id 32 $(pop_idx 1 $@)) alpha + $(trim_obj_id 8 $(pop_idx 1 $@)) alpha @@ -174,13 +174,13 @@ test_blame_commit_keywords() cat <<-EOF >$testroot/view.expected commit $(pop_idx 8 $@) [1/7] /alpha - $(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 + $(trim_obj_id 8 $(pop_idx 2 $@)) alpha 1 + $(trim_obj_id 8 $(pop_idx 3 $@)) alpha 2 + $(trim_obj_id 8 $(pop_idx 4 $@)) alpha 3 + $(trim_obj_id 8 $(pop_idx 5 $@)) alpha 4 + $(trim_obj_id 8 $(pop_idx 6 $@)) alpha 5 + $(trim_obj_id 8 $(pop_idx 7 $@)) alpha 6 + $(trim_obj_id 8 $(pop_idx 8 $@)) alpha 7 EOF @@ -204,10 +204,10 @@ test_blame_commit_keywords() cat <<-EOF >$testroot/view.expected commit $(pop_idx 5 $@) [1/4] /alpha - $(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 8 $(pop_idx 2 $@)) alpha 1 + $(trim_obj_id 8 $(pop_idx 3 $@)) alpha 2 + $(trim_obj_id 8 $(pop_idx 4 $@)) alpha 3 + $(trim_obj_id 8 $(pop_idx 5 $@)) alpha 4 @@ -234,10 +234,10 @@ test_blame_commit_keywords() cat <<-EOF >$testroot/view.expected commit $(pop_idx 5 $@) [1/4] /alpha - $(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 8 $(pop_idx 2 $@)) alpha 1 + $(trim_obj_id 8 $(pop_idx 3 $@)) alpha 2 + $(trim_obj_id 8 $(pop_idx 4 $@)) alpha 3 + $(trim_obj_id 8 $(pop_idx 5 $@)) alpha 4 @@ -271,7 +271,7 @@ test_blame_commit_keywords() cat <<-EOF >$testroot/view.expected commit $(pop_idx 1 $@) [1/1] /alpha - $(trim_obj_id 32 $(pop_idx 1 $@)) alpha + $(trim_obj_id 8 $(pop_idx 1 $@)) alpha blob - 4801c9c97f0a63d5a0351ee3ab00ca40e143e5f5 blob + a0945c59f1b465237892c32f9f441c9c57773cca --- regress/tog/diff.sh +++ regress/tog/diff.sh @@ -28,7 +28,7 @@ test_diff_contiguous_commits() local author_time=`git_show_author_time $testroot/repo` local date=`date -u -r $author_time +"%a %b %e %X %Y UTC"` local head_id=`git_show_head $testroot/repo` - local head_id_truncated=`trim_obj_id 13 $head_id` + local head_id_truncated=`trim_obj_id 27 $head_id` local alpha_id=`get_blob_id $testroot/repo "" alpha` cat <$TOG_TEST_SCRIPT @@ -90,7 +90,7 @@ test_diff_arbitrary_commits() (cd $testroot/repo && git add new) git_commit $testroot/repo -m "new file" local head_id=`git_show_head $testroot/repo` - local head_id_truncated=`trim_obj_id 13 $head_id` + local head_id_truncated=`trim_obj_id 27 $head_id` local alpha_id=`get_blob_id $testroot/repo "" alpha` local new_id=`get_blob_id $testroot/repo "" new` @@ -499,7 +499,7 @@ test_diff_horizontal_scroll() local author_time=`git_show_author_time $testroot/repo` local date=`date -u -r $author_time +"%a %b %e %X %Y UTC"` local head_id=`git_show_head $testroot/repo` - local head_id_truncated=`trim_obj_id 13 $head_id` + local head_id_truncated=`trim_obj_id 27 $head_id` local alpha_id=`get_blob_id $testroot/repo "" alpha` cat <$TOG_TEST_SCRIPT blob - aca1f106300cbd9e2079fa5bedad94acb5af6f36 blob + 58c10dafb6236aba27ddab7d849f0e5fbb825d8b --- regress/tog/log.sh +++ regress/tog/log.sh @@ -135,7 +135,7 @@ test_log_show_author() local author_time=`git_show_author_time $testroot/repo` local date=`date -u -r $author_time +"%a %b %e %X %Y UTC"` local ymd=`date -u -r $author_time +"%F"` - local head_id_len8=`trim_obj_id 32 $head_id` + local head_id_len8=`trim_obj_id 8 $head_id` echo "mod alpha" > $testroot/repo/alpha cd $testroot/repo && git add . @@ -144,7 +144,7 @@ test_log_show_author() /dev/null local commit1=`git_show_head $testroot/repo` - local id1_len8=`trim_obj_id 32 $commit1` + local id1_len8=`trim_obj_id 8 $commit1` cat <$TOG_TEST_SCRIPT @ toggle show author @@ -399,11 +399,11 @@ test_log_commit_keywords() cat <<-EOF >$testroot/view.expected 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 + $ymd $(trim_obj_id 8 $(pop_idx 5 $@)) flan_hacker commit 4 + $ymd $(trim_obj_id 8 $(pop_idx 4 $@)) flan_hacker commit 3 + $ymd $(trim_obj_id 8 $(pop_idx 3 $@)) flan_hacker commit 2 + $ymd $(trim_obj_id 8 $(pop_idx 2 $@)) flan_hacker commit 1 + $ymd $(trim_obj_id 8 $(pop_idx 1 $@)) flan_hacker adding the test tree @@ -421,13 +421,13 @@ test_log_commit_keywords() cat <<-EOF >$testroot/view.expected 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 + $ymd $(trim_obj_id 8 $(pop_idx 7 $@)) flan_hacker commit 6 + $ymd $(trim_obj_id 8 $(pop_idx 6 $@)) flan_hacker commit 5 + $ymd $(trim_obj_id 8 $(pop_idx 5 $@)) flan_hacker commit 4 + $ymd $(trim_obj_id 8 $(pop_idx 4 $@)) flan_hacker commit 3 + $ymd $(trim_obj_id 8 $(pop_idx 3 $@)) flan_hacker commit 2 + $ymd $(trim_obj_id 8 $(pop_idx 2 $@)) flan_hacker commit 1 + $ymd $(trim_obj_id 8 $(pop_idx 1 $@)) flan_hacker adding the test tree EOF @@ -443,11 +443,11 @@ test_log_commit_keywords() cat <<-EOF >$testroot/view.expected 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 + $ymd $(trim_obj_id 8 $(pop_idx 5 $@)) flan_hacker commit 4 + $ymd $(trim_obj_id 8 $(pop_idx 4 $@)) flan_hacker commit 3 + $ymd $(trim_obj_id 8 $(pop_idx 3 $@)) flan_hacker ~commit 2 + $ymd $(trim_obj_id 8 $(pop_idx 2 $@)) flan_hacker commit 1 + $ymd $(trim_obj_id 8 $(pop_idx 1 $@)) flan_hacker adding the test tree @@ -473,7 +473,7 @@ test_log_commit_keywords() cat <<-EOF >$testroot/view.expected commit $(pop_idx 1 $@) [1/1] - $ymd $(trim_obj_id 32 $(pop_idx 1 $@)) flan_hacker adding the test tree + $ymd $(trim_obj_id 8 $(pop_idx 1 $@)) flan_hacker adding the test tree blob - dde6b39fc273ac652a3183be4339de99d649addc blob + 5cbc7739a8711a9a4c7f9cd93e48ae4fa9be6cf4 --- regress/tog/tree.sh +++ regress/tog/tree.sh @@ -54,8 +54,8 @@ test_tree_vsplit_blame() test_init tree_vsplit_blame 120 8 local head_id=`git_show_head $testroot/repo` - local head_id_truncated=`trim_obj_id 8 $head_id` - local head_id_short=`trim_obj_id 32 $head_id` + local head_id_truncated=`trim_obj_id 32 $head_id` + local head_id_short=`trim_obj_id 8 $head_id` cat <$TOG_TEST_SCRIPT KEY_ENTER @@ -91,8 +91,8 @@ test_tree_hsplit_blame() test_init tree_hsplit_blame 48 24 local head_id=`git_show_head $testroot/repo` - local head_id_truncated=`trim_obj_id 8 $head_id` - local head_id_short=`trim_obj_id 32 $head_id` + local head_id_truncated=`trim_obj_id 32 $head_id` + local head_id_short=`trim_obj_id 8 $head_id` cat <$TOG_TEST_SCRIPT j