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

What does JJ hash here, when I can modify the whole commit, but the change id stays constant?


The parent comment is wrong.

Generally, when a new change ID is needed, jj generates a random number. The individual commits under each change still use hashed SHAs.

> when I can modify the whole commit

You can't actually modify any commits. A mutable change can be thought of as a subset of immutable git commits with a pointer to the most recent commit.

When you alter a file and jj snapshots, it adds immutable commits to the DAG end, and updates the pointer.

---

There's some exceptions, like when importing from git, it will generate new change IDs based on a transform of the git SHAs.

---

Side note: as much as I like jj, I admit the change/commit terminology is confusing as hell.




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

Search: