Subject: Re: How mantainers check Git diffs and patches?

From: Junio C Hamano <[email-masked]>
Date: Wed, 01 Oct 2025 22:19:48 -0700

Henrique Soares <[email-masked]> writes:

> On Wed, Oct 01, 2025 at 09:41:46AM -0700, Junio C Hamano wrote:
>> Patches are medium for reliable transmission.  Once you apply the
>> patch to your tree (perhaps giving it its own topic branch, perhaps
>> to a detached HEAD with the full intention that you will discard it
>> after you are done inspecting the change the patch brings in), you
>> can use any regular tools you use while developing and reviewing
>> your own code.
>
> It makes totally sense. So I suppose you avoid to review the code just
> checking the e-mail patch in e-mail client, but first applying locally
> and then check it in your code editor in a separate branch, worktree or
> whatever, then back to e-mail thread and comment the code, right?

The other way around.  With experience with the codebase, you'd
learn to tell if a small-looking patch is truly small and only need
the patch text to judge, would be helped if I have another window
and have the code that would be modified if I were to apply the
patch without actually applying, or its ramification is deep enough
that I better apply it before making the final decision.  For a
truly complex patch series I'd first apply them and then read with
"git log --reverse -p" with wider context (e.g., -W or -U8),
occasionally looking at the entire file at the step in question with
something like "git show HEAD~4:path/to/that/file".  It does not happen
all that often, but it is not so rare.