Skip to content

FR: Stop branches from sliding back on jj abandon, delete them instead #3505

Open
@matts1

Description

Is your feature request related to a problem? Please describe.
Branches currently are designed to slide back when a change is deleted. @arxanas wrote:

I don't think branches should slide backwards to begin with. git-branchless deletes the branch, and I'm actually surprised to hear that Mercurial slides it backwards. Sapling also deletes the branch (regardless of whether you address the commit via hash or branch):

I have yet to see a use case which benefits from the sliding mechanism, but see many use cases that break because of it.

Consider:

◉  pvlpykyo msta 5 days ago foo 13bbdfc2
│  My local commit
◉  vzokzlpu msta 5 days ago main a2016214
│  immutable head here

If I were to write jj abandon foo, then the branch foo would instead move to main. The same thing would happen if I were to submit foo, then later run jj rebase --skip-empty.

This is a problem for multiple use cases. The first is when you want to associate each commit with a change (eg. make one commit branch be crrev.com/c/123)

Describe alternatives you've considered
I made #3482 earlier. However, this would be my preferred solution.

Additional context
Add any other context or screenshots about the feature request here.

Metadata

Assignees

Labels

enhancementNew feature or request

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions