chadtmiller.com/knotless
git that lives in your Atmosphere account
1
10
A stacked pull merges right after the one below it
.changeset/stacked-pull-merges-at-once.mdnew+7−0
| @@ -0,0 +1,7 @@ | ||
--- | ||
default: patch | ||
--- | ||
| ||
# A stacked pull merges right after the one below it | ||
| ||
Merging, diffing or comparing a pull just after the pull below it merged and its branch went now reads it moved onto that pull's base, rather than failing with "has no branch" until the appview hears of the move. | ||
crates/knotless/src/forge.rs+8−12
| @@ -1276,10 +1276,14 @@ impl Target { | ||
} | ||
| ||
/// The entries, with `subject` as its author's repo has it now, not as | ||
/// the index last saw it: the index may not have it yet. | ||
/// the index last saw it, and the newest queue and state records of | ||
/// those who may write ([`Target::fresh_entries`]): the index may not | ||
/// have them yet. A pull a merge has just moved onto the base of the | ||
/// branch it deleted is read moved, not as on a branch that is gone. | ||
pub(crate) async fn around(&self, ctx: &Ctx, subject: &str) -> Result<(Vec<Entry>, Value)> { | ||
let (_, value) = self.subject(ctx, subject).await?; | ||
let mut entries = self.entries(ctx).await?; | ||
let (entries, fresh) = tokio::join!(self.entries(ctx), self.fresh_entries(ctx)); | ||
let mut entries = freshened(entries?, fresh); | ||
entries.retain(|e| e.uri != subject); | ||
entries.push(Entry { | ||
uri: subject.to_string(), | ||
| @@ -2295,16 +2299,8 @@ pub async fn set_state(ctx: &Ctx, target: &RepoUrl, subject: &str, state: &str) | ||
let me = session::me(ctx).await?; | ||
// A state written a moment ago counts before the appview hears of it, | ||
// the caller's own too: closing and at once reopening reads it closed. | ||
let (around, mut fresh, mine) = tokio::join!( | ||
t.around(ctx, subject), | ||
t.fresh_entries(ctx), | ||
t.newest(ctx, &me.did, nsid::STATE) | ||
); | ||
let mine = mine | ||
.into_iter() | ||
.filter(|e| !fresh.iter().any(|f| f.uri == e.uri)); | ||
fresh.extend(mine.collect::<Vec<_>>()); | ||
let entries = freshened(around?.0, fresh); | ||
let (around, mine) = tokio::join!(t.around(ctx, subject), t.newest(ctx, &me.did, nsid::STATE)); | ||
let entries = freshened(around?.0, mine); | ||
let item = thread(&t.record, t.remote.did(), &entries, subject)?.item; | ||
let verb = if state == "closed" { "close" } else { "reopen" }; | ||
// A hidden member of the organization is told why, as a merge tells | ||
docs/design/collaboration.md+6−1
| @@ -539,7 +539,12 @@ repository. Its web pages read the same way, through the server's session. | ||
An index lags behind the network, and someone who has just opened a pull | ||
wants to see it. So actions that start from one item read it straight from | ||
its author's account: commenting, merging, comparing, diffing, retargeting, | ||
editing and queueing. Showing an item does the same when the repository is | ||
editing and queueing. They read too the newest queue, state and auto-merge | ||
records of the owner, each collaborator and the runner landing the queue | ||
from their accounts, so a pull a merge has just moved onto its base's base | ||
(see [below](#keeping-pulls-attached-to-their-branches)) merges and diffs | ||
as moved. Showing an item reads it from its author's account when the | ||
repository is | ||
public, the appview lacks it, and its key is under a minute old, as long as | ||
it is not kept out: no label names it or its author, and the owner has | ||
neither hidden it nor blocked its author. An appview that cannot be asked | ||