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

fix: remove last usage of vbranches.commits #5704

Merged
merged 11 commits into from
Nov 28, 2024
Merged

Conversation

ndom91
Copy link
Contributor

@ndom91 ndom91 commented Nov 28, 2024

☕️ Reasoning

  • Remove last usage of vbranches.commits

🧢 Changes

  • Migrated to `branch.series.(patches|upstreamPatches)
  • Regarding localCommits/localAndRemoteCommits, etc. contexts - BranchLane used to set commitStore/localCommits/localAndRemoteCommits contexts for the entire lane and all its children
    • Now, however, that cna be different for each series. So each series gets it set in CurrentSeries
    • The other place where this was used was in the uncommited files BranchFiles list. This one needs a list of all patches / upstreamPatches in the lane in order to build the "I'm locked to ..." tooltip on uncommited files potentially.
  • Migrated a few files to runes syntax

Copy link

vercel bot commented Nov 28, 2024

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 Nov 28, 2024 6:11pm
1 Skipped Deployment
Name Status Preview Comments Updated (UTC)
gitbutler-web ⬜️ Skipped (Inspect) Nov 28, 2024 6:11pm

@vercel vercel bot temporarily deployed to Preview – gitbutler-web November 28, 2024 10:36 Inactive
@vercel vercel bot temporarily deployed to Preview – gitbutler-web November 28, 2024 10:50 Inactive
@vercel vercel bot temporarily deployed to Preview – gitbutler-web November 28, 2024 14:20 Inactive
@vercel vercel bot temporarily deployed to Preview – gitbutler-web November 28, 2024 14:38 Inactive
@ndom91 ndom91 force-pushed the remove-vbranch-commits-usage branch from b922666 to b4bcf22 Compare November 28, 2024 14:38
@vercel vercel bot temporarily deployed to Preview – gitbutler-web November 28, 2024 14:38 Inactive
@vercel vercel bot temporarily deployed to Preview – gitbutler-web November 28, 2024 14:52 Inactive
@vercel vercel bot temporarily deployed to Preview – gitbutler-web November 28, 2024 15:43 Inactive
@ndom91 ndom91 force-pushed the remove-vbranch-commits-usage branch from eabf796 to 3bd8c47 Compare November 28, 2024 15:45
@vercel vercel bot temporarily deployed to Preview – gitbutler-web November 28, 2024 15:55 Inactive
@ndom91 ndom91 force-pushed the remove-vbranch-commits-usage branch from e757819 to 9911832 Compare November 28, 2024 15:55
@vercel vercel bot temporarily deployed to Preview – gitbutler-web November 28, 2024 15:55 Inactive
@ndom91 ndom91 marked this pull request as draft November 28, 2024 16:02
@ndom91 ndom91 force-pushed the remove-vbranch-commits-usage branch from 9911832 to c97c197 Compare November 28, 2024 16:07
@ndom91 ndom91 force-pushed the remove-vbranch-commits-usage branch from c97c197 to edd000f Compare November 28, 2024 16:17

get ancestorMostConflictedCommit(): DetailedCommit | undefined {
const commits = [...this.upstreamPatches, ...this.patches].sort((a, b) => {
if (a.createdAt > b.createdAt) {
Copy link
Contributor

Choose a reason for hiding this comment

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

I wonder how this works with commits that were created in the middle of the series.

I believe this is only used to check if this is the 'first' conflicted from the bottom, so in order to avoid having to sort them, I think we can assume that there are no upstreamPatches that are also conflicted.

Maybe we can update that horrible name I gave this getter and make it even worse: ancestorMostConflictedLocalCommit

Copy link
Contributor Author

@ndom91 ndom91 Nov 28, 2024

Choose a reason for hiding this comment

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

Haha okay yeah I cleaned this up a bit. In terms of naming, I thought about it for a minute, but seeing as we want to avoid "top"/"bottom" I coudln't think of anything better 😂

Copy link
Contributor

Choose a reason for hiding this comment

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

Haha fair enough

Copy link
Contributor

@estib-vega estib-vega left a comment

Choose a reason for hiding this comment

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

Just that comment about the sorting of commits

@vercel vercel bot temporarily deployed to Preview – gitbutler-web November 28, 2024 18:10 Inactive
@ndom91 ndom91 enabled auto-merge (rebase) November 28, 2024 18:11
@ndom91 ndom91 merged commit 5fb69cd into master Nov 28, 2024
16 checks passed
@ndom91 ndom91 deleted the remove-vbranch-commits-usage branch November 28, 2024 18:11
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants