Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion docs/agents.md
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ Where two beads name one pane, `bdi` awards the key's claim to neither. The
refusal is reported as a conflict, and nothing errors. What the pane says about
itself then stands alone: a `display_agent` naming exactly one of those beads
keeps that bead's agent, and one naming nothing drops your pane among the
unattributed panes below the trees, reading exactly like an agent that never
unclaimed panes below the trees, reading exactly like an agent that never
registered. Working on two beads at once, name your pane on one of them.

## Clear the key when you stop
Expand Down
4 changes: 2 additions & 2 deletions docs/configuration.md
Original file line number Diff line number Diff line change
Expand Up @@ -450,9 +450,9 @@ says its anomalies:

| what the badge met | what the row says |
|---|---|
| a value that left part of the `link` unfilled | `no link for delivery_pr: this value leaves part of it unfilled` |
| a value that left part of the `link` unfilled | `no link for delivery_pr: its value does not fit the link template` |
| a link holding a control character | `no link for delivery_pr: it holds a control character` |
| a value that left part of the `short` unfilled | `no short form for delivery_pr: this value leaves part of it unfilled` |
| a value that left part of the `short` unfilled | `no short form for delivery_pr: its value does not fit the template` |
| a `short` holding a control character, on a badge with a `link` | `no short form for delivery_pr: it holds a control character` |

