Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Refactor the stack_branches command - separating commit listing #7347

Merged
merged 8 commits into from
Feb 24, 2025

Conversation

krlvi
Copy link
Member

@krlvi krlvi commented Feb 20, 2025

The changes are as follows:

  • The return of stack_branches no longer includes commits. Furthermore the archived state is available via a boolean field on WorkspaceBranch
  • There is now a command stack_branch_local_and_remote_commits which provides the commits for a stacked branch which are in the workspace (ordered newest to oldest, just as in the previous API)
  • There is also a command stack_branch_upstream_only_commits which provides the commits for a stacked branch which are at the upstream only (ordered newest to oldest, as before)

Semantically the two new APIs provide the exact same data that was previously returned as part of the stack_branches response.

Note: Both of the two new APIs are currenly only appropriate for accessing the commits of a stack branch in the workspace as they consider the "next head" in the stack as the end of the graph walk.

Copy link

vercel bot commented Feb 20, 2025

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Comments Updated (UTC)
gitbutler-components ✅ Ready (Inspect) Visit Preview 💬 Add feedback Feb 24, 2025 9:39am
gitbutler-web ✅ Ready (Inspect) Visit Preview 💬 Add feedback Feb 24, 2025 9:39am

@github-actions github-actions bot added rust Pull requests that update Rust code @gitbutler/desktop labels Feb 20, 2025
@krlvi krlvi changed the title add-stack-branch-commits-function Refactor the stack_branches command - separating commit listing Feb 20, 2025
@mtsgrd mtsgrd force-pushed the add-stack-branch-commits-function branch from 7a0efcf to 82fd01d Compare February 23, 2025 23:49
@mtsgrd mtsgrd force-pushed the add-stack-branch-commits-function branch from 82fd01d to d55e732 Compare February 24, 2025 00:16
@mtsgrd mtsgrd force-pushed the add-stack-branch-commits-function branch from d55e732 to ebda07f Compare February 24, 2025 08:25
@mtsgrd mtsgrd force-pushed the add-stack-branch-commits-function branch from ebda07f to 35fbec8 Compare February 24, 2025 08:35
@mtsgrd mtsgrd mentioned this pull request Feb 24, 2025
@mtsgrd mtsgrd merged commit b21183d into master Feb 24, 2025
23 checks passed
@mtsgrd mtsgrd deleted the add-stack-branch-commits-function branch February 24, 2025 09:43
let ctx = CommandContext::open(&project, AppSettings::default())?;
let local_and_remote =
stack_branch_local_and_remote_commits(id.to_string(), name.to_string(), &ctx);
debug_print(local_and_remote)?;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👀

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
@gitbutler/desktop rust Pull requests that update Rust code
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants