File tree Expand file tree Collapse file tree 3 files changed +16
-1
lines changed Expand file tree Collapse file tree 3 files changed +16
-1
lines changed Original file line number Diff line number Diff line change
1
+ # geometry_jj - display current jujutsu status
2
+
3
+ geometry_jj () {
4
+ (( $+commands[jj] )) || return 1
5
+ jj log --quiet --no-pager --no-graph --ignore-working-copy --revisions @ --color never --template \
6
+ ${GEOMETRY_JJ_TEMPLATE:-'"%F{5}" ++ change_id.shortest() ++ "%F{4}" ++ commit_id.shortest() ++ "%f% "'} \
7
+ 2> /dev/null
8
+ }
Original file line number Diff line number Diff line change 7
7
typeset -gA GEOMETRY; GEOMETRY[ROOT]=${0: A: h}
8
8
9
9
(( $+ GEOMETRY_PROMPT)) || GEOMETRY_PROMPT=(geometry_echo geometry_status geometry_path)
10
- (( $+ GEOMETRY_RPROMPT)) || GEOMETRY_RPROMPT=(geometry_exec_time geometry_git geometry_hg geometry_echo)
10
+ (( $+ GEOMETRY_RPROMPT)) || GEOMETRY_RPROMPT=(geometry_exec_time geometry_git geometry_hg geometry_jj geometry_echo)
11
11
(( $+ GEOMETRY_INFO)) || GEOMETRY_INFO=()
12
12
(( $+ GEOMETRY_TITLE)) || GEOMETRY_TITLE=(geometry_path)
13
13
(( $+ GEOMETRY_CMDTITLE)) || GEOMETRY_CMDTITLE=(geometry_cmd geometry_hostname)
Original file line number Diff line number Diff line change @@ -120,6 +120,13 @@ GEOMETRY_GIT_TIME_DETAILED=true # show full time (e.g. `12h 30m 53s`) instea
120
120
121
121
![ picture of git features] ( ./images/screenshots/git.png )
122
122
123
+ ### geometry_jj
124
+ You can customize the template using [ jj template language] ( https://jj-vcs.github.io/jj/latest/templates/ )
125
+
126
+ ``` shell
127
+ GEOMETRY_JJ_TEMPLATE=' "%F{5}" ++ change_id.shortest() ++ "%F{4}" ++ commit_id.shortest() ++ "%f% "'
128
+ ```
129
+
123
130
## Hostname based colors
124
131
Geometry provides a generic function (` geometry::hostcolor ` ) for setting any color based on hostname. The color is calculated as the sum of each character converted to an integer. For example the hostname 'abc' generates a value of 294.
125
132
You can’t perform that action at this time.
0 commit comments