docs: Add a document on how to fix a messy diffstat
Subsystems (2)
Jonathan Corbet
maintainerPATCH v2 1/1 docs: Add a document on how to fix a messy diffstat
A branch with merges in will sometimes create a diffstat containing a lot of unrelated work at "git request-pull" time. Create a document based on Linus's advice (found in the links below) and add it to the maintainer manual in the hope of saving some wear on Linus's keyboard going forward.
---
v2: Various tweaks suggested by Borislav, Bagas, and Akira
Documentation/maintainer/index.rst | 1 + Documentation/maintainer/messy-diffstat.rst | 96 +++++++++++++++++++++ 2 files changed, 97 insertions(+) create mode 100644 Documentation/maintainer/messy-diffstat.rst
Documentation/maintainer/index.rst +1 -0
@@ -12,6 +12,7 @@ additions to this manual. configure-git rebasing-and-merging pull-requests + messy-diffstat maintainer-entry-profile modifying-patches
Documentation/maintainer/messy-diffstat.rst new file +96 -0
96 lines not on this page · raw message
Signature · 1 line
2.35.1
Quoted 11 lines · Jonathan Corbet
A branch with merges in will sometimes create a diffstat containing a lot of unrelated work at "git request-pull" time. Create a document based on Linus's advice (found in the links below) and add it to the maintainer manual in the hope of saving some wear on Linus's keyboard going forward.
Link https://lore.kernel.org/lkml/CAHk-=wg3wXH2JNxkQi+eLZkpuxqV+wPiHhw_Jf7ViH33Sw7PHA@mail.gmail.com/ open hereLink https://lore.kernel.org/lkml/CAHk-=wgXbSa8yq8Dht8at+gxb_idnJ7X5qWZQWRBN4_CUPr=eQ@mail.gmail.com/ open hereAcked-by Borislav Petkov <[email protected]>Signed-off-by Jonathan Corbet <[email protected]>---
v2: Various tweaks suggested by Borislav, Bagas, and Akira
Thanks, Akira
Quoted 6 lines
Documentation/maintainer/index.rst | 1 + Documentation/maintainer/messy-diffstat.rst | 96 +++++++++++++++++++++ 2 files changed, 97 insertions(+) create mode 100644 Documentation/maintainer/messy-diffstat.rst
[...]
Quoted 12 lines · Jonathan Corbet
Documentation/maintainer/messy-diffstat.rst new file +12
-0+So what is to be done? The best response when confronted with this +situation is to indeed to do a merge with the branch you intend your work +to be pulled into, but to do it privately, as if it were the source of +shame. Create a new, throwaway branch and do the merge there:: + + ... vM --- vN-rc1 --- vN-rc2 --- vN-rc3 --- ... --- vN-rc7 --- vN + | | | + | +-- c1 --- c2 --- ... --- cN | + | / | | + +-- x1 --- x2 --- x3 +------------+-- TEMP + +The merge operation resolves all of the complications resulting from the
Documentation/maintainer/messy-diffstat.rst line 96
Quoted 10 lines
Documentation/maintainer/messy-diffstat.rst new file +10
-0+multiple beginning points, yielding a coherent result that contains only +the differences from the mainline branch. Now it will be possible to +generate a diffstat with the desired information:: + + $ git diff -C --stat --summary linus..TEMP + +Save the output from this command, then simply delete the TEMP branch; +definitely do not expose it to the outside world. Take the saved diffstat +output and edit it into the messy pull request, yielding a result that +shows what is really going on. That request can then be sent upstream.
Looks OK.
Signature · 1 line
An old man doll... just what I always wanted! - Clara