git@vger.kernel.org mailing list mirror (one of many)
 help / color / mirror / code / Atom feed
From: Jake Zimmerman <jake@zimmerman.io>
To: git@vger.kernel.org
Subject: Regression in `git diff --quiet HEAD` when a new file is staged
Date: Thu, 16 Oct 2025 17:09:07 -0700	[thread overview]
Message-ID: <CACJRbWjwOQwJB13CwTfvhV3p+Hbn4KrNM9AtBanGtUS4V_1MbQ@mail.gmail.com> (raw)

In git v2.51.1, `git diff --quiet HEAD` will actually print something
if the diff output includes a new, staged file.

## To reproduce

    ❯ mkdir foo
    ❯ cd foo
    ❯ git init .
    Initialized empty Git repository in /Users/jez/foo/.git/
    ❯ gc --allow-empty -m "Initial empty commit"
    [master (root-commit) 858966f] Initial empty commit
    ❯ touch foo.txt
    ❯ git add foo.txt
    ❯ git diff --quiet HEAD

On git v2.51.0, the output of the last command is empty.
On git v2.51.1, the output of the last command is this:

    diff --git a/foo.txt b/foo.txt
    new file mode 100644
    index 0000000..e69de29

## Expected behavior

The stated docs for `--quiet`: "Disable all output of the program," so
I expect there to be no output, like in older versions.

## Likely cause

I ran a git bisect and isolated this commit:

b55e6d36ebce69136559add8fffd1a65df231518
( https://github.com/git/git/commit/e1d3d61a45bfdc5031d2066c0e4505ebd8145777 )

"diff: ensure consistent diff behavior with ignore options"


             reply	other threads:[~2025-10-17  0:09 UTC|newest]

Thread overview: 27+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-10-17  0:09 Jake Zimmerman [this message]
2025-10-17  7:51 ` Regression in `git diff --quiet HEAD` when a new file is staged Jeff King
2025-10-17  8:36   ` [PATCH] diff: restore redirection to /dev/null for diff_from_contents Jeff King
2025-10-17 18:22     ` Junio C Hamano
2025-10-19 21:09     ` Johannes Schindelin
2025-10-21  7:52       ` Jeff King
2025-10-17 11:44   ` Regression in `git diff --quiet HEAD` when a new file is staged Johannes Schindelin
2025-10-17 17:45   ` Junio C Hamano
2025-10-18  1:04     ` Lidong Yan
2025-10-18  9:42       ` Jeff King
2025-10-18  9:40     ` Jeff King
2025-10-18 15:23       ` Junio C Hamano
2025-10-21  7:36         ` Jeff King
2025-10-21 14:38           ` Junio C Hamano
2025-10-22  4:46             ` Lidong Yan
2025-10-22  9:14               ` Jeff King
2025-10-22 14:20                 ` Lidong Yan
2025-10-22 14:31               ` Junio C Hamano
2025-10-22 16:28                 ` Junio C Hamano
2025-10-22  9:11             ` Jeff King
2025-10-22 16:48               ` Junio C Hamano
2025-10-23 12:01                 ` Jeff King
2025-10-23 12:15                   ` Jeff King
2025-10-23 13:35                   ` Junio C Hamano
2025-10-22 17:39             ` Junio C Hamano
2025-10-23  0:33               ` Lidong Yan
2025-10-23 13:42                 ` Junio C Hamano

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: http://vger.kernel.org/majordomo-info.html

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=CACJRbWjwOQwJB13CwTfvhV3p+Hbn4KrNM9AtBanGtUS4V_1MbQ@mail.gmail.com \
    --to=jake@zimmerman.io \
    --cc=git@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://80x24.org/mirrors/git.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).