|
I have the following code in my shell prompt: # if there's an error here, we'll see it because we don't redirect stderr.
jj_desc() {
rev=$1; color=$2
desc=$(jj log --ignore-working-copy --no-graph -T description -r "$rev" | head -n1)
if [ -n "$desc" ]; then
printf %s "(${color}jj: $desc)"
return 0
fi
return 1
}
if jj_desc @ "$FAINT_RED"; then exit 0; fi
if [ "$(jj diff --ignore-working-copy --name-only | wc -l)" = 0 ]; then
color="$FAINT_GREEN"
else
color="$FAINT_RED"
fi
jj_desc @- || printf %s "${color}jj"This takes about .15 seconds to execute on a medium-large repo (~3.4 million git objects): As you can see, the longest bits are |
Answered by
jyn514
Feb 19, 2026
Replies: 2 comments
|
I did find a way to combine all these into a single invocation of jj, which is fast enough for my needs: |
0 replies
Answer selected by
jyn514
|
I also found that jj was spending time spawning |
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
I did find a way to combine all these into a single invocation of jj, which is fast enough for my needs: