Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

I'm not sure what you mean by "natively as an edit", but jj really doesn't care if you alter some commit 10 back from the branch tip. Everything is automatically rebased as needed, and unless you introduce conflicts, it's seamless.

The typical workflow would be:

1. `jj log ...`

Locate the change ID of whatever change needs altering.

2. `jj new $SOME_CHANGE_ID`

This creates a new, empty change whose parent is the change you want to edit

3. Make your changes, pass the tests, etc.

4. `jj squash`

All your changes get squashed into $SOME_CHANGE_ID

5. jj then automatically rebases everything downstream of $SOME_CHANGE_ID for you.

All jj change IDs remain the same (though the underlying git commit SHAs are now different.)

If there are any new conflicts introduced in the downstream changes, they'll get flagged. You'd then typically run `jj new $FIRST_CONFLICT_ID`, and repeat the whole process.

---

It's also possible to run `jj edit $SOME_CHANGE_ID`, to work directly on that change, but because of the automatic rebasing, it's preferable to work on a child commit and only squash when ready. (In case you need to do other things with downstream changes before you've finished making your updates.)

---

Does that answer your question?



Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: