From: Matthias Beyer Date: Mon, 09 Feb 2026 11:07:40 GMT Subject: Re: [PATCH 0/3] commit-msg.sample: reject messages that would confuse "git am" Message-ID: In-Reply-To: On Mon, Feb 09, 2026 at 10:43:23AM +0000, Phillip Wood wrote: > > 2. I'd guess that these days only a small minority of people care > > about sending patches by email. So for most people, a warning about > > their commit message containing a diff or "---" will be mostly > > useless, if not outright confusing. > > People do download patches from github and apply them even if they're not > using a email based workflow. I'm not entirely clear but I think that's what > happened in the post Matthias linked to. Though if they're using "patch" > rather than "git am" to apply them indenting the diff wont help. Yes, the original post was exactly that issue. I can add that distributions also do that quite often when they apply fixes from upstream that have not made it into a package release yet. At least for the NixOS distribution, we do that quite a lot (a totally unscientific grep through nixpkgs gave ~2800 instances where we fetch patches). Of course it is the obligation of the distribution to check the patches that are applied to packages. But in this case they of course use `patch` rather than `git am`. Still, that the diff from a commit message will be applied as well is something even advanced users do not know (I myself am using git for over 15 years, and I am comfortable with email patch based workflows - though, I didn't know about that fact and would have definitively fallen into that "trap"). > Kristoffer has kindly updated the documentation. I'm wary of adding a > warning to "git commit" for the reason you gave above. We could make it > opt-in but then hardly anyone would probably set that config option. I agree on that part. Matthias