@@ -434,7 +434,7 @@ echo_commit_msg()
434
434
test ${# FILES[@]} -gt 0 &&
435
435
printf " %s: \n" " ${FILES[@]} " ||
436
436
echo " "
437
- { jj config --no-pager get ' ui.default-description' 2> /dev/null || : ; } | sed ' 1{/^$/d}'
437
+ { jj config --no-pager get ' ui.default-description' 2> /dev/null || : ; } | gsed ' 1{/^$/d}'
438
438
test ${# FILES[@]} -le 0 ||
439
439
echo_signoff
440
440
fi
@@ -834,8 +834,10 @@ merging()
834
834
cd " $JJROOT " # otherwise, a subdir and $PWD could vanish
835
835
temp_dir
836
836
# Find tracked upstream revision
837
- [[ $( jj --no-pager --ignore-working-copy log --no-graph -r ' trunk()' -T ' bookmarks' ) =~ ^([^@\ :]+).* ]] &&
838
- UPSTREAM=" ${BASH_REMATCH[1]} " || UPSTREAM=
837
+ for ups in $( jj --no-pager --ignore-working-copy log --no-graph -r ' trunk()' -T ' bookmarks' ) ; do
838
+ [[ $ups =~ ^(master| main| trunk)(@.* )$ ]] && { UPSTREAM=" ${BASH_REMATCH[1]} " && break ; }
839
+ [[ $ups =~ ^([^@\ :]+).* ]] && UPSTREAM=" ${BASH_REMATCH[1]} "
840
+ done && echo $UPSTREAM
839
841
WCA=" $( jj log --ignore-working-copy --no-pager --no-graph -r " ::@- & $P " -T change_id) " # is $P working copy ancestor?
840
842
test -z " $WCA " && WCA=0 || WCA=1
841
843
echo $WCA > $TEMPD /wcrebase.toggle
@@ -1015,9 +1017,9 @@ op-log()
1015
1017
H=" $H " $' Ctrl-P: Preview changes in an operation with patch via `jj op show -p <op>`\n '
1016
1018
H=" $H " $' Ctrl-S: Preview "@" at a specific operation via `jj show @`\n '
1017
1019
H=" $H " $' \n '
1020
+ H=" $H " $' Alt-J: Inject working copy of the selected operation as historic commit before @\n '
1018
1021
H=" $H " $' Alt-K: Kill undo memory (marked `⋯`), to restart undo at the top\n '
1019
1022
H=" $H " $' Alt-R: Restore repository to the selected operation via `jj op restore`\n '
1020
- H=" $H " $' Alt-W: Restore working copy of the selected operation into a new commit before @\n '
1021
1023
H=" $H " $' Alt-Y: Undo/redo the selected operation entry\n '
1022
1024
H=" $H " $' Alt-Z: Undo the next operation (not already marked `⋯`)\n '
1023
1025
echo ' VIEW=preview_oppatch' >> $TEMPD /oplog.env
@@ -1031,6 +1033,7 @@ op-log()
1031
1033
--bind " ctrl-l:execute-silent( gsed 's/^VIEW=.*/VIEW=preview_oplog/' -i $TEMPD /oplog.env )+refresh-preview" \
1032
1034
--bind " ctrl-p:execute-silent( gsed 's/^VIEW=.*/VIEW=preview_oppatch/' -i $TEMPD /oplog.env )+refresh-preview" \
1033
1035
--bind " ctrl-s:execute-silent( gsed 's/^VIEW=.*/VIEW=preview_opshow/' -i $TEMPD /oplog.env )+refresh-preview" \
1036
+ --bind " alt-j:execute( $SELF restore-commit {} )+abort" \
1034
1037
--bind " alt-k:execute( $SELF undo-reset {} )+$RELOAD " \
1035
1038
--bind " alt-r:execute( $SELF op-restore {} )+abort" \
1036
1039
--bind " alt-w:execute( $SELF restore-commit {} )+abort" \
@@ -1040,6 +1043,7 @@ op-log()
1040
1043
--preview-window ' nowrap,right,border-left' \
1041
1044
--preview " [[ {} =~ $OPPAT ]] || exit; export JJFZF_ATOP=\"\$ {BASH_REMATCH[1]}\" && . $TEMPD /oplog.env && $SELF \$ VIEW {}" \
1042
1045
--no-tac --no-sort +m
1046
+ # TODO: remove alt-w in jj-fzf-0.26
1043
1047
)
1044
1048
KEYBINDINGS[" Ctrl-O" ]= " op-log"
1045
1049
0 commit comments