Skip to content
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

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open

Conversation

msuozzo
Copy link

@msuozzo msuozzo commented Jun 7, 2024

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:

let g:signify_vcs_cmds.jj = 'jj diff --color=never --git --context=0 --from=''parents(heads(::@ & description(glob:"?*"))&mutable()) | ~(heads(::@ & description(glob:"?*"))&mutable())&heads(::@ & description(glob:"?*"))'' -- %f'

@msuozzo
Copy link
Author

msuozzo commented Jun 7, 2024

@jamessan seems the most recent reviewer

autoload/sy/repo.vim Outdated Show resolved Hide resolved
@msuozzo msuozzo force-pushed the push-rlxuvottqssu branch from 588237e to 4f7ebce Compare June 9, 2024 01:31
@jamessan jamessan mentioned this pull request Dec 9, 2024
@@ -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',
Copy link

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.

Copy link

@algmyr algmyr Jan 20, 2025

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

Copy link

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.

@jamessan jamessan linked an issue Dec 27, 2024 that may be closed by this pull request
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Add support for jujutsu
3 participants