Thanks Christian and Matheus,
Attached is the redirected output of t4129.
I noticed Alpine does not provide setfacl:
$ setfacl -k newdir
-sh: setfacl: not foundJeff
Initialized empty Git repository in /home/jwalton/Build-Scripts/git-2.30.0/t/trash directory.t4129-apply-samemode/.git/
expecting success of 4129.1 'setup':
echo original >file &&
git add file &&
test_tick &&
git commit -m initial &&
git tag initial &&
echo modified >file &&
git diff --stat -p >patch-0.txt &&
chmod +x file &&
git diff --stat -p >patch-1.txt &&
sed "s/^\(new mode \).*/\1/" <patch-1.txt >patch-empty-mode.txt &&
sed "s/^\(new mode \).*/\1garbage/" <patch-1.txt >patch-bogus-mode.txt
+ echo original
+ git add file
+ test_tick
+ test -z
+ test_tick=1112911993
+ GIT_COMMITTER_DATE='1112911993 -0700'
+ GIT_AUTHOR_DATE='1112911993 -0700'
+ export GIT_COMMITTER_DATE GIT_AUTHOR_DATE
+ git commit -m initial
[master (root-commit) e950771] initial
Author: A U Thor <author@example.com>
1 file changed, 1 insertion(+)
create mode 100644 file
+ git tag initial
+ echo modified
+ git diff --stat -p
+ chmod +x file
+ git diff --stat -p
+ sed 's/^\(new mode \).*/\1/'
+ sed 's/^\(new mode \).*/\1garbage/'
ok 1 - setup
checking prerequisite: FILEMODE
mkdir -p "$TRASH_DIRECTORY/prereq-test-dir-FILEMODE" &&
(
cd "$TRASH_DIRECTORY/prereq-test-dir-FILEMODE" &&
test "$(git config --bool core.filemode)" = true
)
+ mkdir -p '/home/jwalton/Build-Scripts/git-2.30.0/t/trash directory.t4129-apply-samemode/prereq-test-dir-FILEMODE'
+ cd '/home/jwalton/Build-Scripts/git-2.30.0/t/trash directory.t4129-apply-samemode/prereq-test-dir-FILEMODE'
+ git config --bool core.filemode
+ test true '=' true
prerequisite FILEMODE ok
expecting success of 4129.2 'same mode (no index)':
git reset --hard &&
chmod +x file &&
git apply patch-0.txt &&
test -x file
+ git reset --hard
HEAD is now at e950771 initial
+ chmod +x file
+ git apply patch-0.txt
warning: file has type 100755, expected 100644
+ test -x file
ok 2 - same mode (no index)
expecting success of 4129.3 'same mode (with index)':
git reset --hard &&
chmod +x file &&
git add file &&
git apply --index patch-0.txt &&
test -x file &&
git diff --exit-code
+ git reset --hard
HEAD is now at e950771 initial
+ chmod +x file
+ git add file
+ git apply --index patch-0.txt
warning: file has type 100755, expected 100644
+ test -x file
+ git diff --exit-code
ok 3 - same mode (with index)
expecting success of 4129.4 'same mode (index only)':
git reset --hard &&
chmod +x file &&
git add file &&
git apply --cached patch-0.txt &&
git ls-files -s file | grep "^100755"
+ git reset --hard
HEAD is now at e950771 initial
+ chmod +x file
+ git add file
+ git apply --cached patch-0.txt
warning: file has type 100755, expected 100644
+ git ls-files -s file
+ grep ^100755
100755 2e0996000b7e9019eabcad29391bf0f5c7702f0b 0 file
ok 4 - same mode (index only)
expecting success of 4129.5 'mode update (no index)':
git reset --hard &&
git apply patch-1.txt &&
test -x file
+ git reset --hard
HEAD is now at e950771 initial
+ git apply patch-1.txt
+ test -x file
ok 5 - mode update (no index)
expecting success of 4129.6 'mode update (with index)':
git reset --hard &&
git apply --index patch-1.txt &&
test -x file &&
git diff --exit-code
+ git reset --hard
HEAD is now at e950771 initial
+ git apply --index patch-1.txt
+ test -x file
+ git diff --exit-code
ok 6 - mode update (with index)
expecting success of 4129.7 'mode update (index only)':
git reset --hard &&
git apply --cached patch-1.txt &&
git ls-files -s file | grep "^100755"
+ git reset --hard
HEAD is now at e950771 initial
+ git apply --cached patch-1.txt
+ git ls-files -s file
+ grep ^100755
100755 2e0996000b7e9019eabcad29391bf0f5c7702f0b 0 file
ok 7 - mode update (index only)
expecting success of 4129.8 'empty mode is rejected':
git reset --hard &&
test_must_fail git apply patch-empty-mode.txt 2>err &&
test_i18ngrep "invalid mode" err
+ git reset --hard
HEAD is now at e950771 initial
+ test_must_fail git apply patch-empty-mode.txt
+ _test_ok=
+ test_must_fail_acceptable git apply patch-empty-mode.txt
+ test git '=' env
+ return 0
+ git apply patch-empty-mode.txt
+ exit_code=128
+ test 128 -eq 0
+ test_match_signal 13 128
+ test 128 '=' 141
+ test 128 '=' 269
+ return 1
+ test 128 -gt 129
+ test 128 -eq 127
+ test 128 -eq 126
+ return 0
+ test_i18ngrep 'invalid mode' err
+ eval 'last_arg=${2}'
+ last_arg=err
+ test -f err
+ test 2 -lt 2
+ test 'x!' '=' 'xinvalid mode'
+ test_have_prereq '!C_LOCALE_OUTPUT'
+ save_IFS='
'
+ IFS=,
+ set -- '!C_LOCALE_OUTPUT'
+ IFS='
'
+ total_prereq=0
+ ok_prereq=0
+ missing_prereq=
+ negative_prereq=t
+ prerequisite=C_LOCALE_OUTPUT
+ eval 'script=$test_prereq_lazily_C_LOCALE_OUTPUT'
+ script='
! test_bool_env GIT_TEST_GETTEXT_POISON false
'
+ test_run_lazy_prereq_ C_LOCALE_OUTPUT '
! test_bool_env GIT_TEST_GETTEXT_POISON false
'
+ script='
mkdir -p "$TRASH_DIRECTORY/prereq-test-dir-C_LOCALE_OUTPUT" &&
(
cd "$TRASH_DIRECTORY/prereq-test-dir-C_LOCALE_OUTPUT" &&
! test_bool_env GIT_TEST_GETTEXT_POISON false)'
+ say 'checking prerequisite: C_LOCALE_OUTPUT'
+ say_color info 'checking prerequisite: C_LOCALE_OUTPUT'
+ test -z info
+ shift
+ printf '%s\n' 'checking prerequisite: C_LOCALE_OUTPUT'
checking prerequisite: C_LOCALE_OUTPUT
+ say '
mkdir -p "$TRASH_DIRECTORY/prereq-test-dir-C_LOCALE_OUTPUT" &&
(
cd "$TRASH_DIRECTORY/prereq-test-dir-C_LOCALE_OUTPUT" &&
! test_bool_env GIT_TEST_GETTEXT_POISON false
)'
+ say_color info '
mkdir -p "$TRASH_DIRECTORY/prereq-test-dir-C_LOCALE_OUTPUT" &&
(
cd "$TRASH_DIRECTORY/prereq-test-dir-C_LOCALE_OUTPUT" &&
! test_bool_env GIT_TEST_GETTEXT_POISON false
)'
+ test -z info
+ shift
+ printf '%s\n' '
mkdir -p "$TRASH_DIRECTORY/prereq-test-dir-C_LOCALE_OUTPUT" &&
(
cd "$TRASH_DIRECTORY/prereq-test-dir-C_LOCALE_OUTPUT" &&
! test_bool_env GIT_TEST_GETTEXT_POISON false
)'
mkdir -p "$TRASH_DIRECTORY/prereq-test-dir-C_LOCALE_OUTPUT" &&
(
cd "$TRASH_DIRECTORY/prereq-test-dir-C_LOCALE_OUTPUT" &&
! test_bool_env GIT_TEST_GETTEXT_POISON false
)
+ test_eval_ '
mkdir -p "$TRASH_DIRECTORY/prereq-test-dir-C_LOCALE_OUTPUT" &&
(
cd "$TRASH_DIRECTORY/prereq-test-dir-C_LOCALE_OUTPUT" &&
! test_bool_env GIT_TEST_GETTEXT_POISON false
)'
+ test_eval_inner_ '
mkdir -p "$TRASH_DIRECTORY/prereq-test-dir-C_LOCALE_OUTPUT" &&
(
cd "$TRASH_DIRECTORY/prereq-test-dir-C_LOCALE_OUTPUT" &&
! test_bool_env GIT_TEST_GETTEXT_POISON false
)'
+ eval '
want_trace && trace_level_=2 && set -x
mkdir -p "$TRASH_DIRECTORY/prereq-test-dir-C_LOCALE_OUTPUT" &&
(
cd "$TRASH_DIRECTORY/prereq-test-dir-C_LOCALE_OUTPUT" &&
! test_bool_env GIT_TEST_GETTEXT_POISON false
)'
+ want_trace
+ test t '=' t
+ test t '=' t
+ trace_level_=2
+ set -x
+ mkdir -p '/home/jwalton/Build-Scripts/git-2.30.0/t/trash directory.t4129-apply-samemode/prereq-test-dir-C_LOCALE_OUTPUT'
+ cd '/home/jwalton/Build-Scripts/git-2.30.0/t/trash directory.t4129-apply-samemode/prereq-test-dir-C_LOCALE_OUTPUT'
+ test_bool_env GIT_TEST_GETTEXT_POISON false
+ test 2 '!=' 2
+ git env--helper '--type=bool' '--default=false' --exit-code GIT_TEST_GETTEXT_POISON
+ ret=1
+ return 1
+ test 0 '!=' 0
+ return 0
+ eval_ret=0
+ rm -rf '/home/jwalton/Build-Scripts/git-2.30.0/t/trash directory.t4129-apply-samemode/prereq-test-dir-C_LOCALE_OUTPUT'
+ test 0 '=' 0
+ say 'prerequisite C_LOCALE_OUTPUT ok'
+ say_color info 'prerequisite C_LOCALE_OUTPUT ok'
+ test -z info
+ shift
+ printf '%s\n' 'prerequisite C_LOCALE_OUTPUT ok'
prerequisite C_LOCALE_OUTPUT ok
+ return 0
+ test_set_prereq C_LOCALE_OUTPUT
+ test -n
+ satisfied_prereq=' POSIXPERM BSLASHPSPEC EXECKEEPSPID COLUMNS_CAN_BE_1 PERL PTHREADS PYTHON PCRE LIBPCRE2 GETTEXT FILEMODE C_LOCALE_OUTPUT '
+ lazily_tested_prereq='FILEMODE C_LOCALE_OUTPUT '
+ total_prereq=1
+ satisfied_this_prereq=t
+ prerequisite='!C_LOCALE_OUTPUT'
+ test -z
+ missing_prereq='!C_LOCALE_OUTPUT'
+ test 1 '=' 0
+ test 'x!' '=' 'xinvalid mode'
+ grep 'invalid mode' err
error: invalid mode on line 5:
+ return 0
ok 8 - empty mode is rejected
expecting success of 4129.9 'bogus mode is rejected':
git reset --hard &&
test_must_fail git apply patch-bogus-mode.txt 2>err &&
test_i18ngrep "invalid mode" err
+ git reset --hard
HEAD is now at e950771 initial
+ test_must_fail git apply patch-bogus-mode.txt
+ _test_ok=
+ test_must_fail_acceptable git apply patch-bogus-mode.txt
+ test git '=' env
+ return 0
+ git apply patch-bogus-mode.txt
+ exit_code=128
+ test 128 -eq 0
+ test_match_signal 13 128
+ test 128 '=' 141
+ test 128 '=' 269
+ return 1
+ test 128 -gt 129
+ test 128 -eq 127
+ test 128 -eq 126
+ return 0
+ test_i18ngrep 'invalid mode' err
+ eval 'last_arg=${2}'
+ last_arg=err
+ test -f err
+ test 2 -lt 2
+ test 'x!' '=' 'xinvalid mode'
+ test_have_prereq '!C_LOCALE_OUTPUT'
+ save_IFS='
'
+ IFS=,
+ set -- '!C_LOCALE_OUTPUT'
+ IFS='
'
+ total_prereq=0
+ ok_prereq=0
+ missing_prereq=
+ negative_prereq=t
+ prerequisite=C_LOCALE_OUTPUT
+ total_prereq=1
+ satisfied_this_prereq=t
+ prerequisite='!C_LOCALE_OUTPUT'
+ test -z
+ missing_prereq='!C_LOCALE_OUTPUT'
+ test 1 '=' 0
+ test 'x!' '=' 'xinvalid mode'
+ grep 'invalid mode' err
error: invalid mode on line 5: garbage
+ return 0
ok 9 - bogus mode is rejectedexpecting success of 4129.10 'do not use core.sharedRepository for working tree files':
git reset --hard &&
test_config core.sharedRepository 0666 &&
(
# Remove a default ACL if possible.
(setfacl -k newdir 2>/dev/null || true) &&
umask 0077 &&
# Test both files (f1) and leading dirs (d)
mkdir d &&
touch f1 d/f2 &&
git add f1 d/f2 &&
git diff --staged >patch-f1-and-f2.txt &&
rm -rf d f1 &&
git apply patch-f1-and-f2.txt &&
echo "-rw-------" >f1_mode.expected &&
echo "drwx------" >d_mode.expected &&
test_modebits f1 >f1_mode.actual &&
test_modebits d >d_mode.actual &&
test_cmp f1_mode.expected f1_mode.actual &&
test_cmp d_mode.expected d_mode.actual
)
+ git reset --hard
HEAD is now at e950771 initial
+ test_config core.sharedRepository 0666
+ config_dir=
+ test core.sharedRepository '=' -C
+ test_when_finished 'test_unconfig '"'"'core.sharedRepository'"'"
+ test 0 '=' 0
+ test_cleanup='{ test_unconfig '"'"'core.sharedRepository'"'"'
} && (exit "$eval_ret"); eval_ret=$?; :'
+ git config core.sharedRepository 0666
+ setfacl -k newdir
+ true
+ umask 0077
+ mkdir d
+ touch f1 d/f2
+ git add f1 d/f2
+ git diff --staged
+ rm -rf d f1
+ git apply patch-f1-and-f2.txt
+ echo -rw-------
+ echo drwx------
+ test_modebits f1
+ + sed -els 's|^\(..........\).*|\1|' -ld
f1
+ test_modebits d
+ ls+ -ld dsed
-e 's|^\(..........\).*|\1|'
+ test_cmp f1_mode.expected f1_mode.actual
+ eval 'diff -u' '"$@"'
+ diff -u f1_mode.expected f1_mode.actual
+ test_cmp d_mode.expected d_mode.actual
+ eval 'diff -u' '"$@"'
+ diff -u d_mode.expected d_mode.actual
--- d_mode.expected
+++ d_mode.actual