From 4f7ebcece2cbc6dc53d8e2844c7aab8cb8b40753 Mon Sep 17 00:00:00 2001 From: Matthew Suozzo Date: Fri, 7 Jun 2024 17:09:47 -0400 Subject: [PATCH] Add jujutsu support Source at https://github.com/martinvonz/jj and hosted docs at https://martinvonz.github.io/jj/latest/. --- README.md | 4 +++- autoload/sy/repo.vim | 9 ++++++++- doc/signify.txt | 5 ++++- 3 files changed, 15 insertions(+), 3 deletions(-) diff --git a/README.md b/README.md index 0181ab3..6debe6a 100644 --- a/README.md +++ b/README.md @@ -8,7 +8,8 @@ removed lines in a file that is managed by a version control system (VCS)._ --- - Supports **git**, **mercurial**, **darcs**, **bazaar**, **subversion**, - **cvs**, **rcs**, **fossil**, **accurev**, **perforce**, **tfs**, **yadm**. + **cvs**, **rcs**, **fossil**, **accurev**, **perforce**, **tfs**, **yadm**, + **jj**. - **Asynchronous** execution of VCS tools for Vim 8.0.902+ and Neovim. - **Preserves signs** from other plugins. - Handles **nested repositories** controlled by different VCS. @@ -46,6 +47,7 @@ endif ``` ## Configuration for async update + ```vim " default updatetime 4000ms is not good for async update set updatetime=100 diff --git a/autoload/sy/repo.vim b/autoload/sy/repo.vim index f651c29..b7f1db2 100644 --- a/autoload/sy/repo.vim +++ b/autoload/sy/repo.vim @@ -179,6 +179,11 @@ function! s:check_diff_svn(exitval, diff) abort return a:exitval ? [0, []] : [1, a:diff] endfunction +" s:check_diff_jj {{{1 +function! s:check_diff_jj(exitval, diff) abort + return a:exitval ? [0, []] : [1, a:diff] +endfunction + " s:check_diff_bzr {{{1 function! s:check_diff_bzr(exitval, diff) abort return (a:exitval =~ '[012]') ? [1, a:diff] : [0, []] @@ -629,7 +634,8 @@ let s:default_vcs_cmds = { \ 'rcs': 'rcsdiff -U0 %f 2>%n', \ 'accurev': 'accurev diff %f -- -U0', \ 'perforce': 'p4 info '. sy#util#shell_redirect('%n') . (has('win32') ? ' &&' : ' && env P4DIFF= P4COLORS=') .' p4 diff -du0 %f', - \ 'tfs': 'tf diff -version:W -noprompt -format:Unified %f' + \ 'tfs': 'tf diff -version:W -noprompt -format:Unified %f', + \ 'jj': 'jj diff --color=never --git --context=0 -r @ -- %f', \ } let s:default_vcs_cmds_diffmode = { @@ -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', \ } if exists('g:signify_vcs_cmds') diff --git a/doc/signify.txt b/doc/signify.txt index 77e358a..74a2791 100644 --- a/doc/signify.txt +++ b/doc/signify.txt @@ -163,6 +163,7 @@ The key can be any from this list: accurev perforce tfs + jj Modifiers:~ @@ -201,7 +202,8 @@ Default: \ 'rcs': 'rcsdiff -U0 %f 2>%n', \ 'accurev': 'accurev diff %f -- -U0', \ 'perforce': 'p4 info '. sy#util#shell_redirect('%n') . (has('win32') ? ' &&' : ' && env P4DIFF= P4COLORS=') .' p4 diff -du0 %f', - \ 'tfs': 'tf diff -version:W -noprompt -format:Unified %f' + \ 'tfs': 'tf diff -version:W -noprompt -format:Unified %f', + \ 'jj': 'jj diff --color=never --context=0 -r @ -- %f', \ } < ------------------------------------------------------------------------------ @@ -219,6 +221,7 @@ Default: \ 'accurev': 'accurev cat %f', \ 'perforce': 'p4 print %f', \ 'tfs': 'tf view -version:W -noprompt %f', + \ 'jj': 'jj cat -- %f', \ } < The command to use for updating signs in a `modified` buffer, thus when the