-
Notifications
You must be signed in to change notification settings - Fork 545
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
list virtual branches performance #4771
Changes from all commits
dd724f3
30cc6a4
bd2c19d
7e0878a
fc63929
7ce1439
13deabd
751e091
a0e2361
79798c7
a7b01bd
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -12,16 +12,22 @@ use gitbutler_commit::commit_ext::CommitExt; | |
use gitbutler_error::error::Marker; | ||
use gitbutler_project::access::WorktreeWritePermission; | ||
use gitbutler_repo::{LogUntil, RepoActionsExt, RepositoryExt}; | ||
use tracing::instrument; | ||
|
||
use crate::{branch_manager::BranchManagerExt, conflicts, VirtualBranchesExt}; | ||
|
||
const WORKSPACE_HEAD: &str = "Workspace Head"; | ||
const GITBUTLER_INTEGRATION_COMMIT_TITLE: &str = "GitButler Integration Commit"; | ||
|
||
// Creates and returns a merge commit of all active branch heads. | ||
// | ||
// This is the base against which we diff the working directory to understand | ||
// what files have been modified. | ||
/// Creates and returns a merge commit of all active branch heads. | ||
/// | ||
/// This is the base against which we diff the working directory to understand | ||
/// what files have been modified. | ||
/// | ||
/// This should be used to update the `gitbutler/workspace` ref with, which is usually | ||
/// done from [`update_gitbutler_integration()`], after any of its input changes. | ||
/// This is namely the conflicting state, or any head of the virtual branches. | ||
Comment on lines
+27
to
+29
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I added the list of dependencies that I see are used here in the hopes that is raises awareness in functions that alter these inputs. |
||
#[instrument(level = tracing::Level::DEBUG, skip(ctx))] | ||
pub(crate) fn get_workspace_head(ctx: &CommandContext) -> Result<git2::Oid> { | ||
let vb_state = ctx.project().virtual_branches(); | ||
let target = vb_state | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think this is the only place where we drive
gitbutler_diff::workdir()
with the (possibly stale)HEAD
commit, and I do wonder if that's always correct.However, I also believe that the
HEAD
integration commit should not be able to go stale in the first place, and would rather want to see that fixed.It's something that isn't attempted here just yet though.