ok/jj
1
0
Fork 0
forked from mirrors/jj
Commit graph

2 commits

Author SHA1 Message Date
Martin von Zweigbergk
cdc7a0c242 cli: when pushing all branches (the default), skip open commit
Open commits are work-in-progress and `jj git push --branch <name>`
therefore errors out if the branch points to an open commit. However,
we don't do the same check if you run `jj git push` to push all
branches. This patch introduces such a check. Rather than error out,
we skip such branches instead.

I didn't make it check for open commits in ancestors. It's quite
unusual (at least in my workflow) to have a closed commit on top of an
open one. We can revisit if users get surprised by it.
2022-03-12 10:46:58 -08:00
Martin von Zweigbergk
ea05f8f1e5 cli: prevent pushing commits with conflicts
It rarely makes sense to push commits with conflicts to a remote Git
repo (which is the only kind of remote we support so far), so let's
just error out instead of pushing a commit that others pulling from
the remote probably can't make sense of.

I've only added a simple test for the error case for now. `libgit2`
doesn't support pushing to a local repo, so it's harder to test the
success case. I suppose we'll have to have the regular `git` binary
running local servers in test eventually.

Closes #60.
2022-03-10 12:38:07 -08:00