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

git diff --exit-code misbehaving in 2.46.x

From
JWJan Wendland <jwend1703@gmail.com>
Date
Sep 25, 2024, 14:27 UTC
Message-ID
<CAB0mhhz9LHZ1AWSu_0oM=c89+z0w=XemnQwFAm45wp8zSmQ1Sw@mail.gmail.com>
Hey team,

git diff --exit-code in 2.46.x is unexpectedly returning a zero exit code for files marked as binary in .gitattributes where 2.45.x would correctly produce a non-zero exit code.

To reproduce: mkdir -p git-exit-code/dist cd git-exit-code git init echo "hi" > dist/main.js echo "dist/** binary" > .gitattributes git add --all git commit -m "Initial commit" echo "some change" >> dist/main.js git diff --exit-code echo $? # actual is 0, expected to be 1

Is this intended?

Kind regards Jan

Next: René Scharfe
Message 1 of 4 in “git diff --exit-code misbehaving in 2.46.x”
  1. Jan WendlandSep 25, 2024
  2. René ScharfeSep 25, 2024
  3. Junio C HamanoSep 25, 2024
  4. René ScharfeSep 25, 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.