Say I have a patch series that looks as follows:
0000-cover-letter.patch
0001-Patch1.patch
0002-Patch2.patch
Now I would like to add 0003-Patch3.patch to be part of that series.
I could do the following:
git format-patch HEAD~1 --start-number 3
However that won't work because the cover-letter patch will not be updated.
Is there a way to do one of the following, which kind of achieve the same goal:
- Add a patch to an existing series and have the cover-letter updated automatically
- Generate a cover letter on an existing list of patches without changing them though
P.S: Re-generating the entire series(HEAD~3) is not option here because when the first patches were generated I edited them with a description of the patch that would be erased if I re-generate from scratch.
Your desire to manually add new patches to a series suggests to me that you should improve your patch series workflow.
Ideally, creating a new set of patches should be so streamlined that you won’t want to fiddle with more things than you need.
Storing the cover letter
The cover letter should be stored somewhere. Two options out of an infinity:
Storing free-form comments
You can store comments on patches, i.e. text that will neither be part of the commit message nor the patch proper. They go between the
---
separator and the beginning of the diff.Say someone on a previous review asked you to do X on that commit (err, patch). So you want to note that like this:
You can do that by creating a note on that commit:
With a message like the above. Which will be stored as:
Minimal changes to the output of
git patch-format
It seems that you (ideally) want to limit your post-patch format invocation work to editing the subject and body of your cover letter. And if you store that somewhere then it’s mostly just a question of copy–paste.