[Pkg-zsh-commits] [zsh] 10/26: Workflow: Rewrite patch handling
Axel Beckert
abe at deuxchevaux.org
Wed Oct 8 21:14:37 UTC 2014
This is an automated email from the git hooks/post-receive script.
abe pushed a commit to branch debian
in repository zsh.
commit a629c265d03b3a707c43dfb0ba699bd3cf4ca36e
Author: Axel Beckert <abe at deuxchevaux.org>
Date: Wed Oct 8 21:47:07 2014 +0200
Workflow: Rewrite patch handling
---
debian/pkg-zsh-workflow.md | 93 ++++++++++++++++++++++++++++++----------------
1 file changed, 61 insertions(+), 32 deletions(-)
diff --git a/debian/pkg-zsh-workflow.md b/debian/pkg-zsh-workflow.md
index 5346721..6f5beb8 100644
--- a/debian/pkg-zsh-workflow.md
+++ b/debian/pkg-zsh-workflow.md
@@ -82,52 +82,86 @@ into the 'debian' branch.
Let's say, there is an issue '#12345' which can be fixed by patching
'Functions/Misc/colors'. Here is how you could add that patch
-(assuming clean git working directory and the topmost patch is
-0002-foo.diff):
+(assuming clean git working directory):
- ## First, add all existing non-debian patches, so the new one is
- ## added on top.
+First, push all existing patches, so the new one is added on top.
% quilt push -a
- ## Add the new patch (say, the topmost patch is 0002-foo.diff).
- % quilt new 0003-fix-colors.diff
+Alternatively push the patches one by one (by calling `quilt push`
+multiple times) until you are at the patch queue position where you
+want to insert the patch.
+
+##### Adding a patch from a file or by editing
+
+Add the new patch (say, the topmost patch is 0002-foo.diff).
+
+ % quilt new fix-colors.diff
+
+Tell quilt which files are going to be changed.
- ## Tell quilt which files are going to be changed.
% quilt add Functions/Misc/colors
- ## Import the fix (manually by editor or by patching).
- % vi Functions/Misc/colors
+Import the fix either manually using your favourite editor…
+
+ % $EDITOR Functions/Misc/colors
+
+… or by patching:
+
+ % patch -p<n> < ../patch_from_somewhere_else.diff
+
+##### Cherry-picking patches from upstream
+
+When there is an existing patch (e.g. from upstream's git repository),
+the above can be largely automated if the patch applies to the current
+state of the debian branch.
+
+ % git show $commitid > debian/patches/$patchname
+ % echo $patchname >> debian/patches/series
+
+Patches from upstream will likely include changes to the ChangeLog
+file. Those changes will probably not apply cleanly, so just open the
+created patch file and delete all hunks that do changes in ChangeLog.
+
+ % $EDITOR debian/patches/$patchname
+
+Check if the patch applies
+
+ % quilt push
+
+##### Finish import of the patch
+
+Refresh the patch to get rid of any fuzz or offset:
- ## Refresh the patch
% quilt refresh
- ## Pop all patches again to clean up the upstream source.
+Pop all patches again to clean up the upstream source.
+
% quilt pop -a
- ## Commit the new patch and the changes 'series' file to git.
- % git add debian/patches/0003-fix-colors.diff
- % git add debian/patches/series
- % git commit -a -m'Fixing foo in colors function (Closes: #12345)'
+Edit the patch headers according to
+[DEP3](http://dep.debian.net/deps/dep3/).
-That's all.
+ % $EDITOR debian/patches/$patchname
+Commit the new patch and the changed 'series' file to git.
-#### Cherry-picking patches from upstream into quilt
+ % git add debian/patches/fix-colors.diff
+ % git add debian/patches/series
+ % git commit -m 'Fixing foo in colors function (Closes: #12345)'
-When there is an existing patch (e.g. from upstream's git repository),
-the above can be largely automated if the patch applies cleanly to the
-current state of the debian branch.
+That's all.
+
+##### Using the patch2quilt script
-The './debian/patch2quilt' helper script takes care of that task. It's
-called like this:
+The `debian/patch2quilt` helper script can automate these tasks, but
+needs to be run from a _clean_ working tree. It's called like this:
- % ./debian/patch2quilt ../existing.diff 0023-new-quilt.diff
+ % debian/patch2quilt ../existing.diff new-quilt.diff
-Here "../existing.diff" is the file containing the existing patch and
-"0023-new-quilt.diff" is the name of the to-be-added quilt series
-patch (make sure its nameing is in line with the established
-conventions).
+Here `../existing.diff` is the file containing the existing patch and
+`new-quilt.diff` is the name of the to-be-added quilt series patch
+(make sure its nameing is in line with the established conventions).
The exact operation of the script is described at the top of the
script file. There are a few things to keep in mind:
@@ -145,11 +179,6 @@ script file. There are a few things to keep in mind:
patch you're planing to import into the git working tree. It
would be wiped away, too.
-* Patches from upstream will likely include changes to the ChangeLog
- file. Those changes will probably not apply cleanly, which will
- break the scripts execution. Just open the existing patch and delete
- all hunks that do changes in ChangeLog.
-
* When the script finishes (after you exit your editor), it will
suggest how to commit the newly intoduced patch. Season to taste.
--
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/collab-maint/zsh.git
More information about the Pkg-zsh-commits
mailing list