(d4ce964) Record status, owner and tag changes in a history log, and bump to 0.29.0
The comments directory was already an append-only log with one event kind. It is now .worklane/history/<uuid>/, with the kind in the entry and in the filename after the stamp, so a ticket says how it got where it is and not only what was said about it. mv, chown and set --tags each write an entry after their own save and behind their own no-change return, so a refused or no-op edit records nothing. --actor is on all four writers now. An old comments directory is adopted on first access and a file with no marker reads as the comment it is, so nothing is migrated or rewritten. The log moves to src/history.rs, out of util.rs and handlers.rs, and the card's counter counts comments only: a ticket that has moved three times has not been talked about. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
This commit is contained in:
co-authored by
Claude Opus 5
parent
a1bdb5df49
commit
f454d212a4
+20
-4
@@ -180,6 +180,12 @@ fn annotation_line(raw: &str) -> Result<String, String> {
|
||||
}
|
||||
}
|
||||
|
||||
/// What `--actor` says on every command that writes a history entry.
|
||||
///
|
||||
/// One string, so the four spell it the same: a flag documented differently on each
|
||||
/// command reads as four flags.
|
||||
const ACTOR_HELP: &str = "Who the entry is attributed to, overriding WORKLANE_ACTOR and the git user. Free text, checked against nothing";
|
||||
|
||||
/// Arguments that carry prose, and therefore have to accept a value starting with
|
||||
/// a hyphen.
|
||||
///
|
||||
@@ -221,6 +227,9 @@ pub enum Command {
|
||||
/// Force move (allows backward or non-sequential moves)
|
||||
#[arg(short, long)]
|
||||
force: bool,
|
||||
|
||||
#[arg(long, help = ACTOR_HELP)]
|
||||
actor: Option<String>,
|
||||
},
|
||||
|
||||
/// Replace fields on an existing ticket
|
||||
@@ -267,12 +276,9 @@ pub enum Command {
|
||||
#[arg(allow_hyphen_values = PROSE)]
|
||||
body: String,
|
||||
|
||||
/// Who the comment is attributed to, overriding `WORKLANE_ACTOR` and the git
|
||||
/// user. Free text, checked against nothing
|
||||
///
|
||||
/// Named after the writer of the entry, not after the ticket's assignee, which
|
||||
/// is `chown`'s. It was `--owner`, which said the wrong one of the two.
|
||||
#[arg(long)]
|
||||
#[arg(long, help = ACTOR_HELP)]
|
||||
actor: Option<String>,
|
||||
},
|
||||
|
||||
@@ -732,6 +738,11 @@ pub struct SetArgs {
|
||||
/// is `chown --clear`'s. The reasoning for each is on `util::Clearable`.
|
||||
#[arg(long, value_name = "FIELD")]
|
||||
pub clear: Vec<Clearable>,
|
||||
|
||||
/// Only reaches the entry `--tags` writes, since that is the one field of this
|
||||
/// command's that is logged
|
||||
#[arg(long, help = ACTOR_HELP)]
|
||||
pub actor: Option<String>,
|
||||
}
|
||||
|
||||
impl SetArgs {
|
||||
@@ -777,6 +788,11 @@ pub struct ChownArgs {
|
||||
/// user to name
|
||||
#[arg(long, value_name = "TICKET", value_parser = non_empty)]
|
||||
pub clear: Option<String>,
|
||||
|
||||
/// Not the same as `user`, which is the ticket's new assignee: this is who made the
|
||||
/// change. Both are on this command because it writes both.
|
||||
#[arg(long, help = ACTOR_HELP)]
|
||||
pub actor: Option<String>,
|
||||
}
|
||||
|
||||
impl ChownArgs {
|
||||
|
||||
Reference in New Issue
Block a user