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

Cherry Pick #4951

Open
LovesAsuna opened this issue Sep 19, 2024 · 23 comments
Open

Cherry Pick #4951

LovesAsuna opened this issue Sep 19, 2024 · 23 comments
Assignees
Labels
bug Something isn't working 🎉reproduced🎉 The issue could be reproduced by following the instructions UX something related to the user's experience

Comments

@LovesAsuna
Copy link

Version

0.12.25

Operating System

Mac OS X

Distribution Method

dmg (Apple Silicon)

Describe the issue

I want to cherry pick a commit from a virtual branch to another. Because my changes are based on part of one of the virtual branches. This virtual branch has not yet been integrated into the target branch, so I'd like to do a cherry pick first (not a full commit, but maybe just a part of a commit or a file).

How to reproduce

No response

Expected behavior

No response

Relevant log output

No response

@LovesAsuna LovesAsuna added the bug Something isn't working label Sep 19, 2024
@Byron Byron added UX something related to the user's experience feedback requested Feedback was requested to help resolve the issue labels Sep 20, 2024
@Byron
Copy link
Collaborator

Byron commented Sep 20, 2024

It should be possible to drag entire commits from one lane to another, or hunks from one lane to another as well. Is this something you tried, or is there an issue I am missing?

If so, maybe upload a video so it's clear what is attempted.
Thanks in advance for your help.

@LovesAsuna
Copy link
Author

image

@Byron Byron added 🎉reproduced🎉 The issue could be reproduced by following the instructions and removed feedback requested Feedback was requested to help resolve the issue labels Sep 21, 2024
@Byron
Copy link
Collaborator

Byron commented Sep 21, 2024

Invalid args: branchfor commandcreate_virtual_branch: ownership ranges cannot be empty is the error message displayed, when trying to move a single file out of a commit into the New branch (empty) lane.

It's easily reproducible now, thank you!

On stderr, one will see this right after (but no 'typical' error):

