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

Branches at the root commit lead to confusing errors; jj abandon can create such a branch #1529

Closed
ilyagr opened this issue Apr 17, 2023 · 3 comments
Assignees
Labels
🐛bug Something isn't working polish🪒🐃 Make existing features more convenient and more consistent

Comments

@ilyagr
Copy link
Contributor

ilyagr commented Apr 17, 2023

To do it, simply add a branch to a child of the root commit and then jj abandon the branch.

Branches at the root commit cause confusing errors on git export and git push.

Since #1479, jj branch is not allowed to create such branches. If we decide to resolve this by supporting such branches better, that restriction should be lifted.

@ilyagr ilyagr added 🐛bug Something isn't working polish🪒🐃 Make existing features more convenient and more consistent labels Apr 17, 2023
@martinvonz
Copy link
Member

Can we make the error less confusing? I don't see anything inherently bad about having a branch on the root commit.

@ilyagr
Copy link
Contributor Author

ilyagr commented Apr 17, 2023

That would work too. It'd be a bit of work, since we'd have to figure out how to export such branches (we could ignore them or we could try to put the git repo in the state git checkout --orphan puts it in) and figure out when the user needs to be informed that their branch is not representable in git (for example, it cannot be pushed).

Update: I rewrote the bug description to leave more possibility for such a resolution.

@ilyagr ilyagr changed the title jj abandon can put a branch on the root commit Branches at the root commit lead to confusing errors; jj abandon can create such a branch Apr 17, 2023
@martinvonz
Copy link
Member

We already skip conflicted branches on exported. Maybe we can treat these branches similarly (but ideally producing a different warning message for the user).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
🐛bug Something isn't working polish🪒🐃 Make existing features more convenient and more consistent
Projects
None yet
Development

No branches or pull requests

2 participants