aboutsummaryrefslogtreecommitdiffstats
path: root/lib
Commit message (Collapse)AuthorAgeFilesLines
...
* gpg: fix mime-version header positionRobin Jarry2024-03-101-3/+27
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Some MTAs try to normalize the case of all headers (including signed text parts headers). Unfortunately, Mime-Version can be normalized to different casing depending on the implementation (MIME- vs Mime-). Since the signature is computed on the whole part, including its header, changing the case can cause the signature to become invalid. Due to how multipart/signed messages are constructed, we need to hack around go-message writers to intercept the writing of a text part, compute its signature and write the actual message with the proper headers. Unfortunately, go-message does not allow creating a message writer that does not insert a Mime-Version header. This causes the Mime-Version header to be inserted in the wrong place: it is put inside the signed text part header instead on the top level header. Thus, included in the signed content. Make sure to remove any Mime-Version header from the signed part header. Finally, ensure that Mime-Version is set on the top-level header so that messages are compliant with RFC 2045. Fixes: https://todo.sr.ht/~rjarry/aerc/143 Link: https://github.com/emersion/go-message/issues/165 Link: https://github.com/emersion/go-pgpmail/pull/15 Link: https://lists.sr.ht/~rjarry/aerc-devel/%3CCQRPF5EA0TF8.PEJ4AKCEGMFM%40fembook%3E Changelog-fixed: `Mime-Version` is no longer inserted in signed text parts headers. MTAs normalizing header case will not corrupt signatures anymore. Reported-by: Coco Liliace <chloe@liliace.dev> Reported-by: Kirill Chibisov <contact@kchibisov.com> Signed-off-by: Robin Jarry <robin@jarry.cc> Tested-by: Tim Culverhouse <tim@timculverhouse.com>
* templates: add visual mode indicator to TrayInfoJason Cox2024-03-043-0/+24
| | | | | | | | | | | It's useful to have some indicator of whether or not aerc is in visual mark mode. Add such an indicator to the TrayInfo available in the status line. Changelog-changed: The `TrayInfo` template variable now includes a visual mark mode indicator. Signed-off-by: Jason Cox <me@jasoncarloscox.com> Acked-by: Robin Jarry <robin@jarry.cc>
* ui: update vaxis and only use disambiguate csi-u flagTim Culverhouse2024-02-261-0/+1
| | | | | | | | | | | | | | | | | | Update vaxis to 0.8.2, which adds the ability to specify any CSI-u flag combination. Explicitly only use the disambiguate flag. This enables aerc to have additional keybinds not previously possible (C-i, C-m) while preventing some internal logic bugs relating to single-modifier key presses. While these events can be useful, they are not needed in aerc and aerc currently would need several workarounds to properly handle them so let's just not request them in the first place. Fixes a bug with encoding shift+space in the presence of CSI-u in the terminal widget Signed-off-by: Tim Culverhouse <tim@timculverhouse.com> Tested-by: Inwit <inwit@sindominio.net> Tested-by: Jason Cox <dev@jasoncarloscox.com> Acked-by: Robin Jarry <robin@jarry.cc>
* ui: enable CSIu key encodingTim Culverhouse2024-02-221-2/+8
| | | | | | | | | | | | | | Enable CSIu key encoding protocol when support is detected. This will enable keybinds which traditionally have been unavailable due to conflicting with other keys (C-i, C-m, C-[, etc). Remove numlock and capslock from all keypresses to prevent interfering with key matching. Changelog-added: Virtually any key binding can now be configured in `binds.conf`, including Shift+Alt+Control modifier combinations. Signed-off-by: Tim Culverhouse <tim@timculverhouse.com> Acked-by: Robin Jarry <robin@jarry.cc>
* revert: "ui: enable kitty keyboard protocol"Robin Jarry2024-02-191-1/+2
| | | | | | | | | | | | | | This reverts commit d73cf33c2c6c3e564ce8aff04acc329a06eafc54. This breaks virtually all key bindings on foot. Almost zero ctrl- bindings work, and even in some cases, single key binds, like n don't register anymore. It looked harmless, but I should probably have tested before applying this. Signed-off-by: Robin Jarry <robin@jarry.cc> Acked-by: Tim Culverhouse <tim@timculverhouse.com>
* ui: enable kitty keyboard protocolTim Culverhouse2024-02-191-2/+1
| | | | | | | | | | | | Enable kitty keyboard protocol when support is detected. This will enable keybinds which traditionally have been unavailable due to conflicting with other keys (C-i, C-m, C-[, etc). Reported-by: Jonathan Dowland <jon+aerc-discuss@dow.land> Signed-off-by: Tim Culverhouse <tim@timculverhouse.com> Tested-by: Jonathan Dowland <jon@dow.land> Acked-by: Robin Jarry <robin@jarry.cc>
* ipc: accept verbatim commandsJason Cox2024-02-191-2/+5
| | | | | | | | | | | | | | | | | | | | | | | When aerc receives a command over IPC, it quotes the arguments before passing them on to the internal command parser. In many cases, the parser interprets the quotes, and the command runs with the arguments exactly as they were specified in the shell. In some cases, though, the quotes are not interpreted and the additional quotes can cause the command to fail. Simply eliminating the addition of quotes is not possible because some commands need them. Allow a command and its arguments to be specified as a single argument in the shell. In that case, pass that argument verbatim to the internal command parser so that it is interpreted exactly as if it had been typed directly in aerc's command line. Link: https://lists.sr.ht/~rjarry/aerc-devel/%3C20240203085541.27416-2-contact%40willowbarraco.fr%3E Changelog-added: Execute IPC commands verbatim by providing the command and its args as a single argument in the shell. Cc: Willow Barraco <contact@willowbarraco.fr> Signed-off-by: Jason Cox <me@jasoncarloscox.com> Acked-by: Robin Jarry <robin@jarry.cc>
* format: remove unused codeTim Culverhouse2024-02-191-27/+0
| | | | | | | | Remove unused TruncateHead function. Signed-off-by: Tim Culverhouse <tim@timculverhouse.com> Acked-by: Robin Jarry <robin@jarry.cc>
* store: fix split view blinkingNicolas Dichtel2024-02-151-10/+14
| | | | | | | | | | | | | | | | | | | | | When split view and threading mode are enabled, the message is blinking. First, since commit ddfa5cac1fe9 ("msgstore: fix deadlock in thread builder"), the threadCallback is never set to nil: the thread builder calls it continuously. After setting it to nil, the message is still blinking once. To avoid this, don't call the onSelect method (which points to AccountView.updateSplitView()) from the thread builder: the message is already displayed. Let's rewrite Select and selectPriv: - Select(): it takes the lock and calls the onSelect callback; - selectPriv: the assumption is that the lock is held. It doesn't call the onSelect callback. This function is only used by the thread builder. Fixes: 588be1a28422 ("store: improve cursor position") Fixes: ddfa5cac1fe9 ("msgstore: fix deadlock in thread builder") Signed-off-by: Nicolas Dichtel <nicolas.dichtel@6wind.com> Acked-by: Robin Jarry <robin@jarry.cc>
* hooks: add Message-ID to variables for mail-receivedMoritz Poldrack2024-02-141-0/+1
| | | | | | | | | | | | When scripting for the mail-received hook, it can be useful to identify a mail in a maildir. In that case the Message-ID might be one of the most useful parameters to go for identifying the file of a message. Changelog-changed: Add Message-ID to the variables of `[hooks].mail-received`. Suggested-by: Kirill Chibisov <contact@kchibisov.com> Signed-off-by: Moritz Poldrack <git@moritz.sh> Acked-by: Robin Jarry <robin@jarry.cc>
* log: move package to libRobin Jarry2024-02-1431-29/+241
| | | | | | | 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>
* lib: add function to obtain Message-ID hostnameKarel Balej2024-02-121-0/+20
| | | | | | | | | Make the function already present in app/compose.go reusable while also changing its signature for it not to require involvement of a Composer instance. Signed-off-by: Karel Balej <balejk@matfyz.cz> Acked-by: Robin Jarry <robin@jarry.cc>
* send: move code to lib for reuseKarel Balej2024-02-126-0/+375
| | | | | | | | | | | | | Move the code which handles the preparation of a sender into which the message can be written into lib to allow for reuse. Also hide the sending backend a bit more from the `:send` command code by introducing a NewSender function which determines which backend should be used and invokes the appropriate sender factory function. Rename send() to sendHelper() to avoid collision. Signed-off-by: Karel Balej <balejk@matfyz.cz> Acked-by: Robin Jarry <robin@jarry.cc>
* vaxis: update to v0.7.2 and update ansi parserTim Culverhouse2024-02-126-726/+171
| | | | | | | | | | | | Update Vaxis to v0.7.2 to gain performance improvements and StyledString parsing. The Vaxis parser fully accounts for the terminal's capability to display wide characters. Use the Vaxis StyledString parser to parse and style ansi-encoded strings. Remove unneeded code and tests. Signed-off-by: Tim Culverhouse <tim@timculverhouse.com> Acked-by: Robin Jarry <robin@jarry.cc>
* aerc: set title using vaxisTim Culverhouse2024-02-121-0/+1
| | | | | | | Set the window title using Vaxis at UI initialization. Signed-off-by: Tim Culverhouse <tim@timculverhouse.com> Acked-by: Robin Jarry <robin@jarry.cc>
* mouse: use vaxis mouse eventsTim Culverhouse2024-02-124-17/+13
| | | | | | | Replace all tcell.EventMouse events with vaxis mouse events Signed-off-by: Tim Culverhouse <tim@timculverhouse.com> Acked-by: Robin Jarry <robin@jarry.cc>
* terminal: replace tcell-term with vaxis terminalTim Culverhouse2024-02-122-14/+1
| | | | | | | | Replace tcell terminal with the vaxis terminal. The vaxis terminal is a port of tcell term. Signed-off-by: Tim Culverhouse <tim@timculverhouse.com> Acked-by: Robin Jarry <robin@jarry.cc>
* style: use vaxis style everywhereTim Culverhouse2024-02-125-117/+125
| | | | | | | Replace all tcell.Style objects with vaxis.Style objects Signed-off-by: Tim Culverhouse <tim@timculverhouse.com> Acked-by: Robin Jarry <robin@jarry.cc>
* aerc: replace tcell keys with vaxis keysTim Culverhouse2024-02-122-23/+25
| | | | | | | Replace all instances of tcell key usage with vaxis keys Signed-off-by: Tim Culverhouse <tim@timculverhouse.com> Acked-by: Robin Jarry <robin@jarry.cc>
* fill: replace tcell.Style with vaxis.StyleTim Culverhouse2024-02-122-7/+5
| | | | | | | Replace the Fill implementation with vaxis style objects Signed-off-by: Tim Culverhouse <tim@timculverhouse.com> Acked-by: Robin Jarry <robin@jarry.cc>
* ui: initialize vaxis directly, drop tcell.Screen initializationTim Culverhouse2024-02-123-29/+20
| | | | | | | | Use Vaxis library directly to initialize the UI, dropping the need for a tcell Screen implementation Signed-off-by: Tim Culverhouse <tim@timculverhouse.com> Acked-by: Robin Jarry <robin@jarry.cc>
* ui: remove screen and viewportsTim Culverhouse2024-02-123-69/+73
| | | | | | | | Remove references to tcell.Screen or views.Viewports. Convert Contexts and the core UI struct to use Vaxis objects only. Signed-off-by: Tim Culverhouse <tim@timculverhouse.com> Acked-by: Robin Jarry <robin@jarry.cc>
* aerc: change event interfaces to vaxis eventsTim Culverhouse2024-02-128-16/+18
| | | | | | | | | | Modify the function signature of Event and MouseEvent interfaces to accept vaxis events. Note that because a vaxis event is an empty interface, the implementations are not affected and the events are delivered as they were before Signed-off-by: Tim Culverhouse <tim@timculverhouse.com> Acked-by: Robin Jarry <robin@jarry.cc>
* msgviewer: implement inline image viewingTim Culverhouse2024-02-121-0/+1
| | | | | | | | | | | | | | | | | Implement inline image viewing for jpeg, png, bmp, tiff, and webp formats. When a user has no configured image filter and the image is supported and the terminal has either sixel or kitty image protocol support, the image will be displayed in the message viewer. Always clear the screen before each draw. This call is necessary in vaxis to allow for images to be cleared properly between renders. There is no performance impact: the call only resets each cell to a blank cell, and aerc will redraw each one already. Changelog-added: Inline image previews when no filter is defined for `image/*` and the terminal supports it. Signed-off-by: Tim Culverhouse <tim@timculverhouse.com> Acked-by: Robin Jarry <robin@jarry.cc>
* ui: create and expose vaxis Window with ContextTim Culverhouse2024-02-121-2/+11
| | | | | | | | | Create and expose a vaxis.Window object with each Context. vaxis.Windows are used for creating local coordinates (similar to the views.View API that tcell provides). Signed-off-by: Tim Culverhouse <tim@timculverhouse.com> Acked-by: Robin Jarry <robin@jarry.cc>
* ui: so long tcellTim Culverhouse2024-02-121-1/+11
| | | | | | | | | | | | | Replace tcell with vaxis. Vaxis provides several new features (none of which are included in this commit). All behavior should be exactly the same as previous, with one exception: Vaxis does not have an internal terminfo library. Some terminals will now have RGB that didn't before, as well as any other feature that was falling back to some unknown state. Signed-off-by: Tim Culverhouse <tim@timculverhouse.com> Acked-by: Robin Jarry <robin@jarry.cc>
* parse/ansi: remove tcell/terminfo dependencyTim Culverhouse2024-02-122-69/+69
| | | | | | | | | | | | The parse library builds an ansi-escaped string based on a buffer of styled cells. Use constants which aerc will still parse properly (and are the same as the terminfo package was pulling in) to remove dependency on tcell/terminfo. Additionally, we can use the internal go "fmt" package to write strings instead of the terminfo.TParm method (which is much slower at formatting strings). Signed-off-by: Tim Culverhouse <tim@timculverhouse.com> Acked-by: Robin Jarry <robin@jarry.cc>
* view: only set seen flag if not presentRobin Jarry2024-02-111-1/+2
| | | | | | | | No need to do anything if the message was already seen once. Signed-off-by: Robin Jarry <robin@jarry.cc> Reviewed-by: Bence Ferdinandy <bence@ferdinandy.com>
* calendar: make invitation matching case-insensitiveMoritz Poldrack2024-02-111-1/+2
| | | | | | | | | | | | | | Since some organisations are using capitalised email-adresses, there is no guarantee that invitations are received by an address of the same case. Fixes: 62982a9a ("invites: reply with accept, accept-tentative or decline") Changelog-fixed: Calendar responses now ignore case. Reported-by: "Bart Libert" <bart@libert.email> Signed-off-by: Moritz Poldrack <git@moritz.sh> Tested-by: Koni Marti <koni.marti@gmail.com> Acked-by: Robin Jarry <robin@jarry.cc>
* main: improve version stringRobin Jarry2024-02-013-0/+29
| | | | | | | | | | | | | | | | | | | | | | | Initialize a build variable to the date on which the binary was generated. Include the date in the build info string which is output when running aerc -v and in the crash logs. Do not rely on parsing the build flags via some obscure base64 voodoo to determine if notmuch support is available or not. Instead, use the symbols from the linked library directly if available. Before: $ aerc -v 0.16.0-183-g4cc2e6be3a01 +notmuch (go1.21.6 amd64 linux) After: $ aerc -v aerc 0.16.0-183-g4cc2e6be3a01 +notmuch-5.6.0 (go1.21.6 amd64 linux 2024-01-31) Signed-off-by: Robin Jarry <robin@jarry.cc> Acked-by: Ciarán Ainsworth <cda@sporiff.dev>
* 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>
* ipc: wait for app to be ready before accepting commandsRobin Jarry2024-01-311-2/+6
| | | | | | | | | | | | | | | | | | | | | | | | | | | Pass a cancellable context to the IPC server and defer accepting connections until the first worker message has been received by the main thread. This is not a real fix for the :split command not working at startup. :split requires a mail store to be present on the currently selected account tab+folder. I could have waited for a types.DirectoryContents message but it seems silly and bug prone since such a message may never arrive and we don't want to pool IPC messages forever. Also, a types.DirectoryContents message may arrive for one account but :split is only effective *per account* and the default selected account tab is the first one. In any case, this band aid prevents aerc from crashing or breaking down the terminal when running IPC commands in the aerc-startup hook. Fixes: https://lists.sr.ht/~rjarry/aerc-devel/%3CCYPN7AVYQ69S.WV0T67VM6WX3%40wegtam.com%3E Fixes: https://todo.sr.ht/~rjarry/aerc/173 Reported-by: Jens Grassel <jens@wegtam.com> Reported-by: Justine Smithies <justine@smithies.me.uk> Signed-off-by: Robin Jarry <robin@jarry.cc> Tested-by: Thomas Böhler <witcher@wiredspace.de> Reviewed-by: Thomas Böhler <witcher@wiredspace.de>
* flags: add support for draft flagJason Cox2024-01-261-0/+10
| | | | | | | | | | | | | | Support the draft flag wherever flags are used. Automatically set it when postponing a message, and allow recalling a message without the -f flag if it has the draft flag set, regardless of what folder it's in. Notmuch doesn't seem to pick up on the draft flag when indexing even though the flag is set on the maildir file. Explicitly set all tags corresponding to set flags when appending a message in notmuch. Changelog-added: Support the `draft` flag. Signed-off-by: Jason Cox <me@jasoncarloscox.com> Acked-by: Robin Jarry <robin@jarry.cc>
* tabs: optimize switching by offsetsdelitako2024-01-261-0/+12
| | | | | | | | | | | | | | | | | I imagine no sane user requires aerc to correctly handle commands like `:next-tab 1000000000`, but I tried anyway and it froze aerc while also eating up many GBs of system memory. This behavior is not ideal, so I improved it. This commit adds functions for selecting a tab at an offset from the currently-selected tab and changes the next-tab, prev-tab, and change-tab commands to use these functions instead of looping. Signed-off-by: delitako <delitako@delitako.xyz> Tested-by: Thomas Böhler <witcher@wiredspace.de> Reviewed-by: Thomas Böhler <witcher@wiredspace.de> Acked-by: Robin Jarry <robin@jarry.cc>
* msgstore: create destination folder on store.AppendJohannes Thyssen Tishman2024-01-251-0/+7
| | | | | | | | | When appending a message to a folder, always create the destination folder if it doesn't exist. Signed-off-by: Johannes Thyssen Tishman <johannes@thyssentishman.com> Acked-by: Robin Jarry <robin@jarry.cc>
* hook: add mail-sent hookMoritz Poldrack2024-01-251-0/+31
| | | | | | | | | Add a hook to trigger when a message is sent. References: https://todo.sr.ht/~rjarry/aerc/136 Signed-off-by: Moritz Poldrack <git@moritz.sh> Tested-by: Bence Ferdinandy <bence@ferdinandy.com> Acked-by: Robin Jarry <robin@jarry.cc>
* commands: add menuRobin Jarry2024-01-201-0/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Add a new :menu command that can be used to spawn a shell command in an interactive dialog and execute aerc commands for each of the lines printed on its standard output like xargs(1) would do in a shell. The shell command can be configured in aerc.conf under [general].default-menu-cmd and overridden via the :menu -c <cmd> option. There are two flags to provide input text to the shell command which can be useful in combination with other aerc commands: -a: All account names, one per line: '<account>' LF -d: All current account directory names, one per line: '<directory>' LF -ad: All directories of all accounts, one per line: '<account>' '<directory>' LF Here are some examples: :menu -adc fzf :cf -a :menu -c 'fzf --multi' :attach :menu -dc 'fzf --multi' :cp And also for key bindings: <C-p> = :menu -adc fzf :cf -a<Enter> Changelog-added: New `:menu` command to invoke other aerc commands based on a shell command output. Signed-off-by: Robin Jarry <robin@jarry.cc> Tested-by: Bence Ferdinandy <bence@ferdinandy.com> Tested-by: Johannes Thyssen Tishman <johannes@thyssentishman.com>
* templates: add basic string functionsMoritz Poldrack2024-01-191-5/+20
| | | | | | | | | | | | | Some clients are sending a text/plain part that contains nothing but the text/html part. This is rather suboptimal when replying. To be able to filter these, it is important to be able to detect things like <!doctype html>. Add basic string operations to the template functions. Signed-off-by: Moritz Poldrack <git@moritz.sh> Tested-by: Koni Marti <koni.marti@gmail.com> Acked-by: Robin Jarry <robin@jarry.cc>
* rfc822: modify unit tests for message date parsingVitaly Ovchinnikov2024-01-171-6/+21
| | | | | | | | | | | Modify the message date parser tests so they accept all the possible parsing results, depending on the user's locale settings. Fixes: 49a8cf10935f ("rfc822: improve dates parsing") Reported-by: Jason Cox <me@jasoncarloscox.com> Signed-off-by: Vitaly Ovchinnikov <v@ovch.ru> Tested-by: Jason Cox <me@jasoncarloscox.com> Acked-by: Robin Jarry <robin@jarry.cc>
* templates: move signature from compose to templatesBence Ferdinandy2024-01-081-0/+66
| | | | | | | | | | | | | | | | Currently, when composing a new message, everything is read from the template files, except the signature, which is added directly in the compose code. Add a new template variable {{.Signature}}, by moving the logic of reading signature from command or file from compose to templates. Update the various default template files to preserve the original placement of signatures. Users using the default templates should not notice the change. Users with custom compose templates will need to update their templates with {{.Signature}}. Changelog-changed: Signature placement is now controlled via the `{{.Signature}}` template variable and not hardcoded. Signed-off-by: Bence Ferdinandy <bence@ferdinandy.com> Acked-by: Robin Jarry <robin@jarry.cc>
* templates: add full path of file(s) as Filename(s)Bence Ferdinandy2023-12-311-0/+17
| | | | | | | | | | | | | For the maildir and notmuch backends, add the full path of the message as Filename to templates. In case of a notmuch message having multiple files associated with it, it returns a random path. Also add Filenames to templates, which is a list of all associated message paths. This is relevant for the notmuch backend, where a single messages is shown, if there are multiple copies of it. Changelog-added: Add filepath to messages in templates as .Filename(s) Signed-off-by: Bence Ferdinandy <bence@ferdinandy.com> Acked-by: Robin Jarry <robin@jarry.cc>
* rfc822: improve dates parsingVitaly Ovchinnikov2023-12-302-10/+91
| | | | | | | | Provide better parsing of email dates with timezone names, but without numeric offsets. Add unit tests to check the new behaviour. Signed-off-by: Vitaly Ovchinnikov <v@ovch.ru> Acked-by: Robin Jarry <robin@jarry.cc>
* lib: introduce FindMIMEPart, adapt Find{Plain,Calendar}textSebastien Binet2023-12-301-15/+10
| | | | | | | | | | introduce a general FindMIMEPart function to find a message part with the given MIME type. reimplement FindPlaintext and FindCalendartext in terms of this new FindMIMEPart function. Signed-off-by: Sebastien Binet <s@sbinet.org> 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>