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

confused by git diff --exit-code

From
BBogolisk <bogolisk@gmail.com>
Date
Oct 24, 2012, 10:33 UTC
Message-ID
<loom.20121024T122128-688@post.gmane.org>

With merge conflicts in the work-tree, diff's exit-code seems inconsistent. I thought --quiet implied --exit-code

/others/foo$ git diff --quiet /others/foo$ echo $? 1

/others/foo$ git diff --exit-code diff --cc foo.txt index f3dc283,bea67fd..0000000

--- a/foo.txt
+++ b/foo.txt
/others/foo$ echo $?
0

/others/foo$ git diff --cc --quiet
/others/foo$ echo $?
0

/others/foo$ git diff --cc --exit-code
diff --cc foo.txt
index f3dc283,bea67fd..0000000
--- a/foo.txt
+++ b/foo.txt
/others/foo$ echo $?
0
Message 1 of 1 in “confused by git diff --exit-code”
  1. BogoliskOct 24, 2012

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.