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

git diff-files bug

From
JRJosh Reed <jriddy@gmail.com>
Date
Dec 19, 2023, 16:53 UTC
Message-ID
<CAELOy+5AsRyLEs-WdYw1spqkmMDKjKSQzbogAoRBFe-zGLjvXg@mail.gmail.com>

Thank you for filling out a Git bug report! Please answer the following questions to help us understand your issue.

What did you do before the bug happened? (Steps to reproduce your issue)
> bash

⬢[jreed@toolbox example-project]$ git diff-files --exit-code --patch; echo $? 0 ⬢[jreed@toolbox example-project]$ chmod g+w README.md ⬢[jreed@toolbox example-project]$ git diff-files --exit-code --patch; echo $? 1 ⬢[jreed@toolbox example-project]$ git diff --exit-code --patch; echo $? 0 ⬢[jreed@toolbox example-project]$ git diff-files --exit-code --patch; echo $? 0

What did you expect to happen? (Expected behavior)

Git diff-files should likely ignore group permissions changes, or at least its output should be stable across the same worktree/index state.

What happened instead? (Actual behavior)

The command `git diff-files --exit-code --patch` fails with no exit code when a file mode has changed in a way that the rest of git commands ignored. Furthermore, subsequent git commands seem to change the behavior of `git diff-files` in this regard, so it's hard to tell what is the expected behavior.

What's different between what you expected and what actually happened?

The `git diff-files --exit-code` command is inconsistent in how it behaves. I suspect it should ignore irrelavant mode changes like `g+w`, but even if it should report them, they should produce a patch or at least have stable results when we re-run the command.

Anything else you want to add:

Please review the rest of the bug report below. You can delete any lines you don't wish to share.

[System Info] git version: git version 2.41.0 cpu: x86_64 no commit associated with this build sizeof-long: 8 sizeof-size_t: 8 shell-path: /bin/sh uname: Linux 6.5.10-200.fc38.x86_64 #1 SMP PREEMPT_DYNAMIC Thu Nov 2 19:59:55 UTC 2023 x86_64 compiler info: gnuc: 13.1 libc info: glibc: 2.37 $SHELL (typically, interactive shell): /usr/bin/fish

[Enabled Hooks] pre-commit pre-push

Next: Elijah Newren
Message 1 of 2 in “git diff-files bug”
  1. Josh ReedDec 19, 2023
  2. Elijah NewrenDec 19, 2023

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.