aboutsummaryrefslogtreecommitdiffstats
path: root/lib/pama
Commit message (Collapse)AuthorAgeFilesLines
* commands: rename patch delete to patch unlinkKoni Marti2024-01-311-2/+2
| | | | | | | | | | | Rename the command :patch delete to :patch unlink. This expresses the "link" between the project data within aerc and the underlying repository better. :patch unlink does not delete anything in the repository, it only removes the metadata about currently applied patch revisions/tags. Signed-off-by: Koni Marti <koni.marti@gmail.com> Acked-by: Robin Jarry <robin@jarry.cc>
* commands: rename patch remove to patch dropKoni Marti2024-01-315-21/+21
| | | | | | | | Rename the :patch remove command to :patch drop to better express the this operation is the counter-part to :patch apply. Signed-off-by: Koni Marti <koni.marti@gmail.com> Acked-by: Robin Jarry <robin@jarry.cc>
* patch/find: add find sub-cmdKoni Marti2023-12-301-0/+19
| | | | | | | | Implement the :patch find command. Search and filter for a given commit by subject line in the current accout and current folder. Signed-off-by: Koni Marti <koni.marti@gmail.com> Acked-by: Robin Jarry <robin@jarry.cc>
* patch: implement worktree supportKoni Marti2023-12-308-13/+186
| | | | | | | | | | | | | | | | | | | | | | Implement worktree support for the patch management. Use ":patch apply -w <commit-ish> <tag>" 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 <koni.marti@gmail.com> Acked-by: Robin Jarry <robin@jarry.cc>
* patch/switch: add switch sub-cmdKoni Marti2023-12-301-0/+29
| | | | | | | | Implement the :project switch command. Switch between different projects. Signed-off-by: Koni Marti <koni.marti@gmail.com> Acked-by: Robin Jarry <robin@jarry.cc>
* patch/delete: add delete sub-cmdKoni Marti2023-12-301-0/+45
| | | | | | | | | Implement the :patch delete command. Remove the project data from the permanent store. If no argument is provided, the current project will be deleted. Signed-off-by: Koni Marti <koni.marti@gmail.com> Acked-by: Robin Jarry <robin@jarry.cc>
* patch/rebase: add rebase sub-cmdKoni Marti2023-12-301-0/+81
| | | | | | | | | | | | | | | | | Implement the :patch rebase command. Rebase the internal patch data in case the repository was rebased too. The :patch rebase command accepts a optional argument which is used as the reference commit from which the rebasing will occur. Open an editor with the commits that are found on top of the rebase reference. Any untracked commit will have the tag 'untracked'. If a line is removed or the 'untracked' tag remains, it will be dropped from the internal data. To group commits into a patch set, assign the same tag names. Signed-off-by: Koni Marti <koni.marti@gmail.com> Acked-by: Robin Jarry <robin@jarry.cc>
* patch/remove: add remove sub-cmdKoni Marti2023-12-303-0/+345
| | | | | | | | | | | Implement the :patch remove command. Remove a patch set from the respository and from the internal storage. Note that in git, this will change all commit hashes that appear after the removed one since the commit hash depends on its parents. Adjust the code to handle such cases and add tests for this. Signed-off-by: Koni Marti <koni.marti@gmail.com> Acked-by: Robin Jarry <robin@jarry.cc>
* patch/list: add list sub-cmdKoni Marti2023-12-301-0/+59
| | | | | | | | | Implement the :patch list command. List the the current project and add a flag to list all saved projects. Use the pager to display the data and extract the pager commands and move them into the config package. Signed-off-by: Koni Marti <koni.marti@gmail.com> Acked-by: Robin Jarry <robin@jarry.cc>
* patch/apply: add apply sub-cmdKoni Marti2023-12-301-0/+137
| | | | | | | | | | Add the :patch apply command to apply a patch set and create a corresponding tag. The tag command argument can be completed based on the subject lines of the selected messages. Add a test for the completion proposal. Signed-off-by: Koni Marti <koni.marti@gmail.com> Acked-by: Robin Jarry <robin@jarry.cc>
* patch/init: add init sub-cmdKoni Marti2023-12-302-0/+85
| | | | | | | Implement the :patch init command to initialize a new project. Signed-off-by: Koni Marti <koni.marti@gmail.com> Acked-by: Robin Jarry <robin@jarry.cc>
* pama: implement the persistent store for projectsKoni Marti2023-12-301-0/+244
| | | | | | | Implement the persistent store for models.Project structs. Signed-off-by: Koni Marti <koni.marti@gmail.com> Acked-by: Robin Jarry <robin@jarry.cc>
* pama: implement the revision control logicKoni Marti2023-12-302-0/+160
| | | | | | | | | Implement the RevisionController interface to interact with a respository control system. Add the implementation for git. Other revision systems such as mercurial, pijul or fossil can be extended. Signed-off-by: Koni Marti <koni.marti@gmail.com> Acked-by: Robin Jarry <robin@jarry.cc>
* pama: define the entity modelsKoni Marti2023-12-303-0/+260
Define the entity models for the patch management. Add a Project and Commit struct and implement the Stringer interface for both. Signed-off-by: Koni Marti <koni.marti@gmail.com> Acked-by: Robin Jarry <robin@jarry.cc>