diff --git a/jj-fzf b/jj-fzf index eab619d..2e7684e 100755 --- a/jj-fzf +++ b/jj-fzf @@ -5,14 +5,18 @@ SCRIPTNAME=`basename $0` && function die { [ -n "$*" ] && echo "$SCRIPTNAME: ** SELF="$0" # == PREVIEW fast path == -export REVPAT='^[^a-z()0-9]*([k-xyz]{7,})([?]*)\ ' # line start, ignore --graph, parse revision letters, catch '??'-postfix +JJFZF_PRIVATE="$(jj config get --ignore-working-copy --no-pager git.private-commits 2>/dev/null)" && + [[ "$JJFZF_PRIVATE" =~ ^[.a-z_()-]+$ ]] || JJFZF_PRIVATE='' # only supported unquoted revset names JJ_FZF_SHOWDETAILS=' concat( builtin_log_oneline, "Change ID: " ++ self.change_id() ++ "\n", "Commit ID: " ++ commit_id ++ "\n", + "Flags: ", separate(" ", + if(immutable, label("node immutable", "immutable")), + '"${JJFZF_PRIVATE:+ if(self.contained_in('$JJFZF_PRIVATE') && !immutable, label('committer', 'private')), }"' + ) ++ "\n", surround("Refs: ", "\n", separate(" ", local_bookmarks, remote_bookmarks, tags)), - if(immutable, "Immutable: " ++ label("description placeholder", "true") ++ "\n"), "Parents: " ++ self.parents().map(|c| " " ++ c.change_id()) ++ "\n", "Author: " ++ format_detailed_signature(author) ++ "\n", "Committer: " ++ format_detailed_signature(committer) ++ "\n\n", @@ -20,6 +24,7 @@ concat( coalesce(description, label(if(empty, "empty"), description_placeholder) ++ "\n")), "\n", )' # extended version of builtin_log_detailed; https://github.com/martinvonz/jj/blob/main/cli/src/config/templates.toml +export REVPAT='^[^a-z()0-9]*([k-xyz]{7,})([?]*)\ ' # line start, ignore --graph, parse revision letters, catch '??'-postfix if test "${1:-}" == preview # preview command, nested invocation then if [[ "${2:-} " =~ $REVPAT ]] # match beginning of jj log line @@ -143,6 +148,7 @@ if(root, if(git_head, label("git_head", "git_head()")), if(conflict, label("conflict", "conflict")), if(empty, label("empty", "(empty)")), + '"${JJFZF_PRIVATE:+ if(self.contained_in('$JJFZF_PRIVATE') && !immutable, label('committer', '🌟')), }"' if(description, description.first_line(), label(if(empty, "empty"), description_placeholder),