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

[PATCH v4 0/3] apply with core.filemode=false

From
Junio C Hamano <gitster@pobox.com>
Date
Dec 26, 2023, 23:32 UTC
Message-ID
<20231226233218.472054-1-gitster@pobox.com>
In-Reply-To
<pull.1620.v3.git.1703066893657.gitgitgadget@gmail.com>

Chandra Pratap noticed that "git apply" on a filesystem without executable bit support gives a warning when applying a patch that expects the preimage file to have executable bit on. Dscho noticed that the initial fix by Chandra did not work well when applying a patch in reverse. It turns out that apply.c:reverse_patches() invalidates the "a patch that does not change mode bits have the mode bits in .old_mode member and not in .new_mode member" invariant we rely on.

Here is the result of concerted effort.
Chandra Pratap (1):
  apply: ignore working tree filemode when !core.filemode
Junio C Hamano (2):
  apply: correctly reverse patch's pre- and post-image mode bits
  apply: code simplification
 apply.c                   | 16 +++++++++++++---
 t/t4129-apply-samemode.sh | 27 +++++++++++++++++++++++++++
 2 files changed, 40 insertions(+), 3 deletions(-)
-- 
2.43.0-174-g055bb6e996
Previous: Junio C HamanoNext: Junio C Hamano
Message 15 of 21 in “Teach git apply to respect core.fileMode settings”
  1. Teach git apply to respect core.fileMode settingsChandra Pratap via GitGitGadget, Dec 18, 2023
  2. Junio C HamanoDec 18, 2023
  3. Junio C HamanoDec 18, 2023
  4. Chandra PratapDec 19, 2023
  5. Teach git apply to respect core.fileMode settingsChandra Pratap via GitGitGadget, Dec 19, 2023
  6. Torsten BögershausenDec 19, 2023
  7. Junio C HamanoDec 19, 2023
  8. Teach git apply to respect core.fileMode settingsChandra Pratap via GitGitGadget, Dec 20, 2023
  9. Johannes SchindelinDec 24, 2023
  10. Junio C HamanoDec 26, 2023
  11. Johannes SchindelinDec 26, 2023
  12. Junio C HamanoDec 26, 2023
  13. Junio C HamanoDec 26, 2023
  14. Junio C HamanoDec 26, 2023
  15. 0/3 apply with core.filemode=falseJunio C Hamano, Dec 26, 2023
  16. 1/3 apply: ignore working tree filemode when !core.filemodeJunio C Hamano, Dec 26, 2023
  17. 2/3 apply: correctly reverse patch's pre- and post-image mode bitsJunio C Hamano, Dec 26, 2023
  18. 3/3 apply: code simplificationJunio C Hamano, Dec 26, 2023
  19. Junio C HamanoFeb 7, 2024
  20. Johannes SchindelinFeb 18, 2024
  21. Junio C HamanoFeb 19, 2024

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.