spacedentist / spr

Submit pull requests for individual, amendable, rebaseable commits to GitHub
https://getcord.github.io/spr/
MIT License
376 stars 33 forks source link

spr diff uses jujutsu to amend? #182

Open sunshowers opened 8 months ago

sunshowers commented 8 months ago

Hi everyone,

I've been using spr for the last year or so and really love it so far. As an ex-Meta source control person I've always preferred the stacked diff workflow and spr is the best tool of the lot.

I've been trying out Jujutsu version control with a colocated Git repository, and that works pretty well in conjunction with spr (since jj and spr are both about amend/rebase-based workflows). But there's a little nit I ran into, which is that spr diff, spr amend etc use git commit --amend to amend commit messages. This is okay, but essentially creates a separate commit with its own identity in jj -- jj cannot link the identities of the old and new commits.

Ideally spr would be able to run jj describe @- --stdin and feed in the message over stdin, which would avoid this problem. Would it be okay to extend spr's amending logic to use jj describe if a jujutsu repository is found?

arxanas commented 7 months ago

Some ideas on the jj side of things:

sunshowers commented 6 months ago

If there is a branch attached to the commit, then jj will correctly track the rewrite the next time it imports refs. I don't know what your workflow looks like, exactly, but if you could attach a branch to help jj out, then everything should work fine.

Ahh part of the point of me using jj is that I really want the anonymous heads workflow :)

sunshowers commented 4 months ago

I wrote some very basic support using the jj cli -- it likely needs more polish, but it works okay: https://github.com/getcord/spr/compare/master...sunshowers:spr:master

sunshowers commented 3 weeks ago

^ I've been using the above for the last 4 months and it's been fine. Pretty good even!