7 Commits

Author SHA1 Message Date
Robin Jarry
d0484b153a completion: add command option descriptions
Add `desc:""` struct field tags in all command arguments where it makes
sense.

The description values will be returned along with completion choices.

Implements: https://todo.sr.ht/~rjarry/aerc/271
Signed-off-by: Robin Jarry <robin@jarry.cc>
Tested-by: Bojan Gabric <bojan@bojangabric.com>
Tested-by: Jason Cox <me@jasoncarloscox.com>
Acked-by: Tim Culverhouse <tim@timculverhouse.com>
2024-10-23 10:22:51 +02:00
Robin Jarry
26033eaecf completion: add commands descriptions
Update the Command interface to include a Description() method.
Implement the method for all commands using short descriptions inspired
from the aerc(1) man page.

Return the description values along with command names so that they can
be displayed in completion choices.

Implements: https://todo.sr.ht/~rjarry/aerc/271
Signed-off-by: Robin Jarry <robin@jarry.cc>
Tested-by: Bojan Gabric <bojan@bojangabric.com>
Tested-by: Jason Cox <me@jasoncarloscox.com>
Acked-by: Tim Culverhouse <tim@timculverhouse.com>
2024-10-23 10:22:51 +02:00
Robin Jarry
2453375721 commands: rename confusing constants
There is an overlap between ACCOUNT and MESSAGE. Rename ACCOUNT to
MESSAGE_LIST and use MESSAGE_LIST|MESSAGE_VIEWER instead of MESSAGE.

Signed-off-by: Robin Jarry <robin@jarry.cc>
Reviewed-by: Tim Culverhouse <tim@timculverhouse.com>
2024-03-04 22:30:14 +01:00
Robin Jarry
8edf7b0e4d log: move package to lib
This has nothing to do at the root of the source tree.

Signed-off-by: Robin Jarry <robin@jarry.cc>
Acked-by: Bence Ferdinandy <bence@ferdinandy.com>
2024-02-14 23:04:38 +01:00
Robin Jarry
159fb38daf commands: refactor registration
Register all commands with the same function and store them in the same
map.

Use bit flags to determine in which contexts each command should be
available.

Remove duplicate commands now that the same command can be exposed in
multiple contexts.

Refactor API to allow executing commands from other commands without
import cycles.

Signed-off-by: Robin Jarry <robin@jarry.cc>
Tested-by: Bence Ferdinandy <bence@ferdinandy.com>
Tested-by: Johannes Thyssen Tishman <johannes@thyssentishman.com>
2024-01-20 21:56:25 +01:00
Koni Marti
f8c9e7fff5 patch: implement worktree support
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>
2023-12-30 15:42:09 +01:00
Koni Marti
fdd9f7991a patch/apply: add apply sub-cmd
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>
2023-12-30 15:42:09 +01:00