{"thread":{"id":"64231","subject":"How mantainers check Git diffs and patches?","startedAt":"2025-10-01T03:30:48Z","lastAt":"2025-10-02T05:19:51Z","messageCount":9,"participants":["Henrique Soares","Kristoffer Haugsbakk","Konstantin Ryabitsev","Junio C Hamano","Jeff King"],"isPatch":false,"patchVersion":null,"patchTotal":null},"messages":[{"id":"527670","messageId":"aNygY8Cm7LEaBzV6@localhost","threadId":"64231","inReplyTo":null,"subject":"How mantainers check Git diffs and patches?","fromName":"Henrique Soares","fromEmail":"henriquegogo@gmail.com","sentAt":"2025-10-01T03:30:43Z","receivedAt":"2025-10-01T03:30:48Z","isPatch":false,"sender":{"key":"henriquegogo@gmail.com","avatar":"https://gravatar.com/avatar/384040f3ab2afcdfa318aa718b71038956f846a0fee435e161566efdab3bc668?d=mp&s=160"},"body":"Hello,\n\nThis is a simple question I have related to the PR diff review process.\n\nHow Git maintainers use to check diffs and review the code? I mean,\nsometimes I see that there are some large PATCHES that is hard or\nprobably impossible to review only using e-mail client.\n\nDo you use some syntax highlight in client e-mail; any pipeline that\nautomatically download e-mails and apply to a local branch; or for each\nPR you save the e-mail file then \"git apply\" to review / test the diff?\n\nThis isn't a technical question, I'm just curious about how you do it.\n\n-- Henrique\n"},{"id":"527674","messageId":"ba6b9a5e-72b5-4d66-a484-37140438702a@app.fastmail.com","threadId":"64231","inReplyTo":"aNygY8Cm7LEaBzV6@localhost","subject":"Re: How mantainers check Git diffs and patches?","fromName":"Kristoffer Haugsbakk","fromEmail":"kristofferhaugsbakk@fastmail.com","sentAt":"2025-10-01T08:15:35Z","receivedAt":"2025-10-01T08:15:57Z","isPatch":false,"sender":{"key":"kristofferhaugsbakk@fastmail.com","avatar":null},"body":"On Wed, Oct 1, 2025, at 05:30, Henrique Soares wrote:\n> This is a simple question I have related to the PR diff review process.\n>\n> How Git maintainers use to check diffs and review the code? I mean,\n> sometimes I see that there are some large PATCHES that is hard or\n> probably impossible to review only using e-mail client.\n>\n> Do you use some syntax highlight in client e-mail; any pipeline that\n> automatically download e-mails and apply to a local branch; or for each\n> PR you save the e-mail file then \"git apply\" to review / test the diff?\n>\n> This isn't a technical question, I'm just curious about how you do it.\n\nHere is a relevant message (2016).\n\nhttps://lore.kernel.org/git/20160809113703.57irthzzpg6j3dmv@sigill.intra.peff.net/\n"},{"id":"527679","messageId":"20251001-pastoral-frisky-seahorse-cd5bdf@lemur","threadId":"64231","inReplyTo":"aNygY8Cm7LEaBzV6@localhost","subject":"Re: How mantainers check Git diffs and patches?","fromName":"Konstantin Ryabitsev","fromEmail":"konstantin@linuxfoundation.org","sentAt":"2025-10-01T13:37:34Z","receivedAt":"2025-10-01T13:37:36Z","isPatch":false,"sender":{"key":"konstantin@linuxfoundation.org","avatar":"https://gravatar.com/avatar/7cb8827c6de56e1bd2dea16508c6708aa43feed3bf3813bcdacecdf96ceadd79?d=mp&s=160"},"body":"On Wed, Oct 01, 2025 at 12:30:43AM -0300, Henrique Soares wrote:\n> This is a simple question I have related to the PR diff review process.\n> \n> How Git maintainers use to check diffs and review the code? I mean,\n> sometimes I see that there are some large PATCHES that is hard or\n> probably impossible to review only using e-mail client.\n> \n> Do you use some syntax highlight in client e-mail; any pipeline that\n> automatically download e-mails and apply to a local branch; or for each\n> PR you save the e-mail file then \"git apply\" to review / test the diff?\n\nThere are tools that make it easy to apply a patch series to your local tree.\nFor example, here's a random patch series from the list:\n\n    https://lore.kernel.org/git/20250919010911.649831-1-sandals@crustytoothpaste.net\n\nThis will apply it on top of the current HEAD:\n\n    b4 shazam https://lore.kernel.org/git/20250919010911.649831-1-sandals@crustytoothpaste.net\n\nThis will fetch it into FETCH_HEAD, making it behave pretty identical to a\npull request:\n\n    b4 shazam -H https://lore.kernel.org/git/20250919010911.649831-1-sandals@crustytoothpaste.net\n\nFrom here, you can check out FETCH_HEAD to run tests or do a commit-by-commit\nreview.\n\nHope this helps,\n-K\n"},{"id":"527703","messageId":"xmqqh5wi3779.fsf@gitster.g","threadId":"64231","inReplyTo":"aNygY8Cm7LEaBzV6@localhost","subject":"Re: How mantainers check Git diffs and patches?","fromName":"Junio C Hamano","fromEmail":"gitster@pobox.com","sentAt":"2025-10-01T16:41:46Z","receivedAt":"2025-10-01T16:41:48Z","isPatch":false,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"Henrique Soares <henriquegogo@gmail.com> writes:\n\n> This is a simple question I have related to the PR diff review process.\n>\n> How Git maintainers use to check diffs and review the code? I mean,\n> sometimes I see that there are some large PATCHES that is hard or\n> probably impossible to review only using e-mail client.\n>\n> Do you use some syntax highlight in client e-mail; any pipeline that\n> automatically download e-mails and apply to a local branch; or for each\n> PR you save the e-mail file then \"git apply\" to review / test the diff?\n>\n> This isn't a technical question, I'm just curious about how you do it.\n\nEven a very small patch that applies a change to an early part of an\nultra-long function may be hard to assess depending on how far the\neffect of that change gets propagated through the code flow to\naffect the code near the bottom of the function.\n\nPatches are medium for reliable transmission.  Once you apply the\npatch to your tree (perhaps giving it its own topic branch, perhaps\nto a detached HEAD with the full intention that you will discard it\nafter you are done inspecting the change the patch brings in), you\ncan use any regular tools you use while developing and reviewing\nyour own code.\n"},{"id":"527727","messageId":"20251001211046.GA30565@localhost","threadId":"64231","inReplyTo":"ba6b9a5e-72b5-4d66-a484-37140438702a@app.fastmail.com","subject":"Re: How mantainers check Git diffs and patches?","fromName":"Jeff King","fromEmail":"peff@peff.net","sentAt":"2025-10-01T21:12:05Z","receivedAt":"2025-10-01T21:12:06Z","isPatch":false,"sender":{"key":"peff@peff.net","avatar":"https://avatars.githubusercontent.com/u/45925?v=4"},"body":"On Wed, Oct 01, 2025 at 10:15:35AM +0200, Kristoffer Haugsbakk wrote:\n\n> Here is a relevant message (2016).\n> \n> https://lore.kernel.org/git/20160809113703.57irthzzpg6j3dmv@sigill.intra.peff.net/\n\nOh good, you just saved me a lot of digging and/or retyping. ;) I think\nthat message is a bit more philosophical, but in the thread below it\nthere are some actual scripts and mutt commands I use. I'm sure they've\nprobably gotten some small bug fixes over the years (especially the\npatch-sending script), so if anybody is reading them as more than just\ninspiration, let me know and I am happy to share a more current version.\n\n-Peff\n"},{"id":"527747","messageId":"aN3m1dvc5yh0CGTG@localhost","threadId":"64231","inReplyTo":"ba6b9a5e-72b5-4d66-a484-37140438702a@app.fastmail.com","subject":"Re: How mantainers check Git diffs and patches?","fromName":"Henrique Soares","fromEmail":"henriquegogo@gmail.com","sentAt":"2025-10-02T02:43:33Z","receivedAt":"2025-10-02T02:43:37Z","isPatch":false,"sender":{"key":"henriquegogo@gmail.com","avatar":"https://gravatar.com/avatar/384040f3ab2afcdfa318aa718b71038956f846a0fee435e161566efdab3bc668?d=mp&s=160"},"body":"On Wed, Oct 01, 2025 at 10:15:35AM +0200, Kristoffer Haugsbakk wrote:\n> Here is a relevant message (2016).\n> \n> https://lore.kernel.org/git/20160809113703.57irthzzpg6j3dmv@sigill.intra.peff.net/\n\nHey, this thread is pure gold.\n\nThere are a lot of comparisons with GitHub PRs (BTW, that wasn't my\nmotivation), but besides this, it's pretty nice to see the review\nprocess in \"e-mail flow\". \n\nE-mail threads are really great for discussions but before I follow Git\nmailing list I did never realize how useful they are to PR reviews as\nwell.\n\n-- Henrique\n"},{"id":"527749","messageId":"aN3ozlH_pPnvdWPn@localhost","threadId":"64231","inReplyTo":"xmqqh5wi3779.fsf@gitster.g","subject":"Re: How mantainers check Git diffs and patches?","fromName":"Henrique Soares","fromEmail":"henriquegogo@gmail.com","sentAt":"2025-10-02T02:51:58Z","receivedAt":"2025-10-02T02:52:03Z","isPatch":false,"sender":{"key":"henriquegogo@gmail.com","avatar":"https://gravatar.com/avatar/384040f3ab2afcdfa318aa718b71038956f846a0fee435e161566efdab3bc668?d=mp&s=160"},"body":"On Wed, Oct 01, 2025 at 09:41:46AM -0700, Junio C Hamano wrote:\n> Patches are medium for reliable transmission.  Once you apply the\n> patch to your tree (perhaps giving it its own topic branch, perhaps\n> to a detached HEAD with the full intention that you will discard it\n> after you are done inspecting the change the patch brings in), you\n> can use any regular tools you use while developing and reviewing\n> your own code.\n\nIt makes totally sense. So I suppose you avoid to review the code just\nchecking the e-mail patch in e-mail client, but first applying locally\nand then check it in your code editor in a separate branch, worktree or\nwhatever, then back to e-mail thread and comment the code, right?\n\n-- Henrique\n"},{"id":"527750","messageId":"aN3ql-r3Hj9Z5oHO@localhost","threadId":"64231","inReplyTo":"20251001-pastoral-frisky-seahorse-cd5bdf@lemur","subject":"Re: How mantainers check Git diffs and patches?","fromName":"Henrique Soares","fromEmail":"henriquegogo@gmail.com","sentAt":"2025-10-02T02:59:35Z","receivedAt":"2025-10-02T02:59:39Z","isPatch":false,"sender":{"key":"henriquegogo@gmail.com","avatar":"https://gravatar.com/avatar/384040f3ab2afcdfa318aa718b71038956f846a0fee435e161566efdab3bc668?d=mp&s=160"},"body":"On Wed, Oct 01, 2025 at 09:37:34AM -0400, Konstantin Ryabitsev wrote:\n> This will apply it on top of the current HEAD:\n> \n>     b4 shazam https://lore.kernel.org/git/20250919010911.649831-1-sandals@crustytoothpaste.net\n> \n> This will fetch it into FETCH_HEAD, making it behave pretty identical to a\n> pull request:\n> \n>     b4 shazam -H https://lore.kernel.org/git/20250919010911.649831-1-sandals@crustytoothpaste.net\n\nI just didn't know about b4, and this is probably the tool I was looking for.\nBasically what I was doing was `git apply` patch-by-patch manually (with\na little scripting), but b4 seems the right tool for the job.\n\n> Hope this helps,\n\nYes, a lot! Thanks.\n\n-- Henrique\n"},{"id":"527751","messageId":"xmqq5xcxzxqj.fsf@gitster.g","threadId":"64231","inReplyTo":"aN3ozlH_pPnvdWPn@localhost","subject":"Re: How mantainers check Git diffs and patches?","fromName":"Junio C Hamano","fromEmail":"gitster@pobox.com","sentAt":"2025-10-02T05:19:48Z","receivedAt":"2025-10-02T05:19:51Z","isPatch":false,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"Henrique Soares <henriquegogo@gmail.com> writes:\n\n> On Wed, Oct 01, 2025 at 09:41:46AM -0700, Junio C Hamano wrote:\n>> Patches are medium for reliable transmission.  Once you apply the\n>> patch to your tree (perhaps giving it its own topic branch, perhaps\n>> to a detached HEAD with the full intention that you will discard it\n>> after you are done inspecting the change the patch brings in), you\n>> can use any regular tools you use while developing and reviewing\n>> your own code.\n>\n> It makes totally sense. So I suppose you avoid to review the code just\n> checking the e-mail patch in e-mail client, but first applying locally\n> and then check it in your code editor in a separate branch, worktree or\n> whatever, then back to e-mail thread and comment the code, right?\n\nThe other way around.  With experience with the codebase, you'd\nlearn to tell if a small-looking patch is truly small and only need\nthe patch text to judge, would be helped if I have another window\nand have the code that would be modified if I were to apply the\npatch without actually applying, or its ramification is deep enough\nthat I better apply it before making the final decision.  For a\ntruly complex patch series I'd first apply them and then read with\n\"git log --reverse -p\" with wider context (e.g., -W or -U8),\noccasionally looking at the entire file at the step in question with\nsomething like \"git show HEAD~4:path/to/that/file\".  It does not happen\nall that often, but it is not so rare.\n"}]}