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

RE: [EXTERNAL] RE: git bug report

From
PWPaul Watson <pwatson2@wellmed.net>
Date
Aug 4, 2023, 17:48 UTC
Message-ID
<MW2PR12MB2555BB4CEE6BA6B38F4381428709A@MW2PR12MB2555.namprd12.prod.outlook.com>
In-Reply-To
<015101d9c6f9$218ceb20$64a6c160$@nexbridge.com>
-----Original Message-----
From: rsbecker@nexbridge.com <rsbecker@nexbridge.com> 
Sent: Friday, August 4, 2023 12:29
>> Can you retry this without --shortstat so we can see what git is
>> reporting as a difference.
The problem appears to be the use of --shortstat. When --shortstat is not used, the exit code for different files is one (1), as expected.

12:46:56.88 2023-08-04 C:\src\t\scripts>TYPE t1.txt this is t1.txt this is t1.txt this is t1.txt

12:47:01.88 2023-08-04 C:\src\t\scripts>type t2.txt this is t2.txt this is t2.txt this is t2.txt

12:47:06.41 2023-08-04  C:\src\t\scripts>"C:\Program Files\Git\cmd\git.exe" diff --exit-code --no-index  --ignore-all-space --shortstat .\t1.txt .\t2.txt
 1 file changed, 3 insertions(+), 3 deletions(-)

12:47:18.22 2023-08-04 C:\src\t\scripts>ECHO %ERRORLEVEL% 0

12:47:20.61 2023-08-04  C:\src\t\scripts>"C:\Program Files\Git\cmd\git.exe" diff --exit-code --no-index --ignore-all-space .\t1.txt .\t2.txt
diff --git a/./t1.txt b/./t2.txt
index 6dfb884..66812c5 100644
--- a/./t1.txt
+++ b/./t2.txt
@@ -1,3 +1,3 @@
-this is t1.txt
-this is t1.txt
-this is t1.txt
+this is t2.txt
+this is t2.txt
+this is t2.txt

12:47:27.71 2023-08-04  C:\src\t\scripts>ECHO %ERRORLEVEL%
1

12:47:30.32 2023-08-04  C:\src\t\scripts>"C:\Program Files\Git\cmd\git.exe" diff --quiet --exit-code --no-index --ignore-all-space .\t1.txt .\t2.txt

12:47:36.58 2023-08-04  C:\src\t\scripts>ECHO %ERRORLEVEL%
1
This e-mail, including attachments, may include confidential and/or
proprietary information, and may be used only by the person or entity
to which it is addressed. If the reader of this e-mail is not the intended
recipient or intended recipient’s authorized agent, the reader is hereby
notified that any dissemination, distribution or copying of this e-mail is
prohibited. If you have received this e-mail in error, please notify the
sender by replying to this message and delete this e-mail immediately.
Previous: rsbecker@nexbridge.comNext: rsbecker@nexbridge.com
Message 3 of 36 in “git bug report”
  1. Paul WatsonAug 4, 2023
  2. rsbecker@nexbridge.comAug 4, 2023
  3. Paul WatsonAug 4, 2023
  4. rsbecker@nexbridge.comAug 4, 2023
  5. Paul WatsonAug 7, 2023
  6. Paul WatsonAug 8, 2023
  7. rsbecker@nexbridge.comAug 8, 2023
  8. Junio C HamanoAug 8, 2023
  9. diff: tighten interaction between -w and --exit-codeJunio C Hamano, Aug 16, 2023
  10. Jeff KingAug 17, 2023
  11. Junio C HamanoAug 17, 2023
  12. Jeff KingAug 17, 2023
  13. Junio C HamanoAug 17, 2023
  14. 0/5 fix interactions with "-w" and "--exit-code"Junio C Hamano, Aug 17, 2023
  15. 1/5 diff: --dirstat leakfixJunio C Hamano, Aug 17, 2023
  16. 2/5 diff: move the fallback "--exit-code" code downJunio C Hamano, Aug 17, 2023
  17. 3/5 diff: mode-only change should be noticed by "--patch -w --exit-code"Junio C Hamano, Aug 17, 2023
  18. Junio C HamanoAug 18, 2023
  19. 4/5 diff: teach "--stat -w --exit-code" to notice differencesJunio C Hamano, Aug 17, 2023
  20. 5/5 diff: teach "--name-status" and friends to honor "--exit-code -w"Junio C Hamano, Aug 17, 2023
  21. Junio C HamanoAug 17, 2023
  22. 0/5 fix interactions with "-w" and "--exit-code"Junio C Hamano, Aug 18, 2023
  23. 2/5 diff: mode-only change should be noticed by "--patch -w --exit-code"Junio C Hamano, Aug 18, 2023
  24. 3/5 diff: teach "--stat -w --exit-code" to notice differencesJunio C Hamano, Aug 18, 2023
  25. Jeff KingAug 21, 2023
  26. 4/5 t4040: remove test that succeeded for a wrong reasonJunio C Hamano, Aug 18, 2023
  27. 1/5 diff: move the fallback "--exit-code" code downJunio C Hamano, Aug 18, 2023
  28. Jeff KingAug 21, 2023
  29. 5/5 diff: the -w option breaks --exit-code for --raw and other output modesJunio C Hamano, Aug 18, 2023
  30. Jeff KingAug 21, 2023
  31. Jeff KingAug 21, 2023
  32. Jeff KingAug 21, 2023
  33. Junio C HamanoAug 21, 2023
  34. Junio C HamanoAug 21, 2023
  35. Jeff KingAug 22, 2023
  36. Jeff KingAug 21, 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.