Re: [PATCH 1/2] commit-graph: add trace2 instrumentation for generation DFS
- From
Kristofer Karlsson <krka@spotify.com>
- Date
- Jul 13, 2026, 19:55 UTC
- Message-ID
- <CAL71e4M8-KtnkC5qQP2iuhON=ROoOTVZfbZB8UhJ-+3KgEP9=g@mail.gmail.com>
- In-Reply-To
- <xmqqech99qe3.fsf@gitster.g>
On Sat, 11 Jul 2026 at 23:18, Junio C Hamano <gitster@pobox.com> wrote:
Show 23 quoted lines
> > Taylor Blau <ttaylorr@openai.com> writes: > > >> If the test involved is longer than 3 lines, I would recommend > >> against it, as "git show" of such a patch will show the full code > >> change to implement a different behaviour plus "_failure" changing > >> to "_success" in the test, with the body of the test hidden outside > >> the context, which makes it hard to guess what the behaviour change > >> is really about. > > > > Hmm, I am not sure that I agree. Or, at the very least, that is now how > > I have written series in the past where I want to demonstrate and then > > subsequently fix an existing bug. > > After applying and in viewing "git log -W -p", there is no such > difficulty like the one I described in the message you are > responding to, but it makes it harder on reviewers on the mailing > list, to make a quick pre-review based only on the material that > they can see in the e-mail. > > It may be easier to write the commits, but given that we seem to > have more patches sent to the list than reviewers can review, it may > not be a good trade-off.
I've been pondering this dilemma for a bit. I agree with Taylor that atomic commits are valuable and I quite like proving the bug exists before fixing it. It's not black and white though, for race conditions or hard to reproduce cases I tend to fold the test into the fix commit directly instead.
But the review process is also critical and its overhead should be minimized.
Could tooling help here? The submitter should know which parts of the patch need more context for review. If they could selectively expand context before sending, reviewers would see the full picture in the email without sacrificing having atomic commits.
git apply already handles patches with extra context lines just fine, so we just need something to assist in producing that extra context -- either some configurability in git format-patch itself (like -W, but more fine-grained control over _where_ that gets applied) or some post-processing tool to expand context in patches before sending.
Too late for this round, but I might give that a try in the future if I run into a similar scenario again.
Thanks, Kristofer