Skip to content

Commit 6525fb3

Browse files
committed
Merge branch 'improve-preview-performance'
* Branch commit log: jj-fzf: cut off the preview after a few thausand lines Cutting off the preview process at a point where users are unlikely to scroll to vastly improves preview performance for giant imports. jj-fzf: split-files: try using `jj diff` instead of `git diff-tree` Signed-off-by: Tim Janik <timj@gnu.org>
2 parents 4e996bd + e6afe36 commit 6525fb3

File tree

1 file changed

+5
-4
lines changed

1 file changed

+5
-4
lines changed

jj-fzf

+5-4
Original file line numberDiff line numberDiff line change
@@ -43,8 +43,9 @@ then
4343
then
4444
jj --no-pager --ignore-working-copy ${JJFZF_ATOP:+--at-op $JJFZF_ATOP} evolog --color=always -r "$REVISION"
4545
else # show commit and diff
46-
jj --no-pager --ignore-working-copy ${JJFZF_ATOP:+--at-op $JJFZF_ATOP} log --color=always --no-graph -T "$JJ_FZF_SHOWDETAILS" -s -r "$REVISION"
47-
exec jj --no-pager --ignore-working-copy ${JJFZF_ATOP:+--at-op $JJFZF_ATOP} show --color=always -T ' "\n" ' -r "$REVISION" --ignore-space-change
46+
{ jj --no-pager --ignore-working-copy ${JJFZF_ATOP:+--at-op $JJFZF_ATOP} log --color=always --no-graph -T "$JJ_FZF_SHOWDETAILS" -s -r "$REVISION"
47+
jj --no-pager --ignore-working-copy ${JJFZF_ATOP:+--at-op $JJFZF_ATOP} show --color=always -T ' "\n" ' -r "$REVISION" --ignore-space-change
48+
} | head -n 4000
4849
fi
4950
else # no valid revision
5051
true
@@ -67,7 +68,7 @@ case "${1:-}" in
6768
preview_oppatch)
6869
[[ " ${2:-} " =~ $OPRPAT ]] && {
6970
jj --no-pager --ignore-working-copy --color=always op show -p "${BASH_REMATCH[1]}"
70-
} ; exit ;;
71+
} | head -n 4000 ; exit ;;
7172
preview_opdiff)
7273
[[ " ${2:-} " =~ $OPRPAT ]] && {
7374
jj --no-pager --ignore-working-copy --color=always op diff -f "${BASH_REMATCH[1]}" -t @
@@ -1042,7 +1043,7 @@ split-files()
10421043
R="$(xrev "${1:-@}")"
10431044
cd "$JJROOT" # operate on root relative file names
10441045
# read files affected by $R
1045-
mapfile -t MAPFILE < <(git diff-tree --no-commit-id --name-only -r "$(rev_commitid "$R")")
1046+
mapfile -t MAPFILE < <(jj diff --name-only -r "$(rev_commitid "$R")")
10461047
[[ ${#MAPFILE[@]} -gt 1 ]] ||
10471048
return
10481049
# show undo hint

0 commit comments

Comments
 (0)