Re: Regression in `git diff --quiet HEAD` when a new file is staged
- From
Lidong Yan <yldhome2d2@gmail.com>
- Date
- Oct 22, 2025, 14:20 UTC
- Message-ID
- <819C2F6E-BE85-4B05-B975-894033E51D96@gmail.com>
- In-Reply-To
- <20251022091433.GC853931@coredump.intra.peff.net>
Jeff King <peff@peff.net> writes:
Show 11 quoted lines
> > We probably also need to restore o->color_moved, too. > > In the long run (and this is the kind of cleanup I was hoping you'd work > on for 'master'), we probably could drop that line entirely and just > skip running the moved-line detection when dry_run is set. Assuming it > even runs at all. From a quick look at the code, it looks like we only > do color-moved handling via diff_flush_patch_all_file_pairs(), so it > wouldn't trigger at all for the cases that do individual calls to > diff_flush_patch_quietly()? >
Sounds interesting, I’d like to dig into this ‘color_moved’ option and see if we can optimize some code path in dry-run mode.
Thanks, Lidong