git/list[1] front-page[2] threads[3] people[4] search[5] about
 

Re: [PATCH] apply: don't use core.sharedRepository to create working tree files

From
Adam Dinwoodie <adam@dinwoodie.org>
Date
Dec 19, 2020, 17:51 UTC
Message-ID
<CA+kUOamDD_SDNLk3sPSwNAojrAAP+g38MjkfG4JMPRTGOVAKAQ@mail.gmail.com>
In-Reply-To
<3f0403b84ab06b9deb7c5c189792bebe1db586a7.1606866276.git.matheus.bernardino@usp.br>

This commit – eb3c027e17 ("apply: don't use core.sharedRepository to create working tree files", 2020-12-01) – seems to have introduced a new test failure in the Cygwin builds for v2.30.0-rc0, and which is still present in rc1. I'm not quite sure I understand what the expected behaviour here is, but I expect the issue is down to Cygwin's slightly odd file permission handling.

To my surprise, the test fails if the worktree is under "/cygdrive", but not if it's under "/home" within the Cygwin filesystem. I expect this is some complexity with Cygwin's mount handling, but it's not a failure mode I've seen before. I'm also going to follow up on the Cygwin mailing list to see if the folk with a better understanding of Cygwin's filesystem wrangling have a better understanding of what's going on.

Extract from the relevant section of ./t4129-apply-samemode.sh -x output, when run with that commit checked out, below:

expecting 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
++ ls -ld f1
++ sed -e 's|^\(..........\).*|\1|'
++ test_modebits d
++ ls -ld d
++ sed -e 's|^\(..........\).*|\1|'
++ test_cmp f1_mode.expected f1_mode.actual
++ test 2 -eq 2
++ eval 'diff -u' '"$@"'
+++ diff -u f1_mode.expected f1_mode.actual
--- f1_mode.expected    2020-12-19 16:50:20.169378700 +0000
+++ f1_mode.actual      2020-12-19 16:50:20.249126000 +0000
@@ -1 +1 @@
--rw-------
+-rw-rw-r--
++ test xf1_mode.expected = x-
++ test -e f1_mode.expected
++ test xf1_mode.actual = x-
++ test -e f1_mode.actual
++ return 1
error: last command exited with $?=1
++ test_unconfig core.sharedRepository
++ config_dir=
++ test core.sharedRepository = -C
++ git config --unset-all core.sharedRepository
++ config_status=0
++ case "$config_status" in
++ return 0
++ exit 1
++ eval_ret=1
++ :
Previous: Junio C HamanoNext: Junio C Hamano
Message 5 of 17 in “Is git-am expected to honor core.sharedRepository?”
  1. Matheus Tavares BernardinoDec 1, 2020
  2. Junio C HamanoDec 1, 2020
  3. apply: don't use core.sharedRepository to create working tree filesMatheus Tavares, Dec 1, 2020
  4. Junio C HamanoDec 2, 2020
  5. Adam DinwoodieDec 19, 2020
  6. Junio C HamanoDec 19, 2020
  7. Adam DinwoodieDec 19, 2020
  8. Achim GratzDec 19, 2020
  9. Adam DinwoodieDec 19, 2020
  10. Achim GratzDec 19, 2020
  11. Adam DinwoodieDec 22, 2020
  12. Matheus Tavares BernardinoDec 22, 2020
  13. t4129: fix setfacl-related permissions failureAdam Dinwoodie, Dec 23, 2020
  14. Matheus Tavares BernardinoJan 9, 2021
  15. Junio C HamanoJan 9, 2021
  16. Junio C HamanoDec 2, 2020
  17. Matheus Tavares BernardinoDec 3, 2020

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.