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

Re: git-diff: must --exit-code work with --ignore* options?

From
Jim Meyering <jim@meyering.net>
Date
Aug 30, 2009, 20:27 UTC
Message-ID
<87fxb9ujxl.fsf@meyering.net>
In-Reply-To
<7vljl1dpud.fsf@alter.siamese.dyndns.org>
Junio C Hamano wrote:
Show 22 quoted lines
> Jim Meyering <jim@meyering.net> writes:
>> Junio C Hamano wrote:
>> ...
>>> Subject: [PATCH] diff --quiet: special case "ignore whitespace" options
>>> ...
>>> Change the semantics of --ignore-whitespace* options to mean more than
>>> "omit showing the difference in text".  When these options are used, the
>>> internal "quick" optimization is turned off, and the status reported with
>>> the --exit-code option will now match if any the textual diff output is
>>> actually produced.
>>>
>>> Also rename the internal option "QUIET" to "QUICK" to better reflect what
>>> its true purpose is.
>>
>> Thanks again.
>> If there's anything I can to do help (add a test?), let me know.
>
> The change has been cooking in 'next' and hopefully be in 1.7.0.  I think
> the updated series adds its own test script, too.
>
> Using it in every day scenario, and reporting any breakage you notice
> before 1.7.0 happens, would be greatly appreciated.

Oh! I am using next (will test!), and even searched log summary output, but obviously my search was too cursory or just inaccurate.

I glanced through it and it looks fine (of course!). I spotted one typo, and suggest a second change that's barely worth mentioning, both in comments:

diff --git a/diff.c b/diff.c
index 91d6ea2..24bd3fc 100644
--- a/diff.c
+++ b/diff.c
@@ -2382,7 +2382,7 @@ int diff_setup_done(struct diff_options *options)
 	 * Most of the time we can say "there are changes"
 	 * only by checking if there are changed paths, but
 	 * --ignore-whitespace* options force us to look
-	 * inside contets.
+	 * inside contents.
 	 */

 	if (DIFF_XDL_TST(options, IGNORE_WHITESPACE) ||
@@ -3346,7 +3346,7 @@ free_queue:
 		fclose(options->file);

 	/*
-	 * Report the contents level differences with HAS_CHANGES;
+	 * Report the content-level differences with HAS_CHANGES;
 	 * diff_addremove/diff_change does not set the bit when
 	 * DIFF_FROM_CONTENTS is in effect (e.g. with -w).
 	 */
Previous: Junio C HamanoNext: Thell Fowler
Message 8 of 9 in “git-diff: must --exit-code work with --ignore* options?”
  1. Jim MeyeringMay 22, 2009
  2. Junio C HamanoMay 22, 2009
  3. Jim MeyeringMay 22, 2009
  4. Junio C HamanoMay 22, 2009
  5. Jim MeyeringMay 23, 2009
  6. Jim MeyeringAug 30, 2009
  7. Junio C HamanoAug 30, 2009
  8. Jim MeyeringAug 30, 2009
  9. Thell FowlerSep 8, 2009

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.