-
Notifications
You must be signed in to change notification settings - Fork 23
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
feat(stack reorder): Delete branches removed from reorder plan #174
feat(stack reorder): Delete branches removed from reorder plan #174
Conversation
Current Aviator status
This PR was merged using Aviator. |
internal/reorder/deletebranch.go
Outdated
sb := strings.Builder{} | ||
sb.WriteString("delete-branch ") | ||
sb.WriteString(d.Name) | ||
if d.DeleteRef { |
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.
--delete-ref looks confusing? A branch is a ref.
Aside from that, do we want to have this command? It seems that simply deleting a line would be suffice to support deleting branches, and for I cannot think a good use case for this command.
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.
Yeah, I meant it to disambiguate deleting av's version of the branch and deleting the actual Git ref. It could also be --delete-git
but I'm not sure if that's actually any clearer. Maybe --delete-git-ref
would be the clearest of all.
But to your point, the only reason I implemented this as a command is convenience of implementation. It's nice to be able to just append the DeleteBranch
commands to the reorder plan if we detect that the branches have been removed from the plan (which is what we do here). We probably don't even need to document that this exists. We only even need the flag version because the command is serialized as a string whenever we write the continuation to file.
…anches-removed-from-plan
Example
Have a branch structure:
Run
av stack reorder
and delete thestack-branch 2023-06-08-two
line (effectively merging all commits into2023-06-08-one
):Choose
e
to edit the plan:(looks like unfortunately we lose the comment information, but this can be fixed in a future change)
Save the same plan, choose
o
to orphan the branches:Confirmed that
2023-06-08-two
still exists and hasn't had it's HEAD modified.Reset to the state above, but this time choose
d
to delete the branches: