Comment by ndr
2 months ago
The main issue I kept having when trying to do this with just git is then managing all the branch names to be attached to the right moved commits, so that my stack could be reviewable on github's open PRs.
Does jj help with that at all?
I've experimented a bit with git-town.com (OSS) and now everyone at $DAYJOB uses graphite.com (SaaS) which does that part very well.
It’s one of the core features that rebases, including branch names (bookmarks in jj) work ‘correctly’. You can rebase whole dags, including merges, with multiple named heads with just one jj rebase -b.
To expand: In jj, bookmarks point to "changes," not commits. Rebases, history manipulations, etc. preserve change ID, so this "just works."
note that bookmarks don't float, unlike git branches, so if your pattern is to produce a lot of commits, you'll want something to keep your jj bookmarks pointing to the top of your pile of commits.
this is less of a problem if you're more into the 1 change == 1 commit workflow.
There's a very common alias `jj tug` for this case:
It moves the nearest bookmark to the commit before the current one (which should be your working commit).
4 replies →
There's an experimental-advance-branches feature which helps with that!
`--update-refs` flag helps a lot in vanilla git. That and `--autosquash` should probably be default flags to `git rebase`. I also don't entirely trust rebase without `-i` (`--interactive`), personally. I hear there is talk about shaking up the out-of-the-box default flags in git 3, and I think rebase should especially get new defaults.
I also use these flag when I have the need to, but I very much don't want them to become the default.