Skip to content

Conversation

estib-vega
Copy link
Contributor

Modified the logic in stacks.rs to filter upstream commits more accurately by comparing tree changes between the last local commit and the upstream commit being looked at.

Added import for tree_changes function from but_core::diff module. Adjusted upstream commit processing to skip upstream commits that do not introduce new changes relative to the last local commit, preventing redundant upstream commits from being shown after operations such as squash or rebase.

Modified the logic in stacks.rs to filter upstream commits more accurately by comparing tree changes between the last local commit and the upstream commit being looked at. 

Added import for tree_changes function from but_core::diff module. Adjusted upstream commit processing to skip upstream commits that do not introduce new changes relative to the last local commit, preventing redundant upstream commits from being shown after operations such as squash or rebase.
Copy link

vercel bot commented Aug 3, 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 Aug 3, 2025 1:24pm
gitbutler-web ✅ Ready (Inspect) Visit Preview 💬 Add feedback Aug 3, 2025 1:24pm

@github-actions github-actions bot added the rust Pull requests that update Rust code label Aug 3, 2025
@estib-vega estib-vega enabled auto-merge August 3, 2025 13:23
@estib-vega estib-vega merged commit 8d2c89b into master Aug 3, 2025
21 checks passed
@estib-vega estib-vega deleted the enhance-upstream-commit-filter branch August 3, 2025 13:29
@krlvi
Copy link
Member

krlvi commented Aug 4, 2025

Nice one! I wonder - should we look into porting this into the graph implementation?

@Byron
Copy link
Collaborator

Byron commented Aug 4, 2025

I think it would need a test so it can be ported to the RefInfo test-suite.
Otherwise it's ephemeral at best.

Chances are that this is already working there, but also, that it works differently.

@estib-vega
Copy link
Contributor Author

I think it would need a test so it can be ported to the RefInfo test-suite. Otherwise it's ephemeral at best.

Chances are that this is already working there, but also, that it works differently.

Maybe I can add a test in a bit. The WS3 version would look like this: #9676

Before merging this, maybe we should discuss how we want to display this information in the brave new world of WS3.

The motivation for this change is to not show commits that are irrelevant, but if we're in a single branch world, maybe we still want to see all commits, event the ones considered 'irrelevant'.

That's why I had only added it to the non-WS3 version of the details.

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

Successfully merging this pull request may close these issues.

3 participants