From d138f6b03ece8b1c178df55c196de6343580f250 Mon Sep 17 00:00:00 2001 From: "@permadeath.com" Date: Mon, 24 Aug 2026 23:16:28 -0400 Subject: [PATCH] feat(stack): say when a branch is behind, or marked and being filed as one A reconcile against a moved target writes rounds whose patches are against the old base, so it now names `atgc stack sync`, which fixes it in one command. `pr create` on a branch with marks says the marks are there rather than quietly filing them as a single pull request. --- src/cmd/pr/write.rs | 17 +++++++++++++++ src/cmd/stack/write.rs | 20 +++++++++++++++--- tests/stack_flows.rs | 48 ++++++++++++++++++++++++++++++++++++++++++ 3 files changed, 82 insertions(+), 3 deletions(-) diff --git a/src/cmd/pr/write.rs b/src/cmd/pr/write.rs index 0fc01fe..78752d0 100644 --- a/src/cmd/pr/write.rs +++ b/src/cmd/pr/write.rs @@ -260,6 +260,23 @@ pub(crate) async fn create(args: CreateArgs) -> Result<()> { })?; } + // Marks are the branch saying it means to be several pull requests, and + // this command files it as one. Not a refusal — a stack is not always + // what somebody wants, and marks left over from a stack that has landed + // are ordinary — but the one moment where saying so costs nothing and + // silence costs a pull request that has to be closed by hand. + let marked = crate::cmd::stack::marks::recorded(&branch); + if !marked.is_empty() { + crate::term::say::note!( + Git, + "{branch} has {} mark(s) on it ({}), which `atgc stack create` would file as \ + separate pull requests\n\ + this files the whole branch as one", + marked.len(), + marked.join(", "), + ); + } + let commits = gitpatch::commit_count(&base)?; if commits == 0 { // `Usage`, for the reason exit.rs gives the whole class: the branch diff --git a/src/cmd/stack/write.rs b/src/cmd/stack/write.rs index 7147a32..1a6e8fd 100644 --- a/src/cmd/stack/write.rs +++ b/src/cmd/stack/write.rs @@ -639,9 +639,9 @@ async fn create_inner(args: CreateArgs, rewritten: &mut Option