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

[PATCH v2 0/5] Apply comments of D. Ben Knoble

From
Michael Lohmann <git@lohmann.sh>
Date
Oct 13, 2025, 21:46 UTC
Message-ID
<20251013214608.33581-1-git@lohmann.sh>
In-Reply-To
<CALnO6CBLr2iL0r+ywM4Vjw0=J2DNFv9Nhhq_PHuxt4eK=Z95ww@mail.gmail.com>
Thanks!
Michael Lohmann (5):
  setup: rename `ensure_safe_repository()` for clarity
  setup: rename `die_upon_assumed_unsafe_repo()` to align with check
  setup: refactor `ensure_safe_repository()` testing priorities
  setup: allow temporary bypass of `ensure_safe_repository()` checks
  setup: allow not marking self owned repos as safe in
    `ensure_safe_repository()`
 Documentation/config/safe.adoc    |  9 ++++
 Documentation/git.adoc            | 25 +++++++++++
 builtin/clone.c                   |  2 +-
 environment.h                     |  2 +
 git.c                             |  9 ++++
 path.c                            |  4 +-
 setup.c                           | 45 ++++++++++++++------
 setup.h                           |  2 +-
 t/meson.build                     |  1 +
 t/t0036-allow-unsafe-directory.sh | 70 +++++++++++++++++++++++++++++++
 10 files changed, 153 insertions(+), 16 deletions(-)
 create mode 100755 t/t0036-allow-unsafe-directory.sh
Range-diff against v1:
1:  3f8805eb96 = 1:  3f8805eb96 setup: rename `ensure_safe_repository()` for clarity
2:  aa09159dec = 2:  aa09159dec setup: rename `die_upon_assumed_unsafe_repo()` to align with check
3:  ad4f64fdb8 = 3:  ad4f64fdb8 setup: refactor `ensure_safe_repository()` testing priorities
4:  db31fdef4e = 4:  db31fdef4e setup: allow temporary bypass of `ensure_safe_repository()` checks
5:  f65fd1c4fa ! 5:  6f710af1da setup: allow not marking self owned repos as safe in `ensure_safe_repository()`
    @@ Documentation/config/safe.adoc: which id the original user has.
     +safe.assumeUnsafe::
     +	Boolean to indicate that the ownership of a repository should not
     +	be taken into account when checking if the repository is safe. It
    -+	will prevent against accidental arbitrariy code execution
    ++	will prevent against accidental arbitrary code execution.
     ++
     +To temporarily allow git execution in case of an assumed unsafe repository,
     +run the command with `--allow-unsafe`. To permanently trust this path, add
    @@ Documentation/git.adoc: If you just want to run git as if it was started in `<pa
     +	Prevent arbitrary code execution by hooks or configuration if not
     +	executed in a "safe.directory". With setting this, filesystem ownership
     +	of the repository in question no longer satisfies to mark it as safe.
    -+	Equivalent to setting `GIT_ASSUME_UNSAFE=1`. This is overwritten if
    ++	Equivalent to setting `GIT_ASSUME_UNSAFE=1`. This is overridden if
     +	`--allow-unsafe` is passed as well.
     +
      GIT COMMANDS
    @@ Documentation/git.adoc: Git so take care if using a foreign front-end.
     +`GIT_ASSUME_UNSAFE`::
     +	This Boolean environment variable can be set to true enforce
     +	explicit "safe.directory" configuration for the repository. This
    -+	can be overwritten by setting `GIT_ALLOW_UNSAFE`.
    ++	can be overridden by setting `GIT_ALLOW_UNSAFE`.
     +
      `GIT_INDEX_FILE`::
      	This environment variable specifies an alternate
    @@ t/t0036-allow-unsafe-directory.sh: test_expect_success 'GIT_ALLOW_UNSAFE bool al
     +	grep "dubious ownership" err
     +'
     +
    -+test_expect_success 'allow-unsafe must overwrite assume-unsafe' '
    ++test_expect_success 'allow-unsafe must override assume-unsafe' '
     +	env GIT_ASSUME_UNSAFE=1 git --allow-unsafe status
     +'
     +
-- 
2.50.1 (Apple Git-155)
Previous: D. Ben KnobleNext: Michael Lohmann
Message 10 of 24 in “Allow enforcing safe.directory”
  1. 0/5 Allow enforcing safe.directoryMichael Lohmann, Oct 13, 2025
  2. 1/5 setup: rename `ensure_safe_repository()` for clarityMichael Lohmann, Oct 13, 2025
  3. 2/5 setup: rename `die_upon_assumed_unsafe_repo()` to align with checkMichael Lohmann, Oct 13, 2025
  4. Junio C HamanoOct 14, 2025
  5. 3/5 setup: refactor `ensure_safe_repository()` testing prioritiesMichael Lohmann, Oct 13, 2025
  6. Junio C HamanoOct 14, 2025
  7. 4/5 setup: allow temporary bypass of `ensure_safe_repository()` checksMichael Lohmann, Oct 13, 2025
  8. 5/5 setup: allow not marking self owned repos as safe in `ensure_safe_repository()`Michael Lohmann, Oct 13, 2025
  9. D. Ben KnobleOct 13, 2025
  10. 0/5 Apply comments of D. Ben KnobleMichael Lohmann, Oct 13, 2025
  11. 1/5 setup: rename `ensure_safe_repository()` for clarityMichael Lohmann, Oct 13, 2025
  12. 2/5 setup: rename `die_upon_assumed_unsafe_repo()` to align with checkMichael Lohmann, Oct 13, 2025
  13. 3/5 setup: refactor `ensure_safe_repository()` testing prioritiesMichael Lohmann, Oct 13, 2025
  14. 4/5 setup: allow temporary bypass of `ensure_safe_repository()` checksMichael Lohmann, Oct 13, 2025
  15. 5/5 setup: allow not marking self owned repos as safe in `ensure_safe_repository()`Michael Lohmann, Oct 13, 2025
  16. 0/5 Allow skipping ownership of repo in safety considerationMichael Lohmann, Oct 16, 2025
  17. 3/5 setup: refactor `ensure_safe_repository()` testing prioritiesMichael Lohmann, Oct 16, 2025
  18. 1/5 setup: rename `ensure_safe_repository()` for clarityMichael Lohmann, Oct 16, 2025
  19. 2/5 setup: rename `die_upon_unsafe_repo()` to align with checkMichael Lohmann, Oct 16, 2025
  20. 4/5 setup: allow temporary bypass of `ensure_safe_repository()` checksMichael Lohmann, Oct 16, 2025
  21. Junio C HamanoOct 16, 2025
  22. 5/5 setup: allow not marking self owned repos as safe in `ensure_safe_repository()`Michael Lohmann, Oct 16, 2025
  23. Junio C HamanoOct 16, 2025
  24. Junio C HamanoOct 16, 2025

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.