| ▲ | tom_alexander 6 hours ago | |
< glances around at all the people telling me to never use `jj edit` > | ||
| ▲ | dwattttt 3 hours ago | parent | next [-] | |
That goes in the same bucket as rebase. Until you know what it does, you'll be fine avoiding it. Since people are sharing their experiences and my recent one is relevant to edit, I'll go: Working on a feature recently, I ended up making 3 changes ("commits") on top of each other and hopping between them via jj edit. The first change wasn't feature specific, it was extending the base project in preparation. The second change just added a doc describing all the changes needed for the feature. The third change removed the doc as parts were implemented, bit by bit. As I progressed on the third change & found stuff I'd missed at the start of this process, I jumped back to edit the first change (maybe I had a bug in that base project extension) and the second change (oh hey, I found something else that needed to be done for the feature). It sounds crazy compared to a git workflow, but at the end of the process I have 3 changes, all tested & working. If I was doing this with git, I'd have to rebase/squash to get the final changes into a neat clear history. | ||
| ▲ | smackmybishop 3 hours ago | parent | prev | next [-] | |
I suggested that since you seemed really concerned about editing the commit that you just told it to edit. Use 'edit' all you want if your goal is to edit commits, otherwise 'new' does what it seems like you're expecting... | ||
| ▲ | baq 5 hours ago | parent | prev [-] | |
edit is useful and there are good reasons to use it, 'never use edit' is like 'never use goto' i.e. false - but if you're just starting out, jj new/jj squash is the way to go indeed. (my particular favorite reasons to use jj edit are git-native tools which expect to work with uncommitted files e.g. autoformatters, linters, etc. which have been scripted in CI/dev workflows such that they cannot accept a list of files as params) | ||