GothenburgBitFactory / GothenburgBitFactory/timewarrior

Store command-line in undo file

Open
#349 1 comment 1 reaction 0 assignees View on GitHub
discussion enhancement
Dominant language
C++
Stars
1.7k
Forks
117
Avg merge
1d 7h
Merged PRs (30d)
5

Description

In order to avoid surprises, I would like when I'm undoing commands to see something that indicates what command is being undone.

One thought is for the undo.data file to include a `type:cli` that includes a 'normalized' command that produced the interval changes. I say normalized so that any dates and times (both relative and implied) as added to the CLI in order to be able to print something that a user could type in to recreate the change. I.e.

Instead of:
```
$ src/timew tag a
Note: 'a' is a new tag.
Added a to @1
$ src/timew tag b
Note: 'b' is a new tag.
Added b to @1
$ src/timew undo
Undo
$ src/timew undo
Undo
```

You would have something like:
```
$ src/timew tag a
Note: 'a' is a new tag.
Added a to @1
$ src/timew tag b
Note: 'b' is a new tag.
Added b to @1
$ src/timew undo
Undid: tag a
$ src/timew undo
Undid: tag b
```

Contributor guide

Open the contributing guide

Research direction

Start by reading how the undo command uses undo.data, then trace how CLI commands record interval changes. Define how a normalized command, including implied dates and times, would be stored and displayed; done means undo reports which command it reversed without surprises.

Written by the indexing model from the issue text.

Assessment

Tech stack
cpp
Domain
cli
Issue type
Feature
Difficulty
5/5
Estimated time
Over a week
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.