From f8c9e7fff564667700c3dbc239d55db8fcd032a6 Mon Sep 17 00:00:00 2001 From: Koni Marti Date: Fri, 24 Nov 2023 16:03:10 +0100 Subject: patch: implement worktree support Implement worktree support for the patch management. Use ":patch apply -w " to create a new worktree and apply the selected messages to it. The worktree is linked to repo in the current project. Internally, the worktree is stored as a new project. When this project is deleted with ":patch delete", the underlying linked worktree is removed as well. ":patch list" shows when a project is a worktree and to what project it is linked to. Worktrees enable the users to create a new copy of the repo at a given commit and apply patches without interrupting the current work in the base repo. Signed-off-by: Koni Marti Acked-by: Robin Jarry --- doc/aerc-patch.7.scd | 32 +++++++++++++++++++++++++------- 1 file changed, 25 insertions(+), 7 deletions(-) (limited to 'doc/aerc-patch.7.scd') diff --git a/doc/aerc-patch.7.scd b/doc/aerc-patch.7.scd index 98c271bb..932bf8b1 100644 --- a/doc/aerc-patch.7.scd +++ b/doc/aerc-patch.7.scd @@ -35,21 +35,39 @@ The following *:patch* sub-commands are supported: *-a*: Lists all projects. -*:patch apply* [*-c* __] __ +*:patch apply* [*-c* __] [*-w* __] __ Applies the selected message(s) to the repository of the current project. It uses the *:pipe* command for this and keeps track of the applied patch. - A user-defined command for applying patches can be used with the *-c* - option. Any occurence of '%r' in the command string will be replaced - with the root directory of the current project. However, this approach - is not recommended in general and should only be used for very specific - purposes, i.e. when a maintainer is applying a patch set via a separate - script to deal with git trailers. + Completions for the __ are available based on the subject lines of + the selected or marked messages. + + *-c* __: Apply patches with the provided __. Any occurence of + '%r' in the command string will be replaced with the root directory of + the current project. Note that this approach is not recommended in + general and should only be used for very specific purposes, i.e. when + a maintainer is applying a patch set via a separate script to deal with + git trailers. *aerc* will propose completions for the __ based on the subject lines of the selected or marked messages. + Example: + ``` + :patch apply -c "git -C %r am -3" fix_v2 + ``` + + *-w* __: Create a linked worktree for the current project at + __ and apply the patches to the linked worktree. A new + project is created to store the worktree information. When this project + is deleted, the worktree will be deleted as well. + + Example: + ``` + :patch apply -w origin/master fix_v2 + ``` + *:patch remove* __ Removes the patch __ from the repository. -- cgit