Elffuss BraidHub

utopia-ia/elffuss-braid public

Changesets name the agent that made them

Every changeset braid makes for an agent now carries the extra field
("agent", <label>), the label of --agent or BRAID_AGENT: commit, change
create, the merge git sync makes, and the changesets land and update
rebase, which keep the original's extra fields and so its agent. A
commit that finishes a rebase keeps the rebased changeset's fields too,
where it used to keep only rebased-from; a change without an agent gets
the one that resolved it. braid_engine::AGENT names the field, and
merge takes the extra fields of the merge changeset.

log and show give the agent: an "agent" field in JSON, "(agent)" after
the author in log, and an agent line in show. --agent says what it is
recorded for: the op log, for refs a command moves, and the changesets
it creates.
Changeset3533fe68b31414acd8671b386589692a7880908fe2723b5aba2ee44cccf29271
AuthorKikoCis <KikoCis@users.noreply.github.com> · 2026-10-15 23:41 +02:00
CommitterKikoCis <KikoCis@users.noreply.github.com> · 2026-10-15 23:41 +02:00
Parentsc03d76685fb3

Browse the files at this changeset

13 files changed

modified crates/cli/src/main.rs +18 −2
@@ -34,7 +34,9 @@
3434 #[arg(long, global = true, value_name = "DIR")]
3535 repo: Option<PathBuf>,
3636
37- /// Label recorded in the op log for operations made by this command.
37+ /// Who is acting: a label recorded in the op log with every ref this
38+ /// command moves, and as the `agent` field of every changeset it
39+ /// creates.
3840 #[arg(long, global = true, env = "BRAID_AGENT", default_value = "cli")]
3941 agent: String,
4042
@@ -614,6 +616,15 @@
614616 })
615617 }
616618
619+/// The agent a changeset names in its `agent` field, if it names one.
620+fn agent_of(changeset: &Changeset) -> Option<String> {
621+ changeset
622+ .extras
623+ .iter()
624+ .find(|(key, _)| key.as_slice() == braid_engine::AGENT)
625+ .map(|(_, value)| String::from_utf8_lossy(value).into_owned())
626+}
627+
617628 fn changeset_json(id: &ObjectId, changeset: &Changeset) -> Value {
618629 json!({
619630 "id": id.to_hex(),
@@ -621,6 +632,7 @@
621632 "root": changeset.root.to_hex(),
622633 "author": signature_json(&changeset.author),
623634 "committer": signature_json(&changeset.committer),
635+ "agent": agent_of(changeset),
624636 "message": String::from_utf8_lossy(&changeset.message),
625637 "extras": changeset.extras.iter().map(|(k, v)| json!([
626638 String::from_utf8_lossy(k), String::from_utf8_lossy(v)
@@ -660,9 +672,10 @@
660672 } else {
661673 let mut out = io::stdout().lock();
662674 for (id, changeset) in &entries {
675+ let agent = agent_of(changeset).map_or_else(String::new, |agent| format!(" ({agent})"));
663676 writeln!(
664677 out,
665- "{} {} {} {}",
678+ "{} {} {}{agent} {}",
666679 id.short(),
667680 format_signature_time(&changeset.author),
668681 String::from_utf8_lossy(&changeset.author.name),
@@ -723,6 +736,9 @@
723736 format_signature_time(signature)
724737 )?;
725738 }
739+ if let Some(agent) = agent_of(&changeset) {
740+ writeln!(out, "agent {agent}")?;
741+ }
726742 writeln!(out)?;
727743 for line in String::from_utf8_lossy(&changeset.message).lines() {
728744 writeln!(out, " {line}")?;
modified crates/cli/src/work.rs +2 −0
@@ -426,6 +426,7 @@
426426 paths: workspace_paths(&workspace, &args.paths)?,
427427 author: None,
428428 committer: identity(&args.identity, &target.repo)?,
429+ agent: cli.agent.clone(),
429430 force: args.force,
430431 };
431432 let outcome = workspace.commit(&request)?;
@@ -704,6 +705,7 @@
704705 expects,
705706 message: args.message.as_bytes().to_vec(),
706707 author: author.clone(),
708+ agent: cli.agent.clone(),
707709 };
708710 let change = braid_wc::create_change(repo.store(), &request)?;
709711 let landing = match &args.land {
modified crates/cli/tests/workspaces.rs +60 −8
@@ -53,24 +53,26 @@
5353
5454 /// Runs braid in `dir` with a fixed author and agent.
5555 fn braid(dir: &Path, args: &[&str]) -> Output {
56+ braid_as("tester", dir, args)
57+}
58+
59+/// Runs braid in `dir` with a fixed author, as the agent `agent`.
60+fn braid_as(agent: &str, dir: &Path, args: &[&str]) -> Output {
5661 Command::new(env!("CARGO_BIN_EXE_braid"))
5762 .current_dir(dir)
5863 .args(args)
5964 .env("BRAID_AUTHOR", AUTHOR)
60- .env("BRAID_AGENT", "tester")
65+ .env("BRAID_AGENT", agent)
6166 .output()
6267 .unwrap()
6368 }
6469
65-fn stderr(out: &Output) -> String {
66- String::from_utf8_lossy(&out.stderr).into_owned()
67-}
68-
69-/// Runs braid with `--json`, expecting exit status `code`.
70-fn json_status(dir: &Path, args: &[&str], code: i32) -> Value {
70+/// Runs braid with `--json` as the agent `agent`, expecting exit status
71+/// `code`.
72+fn json_as(agent: &str, dir: &Path, args: &[&str], code: i32) -> Value {
7173 let mut all = args.to_vec();
7274 all.push("--json");
73- let out = braid(dir, &all);
75+ let out = braid_as(agent, dir, &all);
7476 assert_eq!(
7577 out.status.code(),
7678 Some(code),
@@ -81,6 +83,15 @@
8183 serde_json::from_slice(&out.stdout).unwrap()
8284 }
8385
86+fn stderr(out: &Output) -> String {
87+ String::from_utf8_lossy(&out.stderr).into_owned()
88+}
89+
90+/// Runs braid with `--json`, expecting exit status `code`.
91+fn json_status(dir: &Path, args: &[&str], code: i32) -> Value {
92+ json_as("tester", dir, args, code)
93+}
94+
8495 fn json(dir: &Path, args: &[&str]) -> Value {
8596 json_status(dir, args, 0)
8697 }
@@ -541,6 +552,47 @@
541552 assert_eq!(committed["changeset"].as_str().unwrap().len(), 64);
542553 }
543554
555+#[test]
556+fn changesets_name_the_agent_that_made_them() {
557+ let repo = Repo::new();
558+ seed(&repo, &[("shared.txt", "one\ntwo\nthree\n")]);
559+ let a = repo.workspace("a");
560+ let b = repo.workspace("b");
561+ write(&a, "shared.txt", "one\nTWO from a\nthree\n");
562+ json_as("agent-a", &a, &["commit", "-m", "a's two"], 0);
563+ json_as("agent-a", &a, &["land"], 0);
564+ write(&b, "b.txt", "b\n");
565+ json_as("agent-b", &b, &["commit", "-m", "add b"], 0);
566+ write(&b, "shared.txt", "one\nTWO from b\nthree\n");
567+ json_as("agent-b", &b, &["commit", "-m", "b's two"], 0);
568+
569+ // Rebased by an update and resolved under another label, b's changes
570+ // still name agent-b; landing records the lander in the op log only.
571+ json_as("fixer", &b, &["update"], 2);
572+ write(&b, "shared.txt", "one\nTWO from a and b\nthree\n");
573+ json_as("fixer", &b, &["commit"], 0);
574+ let landed = json_as("lander", &b, &["land"], 0);
575+ let log = history(&repo);
576+ let agents: Vec<&str> = log.iter().map(|c| c["agent"].as_str().unwrap()).collect();
577+ assert_eq!(agents, ["agent-b", "agent-b", "agent-a", "tester"]);
578+ for changeset in &log[..2] {
579+ assert!(rebased_from(changeset).is_some());
580+ let extras = changeset["extras"].as_array().unwrap();
581+ assert_eq!(extras[0], serde_json::json!(["agent", "agent-b"]));
582+ }
583+ let ops = json(&repo.root, &["op", "log", "-n", "1"]);
584+ assert_eq!(ops[0]["agent"], "lander");
585+ assert_eq!(ops[0]["seq"], landed["operation"]);
586+
587+ // The text forms show it too.
588+ let out = braid(&repo.root, &["show", "main"]);
589+ let text = String::from_utf8(out.stdout).unwrap();
590+ assert!(text.contains("\nagent agent-b\n"), "{text}");
591+ let out = braid(&repo.root, &["log", "-n", "1"]);
592+ let text = String::from_utf8(out.stdout).unwrap();
593+ assert!(text.contains(" Ada (agent-b) b's two"), "{text}");
594+}
595+
544596 #[test]
545597 fn removing_a_workspace() {
546598 let repo = Repo::new();
modified crates/engine/src/land.rs +6 −0
@@ -45,6 +45,12 @@
4545 /// changeset it was rebased from.
4646 pub const REBASED_FROM: &[u8] = b"rebased-from";
4747
48+/// The extra field naming the agent that made a changeset: its label, as
49+/// the command line's `--agent` gives it. A rebased changeset keeps the
50+/// original's, as it keeps every extra field but [`REBASED_FROM`], so the
51+/// field names the agent that made the change, wherever it landed.
52+pub const AGENT: &[u8] = b"agent";
53+
4854 /// What landing a change does to the branch.
4955 #[derive(Clone, Debug, PartialEq, Eq)]
5056 pub enum LandOutcome {
modified crates/engine/src/lib.rs +1 −1
@@ -70,7 +70,7 @@
7070 pub use commit::{admit, commit};
7171 pub use diff::diff;
7272 pub use error::{ApplyProblem, Error, StoreError};
73-pub use land::{Conflict, ConflictKind, LandOutcome, REBASED_FROM, land};
73+pub use land::{AGENT, Conflict, ConflictKind, LandOutcome, REBASED_FROM, land};
7474 pub use merge::{BINARY_SNIFF_BYTES, ConflictHunk, HunkSide, MergeResult, is_binary, merge3};
7575 pub use path::MAX_PATH_DEPTH;
7676 pub use tree_merge::{MergeOutcome, merge};
modified crates/engine/src/tree_merge.rs +54 −11
@@ -46,7 +46,8 @@
4646 /// [`merge_bases`](crate::merge_bases)). The merge changeset has the parents
4747 /// `[ours, theirs]`; as root, the three-way merge of the three trees; the
4848 /// change list against `ours`; `committer` as author and committer;
49-/// `message`; and no extra fields. It is made even when `ours` already has
49+/// `message`; and `extras` as its extra fields, such as [`AGENT`](crate::AGENT)
50+/// naming who merged. It is made even when `ours` already has
5051 /// every change of `theirs`, with an empty change list, so that its history
5152 /// records the merge. Blobs, directories and the changeset are stored only
5253 /// when the outcome is [`Merged`](MergeOutcome::Merged).
@@ -66,6 +67,7 @@
6667 theirs: ObjectId,
6768 committer: Signature,
6869 message: Vec<u8>,
70+ extras: Vec<(Vec<u8>, Vec<u8>)>,
6971 ) -> Result<MergeOutcome, Error> {
7072 let bases = merge_bases(objects, ours, theirs)?;
7173 let base_root = match bases.as_slice() {
@@ -105,7 +107,7 @@
105107 author: committer.clone(),
106108 committer,
107109 message,
108- extras: Vec::new(),
110+ extras,
109111 git_origin: None,
110112 }
111113 .assemble()
@@ -144,7 +146,7 @@
144146 use super::*;
145147 use crate::access::read_changes;
146148 use crate::commit::{admit, commit};
147- use crate::land::{ConflictKind, LandOutcome, land};
149+ use crate::land::{AGENT, ConflictKind, LandOutcome, land};
148150 use crate::testing::{Repo, delete, signature, text_map};
149151 use braid_format::{Change, Changes};
150152
@@ -185,6 +187,7 @@
185187 fork.theirs,
186188 signature("merger"),
187189 b"Merge\n".to_vec(),
190+ vec![(AGENT.to_vec(), b"merger".to_vec())],
188191 )
189192 .unwrap()
190193 }
@@ -223,7 +226,17 @@
223226 let later = repo.commit(&[next], vec![repo.set("b", "1")]);
224227 let objects = &repo.objects;
225228 let stored = objects.len();
226- let run = |ours, theirs| merge(objects, ours, theirs, signature("m"), Vec::new()).unwrap();
229+ let run = |ours, theirs| {
230+ merge(
231+ objects,
232+ ours,
233+ theirs,
234+ signature("m"),
235+ Vec::new(),
236+ Vec::new(),
237+ )
238+ .unwrap()
239+ };
227240 assert_eq!(run(base, later), MergeOutcome::FastForward(later));
228241 assert_eq!(run(later, base), MergeOutcome::UpToDate);
229242 assert_eq!(run(later, next), MergeOutcome::UpToDate);
@@ -253,7 +266,7 @@
253266 assert_eq!(new.author, signature("merger"));
254267 assert_eq!(new.committer, signature("merger"));
255268 assert_eq!(new.message, b"Merge\n");
256- assert!(new.extras.is_empty());
269+ assert_eq!(new.extras, [(AGENT.to_vec(), b"merger".to_vec())]);
257270 assert_eq!(new.git_origin, None);
258271
259272 // Merging the other way gives the same tree.
@@ -263,6 +276,7 @@
263276 f.ours,
264277 signature("merger"),
265278 Vec::new(),
279+ Vec::new(),
266280 )
267281 .unwrap();
268282 let MergeOutcome::Merged { changeset, .. } = back else {
@@ -390,7 +404,16 @@
390404 );
391405 let (first, _) = merged(&f);
392406 let repo = &f.repo;
393- let run = |ours, theirs| merge(&repo.objects, ours, theirs, signature("m"), Vec::new());
407+ let run = |ours, theirs| {
408+ merge(
409+ &repo.objects,
410+ ours,
411+ theirs,
412+ signature("m"),
413+ Vec::new(),
414+ Vec::new(),
415+ )
416+ };
394417 assert_eq!(run(first, f.theirs).unwrap(), MergeOutcome::UpToDate);
395418 assert_eq!(
396419 run(f.theirs, first).unwrap(),
@@ -413,7 +436,14 @@
413436 let repo = Repo::new();
414437 let one = repo.commit(&[], vec![repo.set("a", "1")]);
415438 let two = repo.commit(&[], vec![repo.set("b", "1")]);
416- let result = merge(&repo.objects, one, two, signature("m"), Vec::new());
439+ let result = merge(
440+ &repo.objects,
441+ one,
442+ two,
443+ signature("m"),
444+ Vec::new(),
445+ Vec::new(),
446+ );
417447 assert!(
418448 matches!(result, Err(Error::UnrelatedHistories { ours, theirs }) if ours == one && theirs == two),
419449 "{result:?}"
@@ -446,7 +476,14 @@
446476 let m2 = node(&repo, &[y, x], vec![repo.set("a", "x")], "m2");
447477 let ours = node(&repo, &[m1], vec![repo.set("c", "1")], "ours");
448478 let theirs = node(&repo, &[m2], vec![repo.set("d", "1")], "theirs");
449- let result = merge(&repo.objects, ours, theirs, signature("m"), Vec::new());
479+ let result = merge(
480+ &repo.objects,
481+ ours,
482+ theirs,
483+ signature("m"),
484+ Vec::new(),
485+ Vec::new(),
486+ );
450487 assert!(
451488 matches!(&result, Err(Error::SeveralMergeBases { bases, .. }) if bases.len() == 2),
452489 "{result:?}"
@@ -460,9 +497,15 @@
460497 let m2 = node(&repo, &[y, x], Vec::new(), "m2 again");
461498 let ours = node(&repo, &[m1], vec![repo.set("c", "1")], "ours again");
462499 let theirs = node(&repo, &[m2], vec![repo.set("d", "1")], "theirs again");
463- let MergeOutcome::Merged { changeset, .. } =
464- merge(&repo.objects, ours, theirs, signature("m"), Vec::new()).unwrap()
465- else {
500+ let MergeOutcome::Merged { changeset, .. } = merge(
501+ &repo.objects,
502+ ours,
503+ theirs,
504+ signature("m"),
505+ Vec::new(),
506+ Vec::new(),
507+ )
508+ .unwrap() else {
466509 panic!("expected a merge");
467510 };
468511 assert_eq!(
modified crates/engine/tests/properties.rs +1 −1
@@ -433,7 +433,7 @@
433433 Vec::new(),
434434 )?;
435435 let landed = land(&objects, Some(x), y, signature())?;
436- let merged = merge(&objects, x, y, signature(), b"merge\n".to_vec())?;
436+ let merged = merge(&objects, x, y, signature(), b"merge\n".to_vec(), Vec::new())?;
437437 match (landed, merged) {
438438 (LandOutcome::Conflicts(by_land), MergeOutcome::Conflicts(by_merge)) => {
439439 prop_assert_eq!(by_land, by_merge);
modified crates/repo/src/sync.rs +5 −2
@@ -9,7 +9,7 @@
99 use std::fs::{self, File, OpenOptions};
1010 use std::path::{Path, PathBuf};
1111
12-use braid_engine::{Conflict, MergeOutcome, is_ancestor, merge};
12+use braid_engine::{AGENT, Conflict, MergeOutcome, is_ancestor, merge};
1313 use braid_format::{Kind, MemoryObjects, ObjectId, Objects, Signature};
1414 use braid_git::{Exporter, GitKind, GitOid, ImportOptions, RefTarget};
1515 use braid_store::{Operation, Store};
@@ -179,7 +179,8 @@
179179 /// moved) as a fast-forward with a lease. Braid never force-pushes.
180180 /// Operations are recorded by `agent`, who is also the committer of a
181181 /// merge, with the `email` of the repository's [`Config`](crate::Config)
182- /// or `<agent>@example.org`.
182+ /// or `<agent>@example.org`, and whom the merge's
183+ /// [`AGENT`](braid_engine::AGENT) field names.
183184 ///
184185 /// # The mirror
185186 ///
@@ -494,12 +495,14 @@
494495 }
495496 (Some(head), Some(remote)) => {
496497 let message = format!("Merge {} into {}\n", self.remote_ref, self.branch);
498+ let agent = vec![(AGENT.to_vec(), self.agent.as_bytes().to_vec())];
497499 match merge(
498500 objects,
499501 head,
500502 remote,
501503 self.committer.clone(),
502504 message.into_bytes(),
505+ agent,
503506 )? {
504507 MergeOutcome::UpToDate => Decision::Push(head),
505508 MergeOutcome::FastForward(to) => Decision::FastForward(to),
modified crates/repo/src/sync/tests.rs +6 −0
@@ -469,6 +469,11 @@
469469 let theirs_changeset = world.map().changeset(&oid(&theirs)).unwrap();
470470 let merged = read_changeset(world.braid.store(), merge).unwrap();
471471 assert_eq!(merged.parents, [ours, theirs_changeset]);
472+ // The merge names the agent that made it.
473+ assert_eq!(
474+ merged.extras,
475+ [(braid_engine::AGENT.to_vec(), b"tester".to_vec())]
476+ );
472477 assert_eq!(report.operations.len(), 2, "the merge, then the push");
473478
474479 // The remote has both lines and the merge commit, a fast-forward from
@@ -485,6 +490,7 @@
485490 text.contains("\ncommitter tester <tester@example.org> "),
486491 "{text}"
487492 );
493+ assert!(text.contains("\nagent tester\n"), "{text}");
488494 assert!(
489495 text.ends_with(&format!("Merge {} into main", report.remote_ref)),
490496 "{text}"
modified crates/wc/src/change.rs +4 −1
@@ -41,6 +41,9 @@
4141 pub message: Vec<u8>,
4242 /// The author, who also commits it.
4343 pub author: Identity,
44+ /// The label of the agent making it, recorded as its
45+ /// [`AGENT`](braid_engine::AGENT) field.
46+ pub agent: String,
4447 }
4548
4649 /// Checks the expectations against the base, stores the contents and the
@@ -118,7 +121,7 @@
118121 signature.clone(),
119122 signature,
120123 request.message.clone(),
121- Vec::new(),
124+ crate::rebase::agent_extras(&request.agent),
122125 )?;
123126 store.sync()?;
124127 Ok(id)
modified crates/wc/src/rebase.rs +29 −7
@@ -15,8 +15,8 @@
1515 //! the store, unreferenced.
1616
1717 use braid_engine::{
18- Conflict, LandOutcome, REBASED_FROM, commit, diff, entry_at, land, read_blob, read_changes,
19- read_changeset,
18+ AGENT, Conflict, LandOutcome, REBASED_FROM, commit, diff, entry_at, land, read_blob,
19+ read_changes, read_changeset,
2020 };
2121 use braid_format::{
2222 Change, ChangeOp, ChangesetParts, EntryKind, Kind, ObjectId, Objects, Signature,
@@ -178,7 +178,8 @@
178178 return Ok(outcome);
179179 };
180180 // The same tree and change list, with `onto` as the first parent (the
181- // temporary base has `onto`'s tree), naming the original change.
181+ // temporary base has `onto`'s tree), naming the original change. The
182+ // other extra fields are the original's, its agent among them.
182183 let landed = read_changeset(objects, changeset)?;
183184 let changes = read_changes(objects, changeset, &landed)?.into_owned();
184185 let parents = std::iter::once(onto)
@@ -189,7 +190,7 @@
189190 .into_iter()
190191 .filter(|(key, _)| key.as_slice() != REBASED_FROM)
191192 .collect();
192- extras.extend(rebased_extras(change));
193+ extras.push((REBASED_FROM.to_vec(), change.to_hex().into_bytes()));
193194 let rebased = store_parts(
194195 objects,
195196 ChangesetParts {
@@ -373,7 +374,28 @@
373374 })
374375 }
375376
376-/// The extras of a changeset made by finishing a rebase of `change`.
377-pub(crate) fn rebased_extras(change: ObjectId) -> Vec<(Vec<u8>, Vec<u8>)> {
378- vec![(REBASED_FROM.to_vec(), change.to_hex().into_bytes())]
377+/// The extra fields of a changeset: the agent that makes it.
378+pub(crate) fn agent_extras(agent: &str) -> Vec<(Vec<u8>, Vec<u8>)> {
379+ vec![(AGENT.to_vec(), agent.as_bytes().to_vec())]
380+}
381+
382+/// The extra fields of the changeset that finishes a rebase of `change`,
383+/// whose own are `original`: the same, as landing keeps them, with
384+/// [`REBASED_FROM`] naming `change`. The original's [`AGENT`] stays; a change
385+/// without one gets `agent`, who resolved it.
386+pub(crate) fn rebased_extras(
387+ original: &[(Vec<u8>, Vec<u8>)],
388+ change: ObjectId,
389+ agent: &str,
390+) -> Vec<(Vec<u8>, Vec<u8>)> {
391+ let mut extras: Vec<(Vec<u8>, Vec<u8>)> = original
392+ .iter()
393+ .filter(|(key, _)| key.as_slice() != REBASED_FROM)
394+ .cloned()
395+ .collect();
396+ if !extras.iter().any(|(key, _)| key.as_slice() == AGENT) {
397+ extras.splice(0..0, agent_extras(agent));
398+ }
399+ extras.push((REBASED_FROM.to_vec(), change.to_hex().into_bytes()));
400+ extras
379401 }
modified crates/wc/src/workspace.rs +11 −6
@@ -27,7 +27,7 @@
2727 use crate::identity::Identity;
2828 use crate::markers::has_markers;
2929 use crate::paths::{is_within, os_name, split_last};
30-use crate::rebase::{First, Replayed, conflict_tree, rebased_extras, replay};
30+use crate::rebase::{First, Replayed, agent_extras, conflict_tree, rebased_extras, replay};
3131 use crate::safe::{Found, Root, Stat, StatKind, open_file, read_link};
3232 use crate::scan;
3333 use crate::state::{Checkout, Lock, Rebase, RecordedConflict, State};
@@ -73,6 +73,10 @@
7373 pub author: Option<Identity>,
7474 /// Who records the changeset.
7575 pub committer: Identity,
76+ /// The label of the agent making it, recorded as its
77+ /// [`AGENT`](braid_engine::AGENT) field. While a rebase is in progress,
78+ /// the rebased changeset's own agent stays, if it names one.
79+ pub agent: String,
7680 /// Commit even if conflict markers remain or conflicts are not marked
7781 /// resolved.
7882 pub force: bool,
@@ -623,11 +627,12 @@
623627 (None, Some(original)) => original.author.clone(),
624628 (None, None) => committer.clone(),
625629 };
626- let extras = state
627- .rebase
628- .as_ref()
629- .map(|rebase| rebased_extras(rebase.change))
630- .unwrap_or_default();
630+ let extras = match (&state.rebase, &original) {
631+ (Some(rebase), Some(original)) => {
632+ rebased_extras(&original.extras, rebase.change, &request.agent)
633+ }
634+ _ => agent_extras(&request.agent),
635+ };
631636 let parents: Vec<ObjectId> = state.base.into_iter().collect();
632637 let count = changes.len();
633638 let id = braid_engine::commit(
modified crates/wc/tests/workspaces.rs +5 −0
@@ -19,6 +19,7 @@
1919 paths: Vec::new(),
2020 author: None,
2121 committer: ada(),
22+ agent: "tester".to_owned(),
2223 force: false,
2324 })
2425 .unwrap()
@@ -153,6 +154,7 @@
153154 paths: vec![b"x".to_vec()],
154155 author: None,
155156 committer: ada(),
157+ agent: "tester".to_owned(),
156158 force: false,
157159 });
158160 assert!(
@@ -167,6 +169,7 @@
167169 paths: Vec::new(),
168170 author: None,
169171 committer: ada(),
172+ agent: "tester".to_owned(),
170173 force: false,
171174 })
172175 .unwrap();
@@ -263,6 +266,7 @@
263266 paths: Vec::new(),
264267 author: None,
265268 committer: ada(),
269+ agent: "tester".to_owned(),
266270 force: false,
267271 }),
268272 Err(Error::NothingToCommit)
@@ -274,6 +278,7 @@
274278 paths: Vec::new(),
275279 author: None,
276280 committer: ada(),
281+ agent: "tester".to_owned(),
277282 force: false,
278283 }),
279284 Err(Error::NoMessage)