[2024-09-21][07:22:32][ERROR][Rt@tauri://localhost/_app/immutable/entry/app.CN3g50-3.js:2:3027] 9d9abf00c0a3451684adb9a104d21eb4: lifecycle_outside_component

xn@tauri://localhost/_app/immutable/chunks/index.BRFB7DrO.js:1:7216
g@tauri://localhost/_app/immutable/chunks/index-client.DHPHoFon.js:1:521
@tauri://localhost/_app/immutable/chunks/CommitCard.Dvwviucn.js:287:6357




2024-09-21 09:22:40.042 GitButler[98579:4957218] _TIPropertyValueIsValid called with 16 on nil context!
2024-09-21 09:22:40.042 GitButler[98579:4957218] imkxpc_getApplicationProperty:reply: called with incorrect property value 16, bailing.
2024-09-21 09:22:40.042 GitButler[98579:4957218] Text input context does not respond to _valueForTIProperty:
[2024-09-21][07:22:41][ERROR][Rt@tauri://localhost/_app/immutable/entry/app.CN3g50-3.js:2:3027] 1f76d1f4220444eb8190005661803647: lifecycle_outside_component

xn@tauri://localhost/_app/immutable/chunks/index.BRFB7DrO.js:1:7216
g@tauri://localhost/_app/immutable/chunks/index-client.DHPHoFon.js:1:521
@tauri://localhost/_app/immutable/chunks/CommitCard.Dvwviucn.js:287:6357

CC @Caleb-T-Owens, who told me he loves fixing stuff :).

@LovesAsuna
Copy link
Author

LovesAsuna commented Sep 21, 2024

I may not be able to reproduce my problem with a simple demo, but I'll take a problem that I encountered in an actual project.

@Byron This may be another issue, in fact the main thing I'm wondering is why I can't drag a file to a virtual branch that already existsimage

@LovesAsuna
Copy link
Author

For the above reasons, this resulted in me having to only create a new virtual branch, thus realizing the problem in the beginning

@Byron
Copy link
Collaborator

Byron commented Sep 22, 2024

@Byron This may be another issue, in fact the main thing I'm wondering is why I can't drag a file to a virtual branch that already exists

It's true that it's also not possible to add a file to an existing virtual branch when dragged from a commit. The UI indicates that a new branch can be created from it though, even though it doesn't currently claim that it can be dragged to an existing branch.

Since this is probably something with the drag-logic, let me CC @ndom91 as well.

@Caleb-T-Owens
Copy link
Contributor

Hi @Byron, thanks for tagging me!

We've noticed that our frontend isn't updating selected ownership state correctly.

(Easy repro is having two branches, one with for hunks in a file. Drag two of the hunks to the other lane. Then try drag the other hunks by dragging and dropping the entire file into the second branch).

I suspect that this is likely related.

@Caleb-T-Owens
Copy link
Contributor

Related issue: #4934

@LovesAsuna
Copy link
Author

Can this issue be fixed in the next release? It feels like it affects the experience quite a bit

@Caleb-T-Owens
Copy link
Contributor

Caleb-T-Owens commented Sep 23, 2024 via email

@Caleb-T-Owens Caleb-T-Owens self-assigned this Sep 24, 2024
@LovesAsuna
Copy link
Author

LovesAsuna commented Sep 25, 2024

I've seen the latest release mention that there is a fix, but it seems that neither issue has been addressed. @Caleb-T-Owens

@LovesAsuna
Copy link
Author

Is this still a concern? @Byron

@Byron
Copy link
Collaborator

Byron commented Oct 10, 2024

There have been a lot of changes and I am definitely not caught up :/, but would think that @Caleb-T-Owens has all the answers (especially since two weeks are a lot of time).

@estib-vega
Copy link
Contributor

@LovesAsuna Sorry for the long wait and back and forward

It seems like this is a FE issue. The UI shouldn't highlight the possibility of creating a new branch from a file that's already been committed.

I'll fix that

@LovesAsuna
Copy link
Author

LovesAsuna commented Oct 17, 2024

@LovesAsuna Sorry for the long wait and back and forward

It seems like this is a FE issue. The UI shouldn't highlight the possibility of creating a new branch from a file that's already been committed.

I'll fix that

Is "Invalid args branch for command create_virtual_branch: ownership ranges cannot be empty" a FE issue?
img

@estib-vega
Copy link
Contributor

@LovesAsuna Sorry for the long wait and back and forward

It seems like this is a FE issue. The UI shouldn't highlight the possibility of creating a new branch from a file that's already been committed.

I'll fix that

Is "Invalid args branch for command create_virtual_branch: ownership ranges cannot be empty" a FE issue?

img

@LovesAsuna it is in the sense that we should consider it an invalid operation. In order to move files, they should first be uncommitted and then drag-and-dropped.

The UI should stop you ortherwise

@LovesAsuna
Copy link
Author

@LovesAsuna it is in the sense that we should consider it an invalid operation. In order to move files, they should first be uncommitted and then drag-and-dropped.

The UI should stop you ortherwise

But how do I copy a commit to another virtual branch?

@estib-vega
Copy link
Contributor

But how do I copy a commit to another virtual branch?

You can drag the whole commit.

If the files in the commit are not "locked" to that branch, you should be able to drag it to another branch.

"Locked" here just means that it has changes that overlap with changes in other files in the origin branch

@LovesAsuna
Copy link
Author

LovesAsuna commented Oct 18, 2024

If the files in the commit are not "locked" to that branch, you should be able to drag it to another branch.

Dragging a commit directly changes the original virtual branch (even if it's not locked), not the cherry pick logic.
I'd like to add an optional copy commit logic.

@estib-vega
Copy link
Contributor

Dragging a commit directly changes the original virtual branch (even if it's not locked), not the cherry pick logic.

I'd like to add an optional copy commit logic.

Oh sorry, I had misunderstood.

That is not possible right now.
The virtual branches can't have duplicated changes.
I'm sorry about that.

I want to understand fully your workflow, though:
You have a "main" virtual branch.
You start a second one that now partially depends on the main one.

What you wanted to do is to be able to duplicate just enough changes and move them into the second one. Have it integrated and then at some point rebase the main branch on top of the latest version or what's on origin

Did I understand that correctly?

@LovesAsuna
Copy link
Author

Yes, this usually happens when there are two parallel pieces of work, but there is partially coupled code in them that leads to having to do this

@estib-vega
Copy link
Contributor

@LovesAsuna I see. I definitely have been in that situation. In some cases, stacking changes (see #3031) should enable you to get around this kind of issues.

I think your specific one wouldn't be fully supported still, because (if I understood correctly) you don't want to submit the main branch.

I'll bring it up with the team, though. It would be nice to have a way to achieve that in GitButler

@estib-vega
Copy link
Contributor

Thanks for reporting this and the subsequent clarifications!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working 🎉reproduced🎉 The issue could be reproduced by following the instructions UX something related to the user's experience
Projects
None yet
Development

No branches or pull requests

4 participants