The first `short` row holds whether or not the badge has a `link`. The second is
Expand Down
6 changes: 3 additions & 3 deletions docs/design.md
Original file line number Diff line number Diff line change
Expand Up @@ -1916,9 +1916,9 @@ reader's choice rather than a producer failing where nobody can see.
**A socket that cannot be opened is said twice, deliberately, and the two are
not copies.** No path to put it at, or another `bdi` already listening on the
one it has, and this one polls everything exactly as it did before. The notice
at the foot says what it costs the reader — *nothing can tell bdi a project
changed · every project is polled instead*, or *another bdi held the inbound
channel* where that is the cause, since that one names a process the reader can
at the foot says what it costs the reader — *bdi cannot hear about changes ·
every project is polled instead*, or *another bdi is already listening for
changes* where that is the cause, since that one names a process the reader can
close. The `stderr` line names the path and the `io::Error` under it, and the
remedy: a process to close where there is one, and where there is not, the flag
and the key that name a path — a reader with no runtime directory has none to
Expand Down
12 changes: 6 additions & 6 deletions src/collect/changes.rs
Original file line number Diff line number Diff line change
Expand Up @@ -266,7 +266,7 @@ impl fmt::Display for Refused {
fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
write!(
f,
"nothing can tell bdi a project changed, so every project is polled: "
"bdi cannot hear about changes, so every project is polled: "
)?;
match self {
// The refusal a machine can be in for ever, so the one whose
Expand All @@ -280,7 +280,7 @@ impl fmt::Display for Refused {
Refused::NoRuntimeDirectory => {
write!(
f,
"this session has no {RUNTIME_DIRECTORY} to put the socket in — name a path with --socket, or with socket under [changes] in the config, and bdi listens there"
"this session has no {RUNTIME_DIRECTORY} to put the socket in; choose a path with --socket, or with socket under [changes] in the config"
)
}
// The one refusal a reader answers by closing something, so the
Expand All @@ -306,7 +306,7 @@ impl fmt::Display for Refused {
Refused::AlreadyListening(at) => {
write!(
f,
"another bdi is listening on {}; ss -lxp or lsof -U names which — close it and restart bdi to get the channel",
"another bdi is listening on {}; find it with ss -lxp or lsof -U, close it, then restart bdi",
at.display()
)
}
Expand All @@ -318,7 +318,7 @@ impl fmt::Display for Refused {
Refused::NotASocket(at) => {
write!(
f,
"{} is not a socket and bdi will not take it — name another path with --socket, or with socket under [changes] in the config",
"{} is not a socket, so bdi will not use it; choose another path with --socket, or with socket under [changes] in the config",
at.display()
)
}
Expand All @@ -330,7 +330,7 @@ impl fmt::Display for Refused {
Refused::NameOthersMayTake(directory) => {
write!(
f,
"another user may take a name in {} — name a socket path with no such directory above it, with --socket or with socket under [changes] in the config",
"other users can create files in {}, so bdi will not put its socket there; choose a path outside it with --socket, or with socket under [changes] in the config",
directory.display()
)
}
Expand Down Expand Up @@ -1416,7 +1416,7 @@ mod tests {

assert!(said.contains("another bdi"), "{said}");
assert!(said.contains("/run/user/1000/x.sock"), "{said}");
assert!(said.contains("ss -lxp or lsof -U names which"), "{said}");
assert!(said.contains("find it with ss -lxp or lsof -U"), "{said}");
}

/// The remedy is two steps and the second one is the one a reader would
Expand Down
2 changes: 1 addition & 1 deletion src/collect/discovery.rs
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ pub fn from_the_current_directory(
) {
return Err(failure.into());
}
anyhow::bail!("{} is not in anything beads tracks", cwd.display());
anyhow::bail!("{} is not inside a beads project", cwd.display());
}
};

Expand Down
40 changes: 17 additions & 23 deletions src/config.rs
Original file line number Diff line number Diff line change
Expand Up @@ -764,8 +764,8 @@ impl Config {
.is_some()
{
anyhow::bail!(
"[roots] metadata_keys is gone: every unfinished bead is a root, so a key \
could name nothing bd's statuses do not; remove it"
"[roots] metadata_keys is no longer used, because every unfinished bead is \
now a root; remove it"
);
}
let cfg: Config = table.try_into()?;
Expand All @@ -775,8 +775,7 @@ impl Config {
let repeated = cfg.names_borne_by_more_than_one_project();
if !repeated.is_empty() {
anyhow::bail!(
"a project's name is how bdi tells its beads from another tracker's, so \
two projects cannot answer to one; repeated: {}",
"each project needs a name of its own, and these are used more than once: {}",
repeated.join(", ")
);
}
Expand All @@ -786,27 +785,23 @@ impl Config {
.is_some_and(Command::names_no_program)
}) {
anyhow::bail!(
"{} names an environment_command with no program in it; bdi appends its own \
probe to what you write, so an empty one would read the project in bdi's \
environment while saying it was read in its own",
"{}'s environment_command is empty; name a program, or remove the setting",
project.name
);
}
for (named, ids) in &cfg.roots.explicit {
if !cfg.is_configured(named) {
anyhow::bail!(
"[roots.explicit] gives {} to {named}, which is no project of this \
config; bdi is reading {}",
"[roots.explicit] lists {} under {named}, but there is no project called \
{named}; the configured projects are {}",
ids.join(", "),
names_of(&cfg.projects).join(", ")
);
}
}
let mut named: HashSet<&Cell> = HashSet::new();
if let Some(twice) = cfg.row.cells().find(|cell| !named.insert(cell)) {
anyhow::bail!(
"[row] names {twice} twice; a cell is drawn in one place, so name it in one list"
);
anyhow::bail!("[row] names {twice} twice; name it in only one list");
}
let configured: BTreeSet<String> = cfg
.projects
Expand All @@ -820,8 +815,8 @@ impl Config {
.find(|cell| matches!(cell, Cell::Badge(key) if !configured.contains(key)))
{
anyhow::bail!(
"[row] names {unconfigured}, which no [[badges]] or [[projects.badges]] entry \
configures, so it would draw nothing on any row"
"[row] names {unconfigured}, but no [[badges]] or [[projects.badges]] entry \
defines it"
);
}
Ok(cfg)
Expand Down Expand Up @@ -868,8 +863,8 @@ impl Config {
.collect();
if !unknown.is_empty() {
anyhow::bail!(
"--project names {}, which is no project of this config; bdi is \
configured for {}",
"--project names {}, which is not a configured project; the configured \
projects are {}",
unknown.join(", "),
names_of(&self.projects).join(", ")
);
Expand Down Expand Up @@ -938,8 +933,8 @@ impl Config {
return match reading.as_slice() {
[only] => Ok((only.name.clone(), named.to_string())),
several => anyhow::bail!(
"{named} names no project, and bdi is reading {}; write it as \
<project>:{named}",
"{named} does not say which project it is in, and bdi is reading {}; \
write it as <project>:{named}",
several
.iter()
.map(|p| p.name.as_str())
Expand All @@ -953,17 +948,16 @@ impl Config {
}
if !self.is_configured(project) {
anyhow::bail!(
"{named} gives {id} to {project}, which is not among the projects \
bdi is configured for: {}",
"{named}: {project} is not a configured project; the configured \
projects are {}",
names_of(&self.projects).join(", ")
);
}
if !self.reads(project) {
match &mut self.scope {
Scope::Directory { widened, .. } => widened.push(project.to_string()),
Scope::Asked(_) | Scope::Everything => anyhow::bail!(
"{named} gives {id} to {project}, which is not among the projects \
bdi is reading: {}",
"{named}: bdi is not reading {project}; it is reading {}",
self.read()
.map(|p| p.name.as_str())
.collect::<Vec<_>>()
Expand Down Expand Up @@ -2277,7 +2271,7 @@ metadata_keys = ["working_topic"]
)
.unwrap_err();
assert!(err.to_string().contains("metadata_keys"), "got: {err}");
assert!(err.to_string().contains("gone"), "got: {err}");
assert!(err.to_string().contains("no longer used"), "got: {err}");
}

#[test]
Expand Down
29 changes: 14 additions & 15 deletions src/tui/screen.rs
Original file line number Diff line number Diff line change
Expand Up @@ -4124,7 +4124,7 @@ mod tests {

assert_eq!(cursor(&shown), Some(&bead("grove", "grv-1.2")));
assert!(
foot_of(&mut shown, 80, 24).contains("grove · grv-1.2 — 2 of 6 matching"),
foot_of(&mut shown, 80, 24).contains("grove · grv-1.2 · match 2 of 6"),
"{:?}",
foot_of(&mut shown, 80, 24)
);
Expand Down Expand Up @@ -4161,7 +4161,7 @@ mod tests {
assert_eq!(forest_band(&mut shown, 60, 24), was);
at_prompt(&mut shown, Typing::Sought);
assert!(
foot_of(&mut shown, 100, 24).contains("nothing matching \"grv-1.3x\""),
foot_of(&mut shown, 100, 24).contains("nothing matches \"grv-1.3x\""),
"{:?}",
foot_of(&mut shown, 100, 24)
);
Expand Down Expand Up @@ -4282,7 +4282,7 @@ mod tests {

assert_eq!(cursor(&shown), Some(&bead("grove", "grv-1.3")));
assert!(
foot_of(&mut shown, 80, 24).contains("grove · grv-1.3 — the only match"),
foot_of(&mut shown, 80, 24).contains("grove · grv-1.3 · the only match"),
"{:?}",
foot_of(&mut shown, 80, 24)
);
Expand All @@ -4298,7 +4298,7 @@ mod tests {
search_for(&mut shown, "grv-1.");

assert!(
foot_of(&mut shown, 80, 24).contains("grove · grv-1.1 — 1 of 6 matching"),
foot_of(&mut shown, 80, 24).contains("grove · grv-1.1 · match 1 of 6"),
"{:?}",
foot_of(&mut shown, 80, 24)
);
Expand All @@ -4314,7 +4314,7 @@ mod tests {

assert_eq!(cursor(&shown), Some(&bead("grove", "grv-1.2")));
assert!(
foot_of(&mut shown, 80, 24).contains("grove · grv-1.2 — 2 of 6 matching"),
foot_of(&mut shown, 80, 24).contains("grove · grv-1.2 · match 2 of 6"),
"{:?}",
foot_of(&mut shown, 80, 24)
);
Expand Down Expand Up @@ -4347,8 +4347,7 @@ mod tests {

assert_eq!(cursor(&shown).cloned(), was);
assert!(
foot_of(&mut shown, 80, 24)
.contains("nothing matching \"grv-404\" in any tracker read"),
foot_of(&mut shown, 80, 24).contains("nothing matches \"grv-404\""),
"{:?}",
foot_of(&mut shown, 80, 24)
);
Expand Down Expand Up @@ -4397,7 +4396,7 @@ mod tests {
fn the_readers_next_press_takes_a_searchs_answer_off_the_foot() {
let mut shown = shown(a_grove(6));
search_for(&mut shown, "grv-404");
assert!(foot_of(&mut shown, 80, 24).contains("nothing matching \"grv-404\""));
assert!(foot_of(&mut shown, 80, 24).contains("nothing matches \"grv-404\""));

assert!(shown.pressed());

Expand Down Expand Up @@ -4490,7 +4489,7 @@ mod tests {
);
let foot = foot_of(&mut shown, 100, 24);
assert!(foot.contains("F whole forest"), "{foot:?}");
assert!(foot.contains("the forest is focused"), "{foot:?}");
assert!(foot.contains("showing focused beads"), "{foot:?}");

press(&mut shown, KeyCode::Char('F'));

Expand Down Expand Up @@ -4533,7 +4532,7 @@ mod tests {
}

/// A grove on a machine whose herdr will not answer, which is a notice on
/// every frame and fifty-four of an eighty-column foot's columns.
/// every frame and forty-one of the foot's columns.
fn a_grove_with_no_herdr(beads: usize) -> Snapshot {
Snapshot {
agents: a_provider(ProviderState::NotAnswering),
Expand All @@ -4544,14 +4543,14 @@ mod tests {
/// The bead this was written for. The window holds four fifths of the
/// screen and its title no longer names the way out, so a notice that
/// took the whole row away left nothing on screen saying how to leave.
/// Eighty columns is a supported width, and a machine with no herdr
/// raises that notice on every frame rather than in a corner.
/// A machine with no herdr raises that notice on every frame rather than
/// in a corner, and at this width it leaves no room for every key.
#[test]
fn the_windows_row_keeps_the_way_out_beside_a_notice() {
let mut shown = shown(a_grove_with_no_herdr(6));
assert!(shown.apply(Action::ShowBead));

let foot = bead_view(&mut shown, 80, 24)
let foot = bead_view(&mut shown, 67, 24)
.pop()
.expect("a screen with rows on it");

Expand All @@ -4567,11 +4566,11 @@ mod tests {
fn the_forests_row_still_goes_whole_beside_a_notice() {
let mut shown = shown(a_grove_with_no_herdr(6));

let foot = foot_of(&mut shown, 80, 24);
let foot = foot_of(&mut shown, 67, 24);

assert_eq!(
foot.trim_end(),
"\u{26a0} no herdr session \u{b7} which agents are alive is unknown"
"\u{26a0} no herdr session \u{b7} agents are not shown"
);
}

Expand Down
4 changes: 2 additions & 2 deletions src/view/draw/bead.rs
Original file line number Diff line number Diff line change
Expand Up @@ -493,7 +493,7 @@ mod tests {
)
.rows();

says(&drawn[0], "2 beads beneath");
says(&drawn[0], "2 beads to check");
}

/// A count of nought is left out rather than drawn, exactly as the
Expand Down Expand Up @@ -548,7 +548,7 @@ mod tests {
"{painted:?}"
);
assert_eq!(
colour_of("2 beads beneath"),
colour_of("2 beads to check"),
palette::ATTENTION.fg,
"{painted:?}"
);
Expand Down
Loading