-
Notifications
You must be signed in to change notification settings - Fork 103
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add jujutsu support #414
base: master
Are you sure you want to change the base?
Add jujutsu support #414
Conversation
@jamessan seems the most recent reviewer |
Source at https://github.com/martinvonz/jj and hosted docs at https://martinvonz.github.io/jj/latest/.
588237e
to
4f7ebce
Compare
@@ -645,6 +651,7 @@ let s:default_vcs_cmds_diffmode = { | |||
\ 'accurev': 'accurev cat %f', | |||
\ 'perforce': 'p4 print %f', | |||
\ 'tfs': 'tf view -version:W -noprompt %f', | |||
\ 'jj': 'jj cat -- %f', |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Shouldn't this be getting the file contents from @-
(ie, jj cat -r @- -- %f
)?
The jj diff
in default_vcs_commands shows the diff between @-
and @
, and practically speaking, @-
is jj's HEAD
analogue.
It's more complicated if @
is a merge, since that would involve synthesising a merged version of the parents' files like jj diff
does. I don't have a good solution for that, unfortunately.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
That sounds like it might be what we want yeah. Tbh I'm still not sure exactly sure what signify uses the different commands for.
Some quick testing: With the current setup it seems to default to show the diff compared to @-,but with edits to the buffer it shows the diff compared to @. Tbh, I don't hate that behavior but I suspect it's not what is expected compared to the other vcs implementations here. With -r @-
it behaves more like you would expect. So +1 to fixing that
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Also, jj cat
is deprecated, jj file show
would be the new spelling.
patch originally authored by @algmyr
while the default diff does work, the 'working-copy-as-a-commit' semantics of jj mean that it may be preferable to customize the diff range to include the last non-anonymous commit. Unfortunately, there isn't currently an easy way to express this but the following should approximate it: