Add an item for jj
Description
Adds an item for jj based on their fish and Starship prompts.
Screenshots (if appropriate)
How Has This Been Tested
- [x] I have tested using Linux.
- [x] I have tested using MacOS.
Checklist
- [x] I am ready to update the wiki accordingly.
- [x] I have updated the tests accordingly.
It seems to be working pretty well for me:
Thank you very much!
Btw, the image is from a colocated repo. I wonder if it would be useful (and doable) to hide the normal git item from the prompt when the jj item is active.
I could see an argument for that, but jj is also niche and early days. If they were at 1.0/feature parity with things like submodules, etc. I might be more inclined to attempt excluding Git if jj appears to be configured for the repo as well.
For now my opinion is that people can just customize their prompt to exclude Git if they like. I don’t think Starship even allows disabling the Git repo status, so the existence of that jj prompt for it probably means that’s acceptable enough for the time being.
For now my opinion is that people can just customize their prompt to exclude Git if they like.
Note that I still use git for some projects.
But yeah, it's fine like this for now.
Thanks again.
❯ Warning: In template expression
--> 3:9
|
3 | branches.map(|x| if(
| ^------^
|
= branches() is deprecated; use bookmarks() instead
https://github.com/martinvonz/jj/releases/tag/v0.22.0
Thanks for noticing that! I'm using the version from https://github.com/martinvonz/jj/pull/3191 so I didn't get that warning (yet)
It works, thanks!
Any progress on getting this merged? It works great for me.
I wanted to try out your jj prompt @ETCaton, but after uninstalling Tide and re-installing from a local clone of your repo, I'm still seeing the normal git prompt. Am I missing something?
I ran:
fisher remove IlanCosman/tide
git clone [email protected]:ETCaton/tide.git && cd tide
git checkout jj-item
fisher install .
# <run configuration script>
# open a new terminal and cd to a colocated jj dir, don't see jj info
Any progress on getting this merged? It works great for me.
Looking at repo and author activity, it seems like they’re currently a little busy. I don’t see a particularly active fork to imply people are moving away from this, or merging in patches themselves in the meantime, so for now I think copying this file would suffice. Only changes I intend to make to this PR would be ones to accommodate jj changes upstream like the branch->bookmark renaming
I'm still seeing the normal git prompt
This doesn’t suppress the Git prompt, so that’s expected. If you mean you’re not seeing jj I’m not sure; have you customized your prompt/does explicitly adding this make it show up?
@ETCaton I'm unsure what "explicitly adding this make it show up means".
on a terminal with tide removed:
thor@crow ~/tide ((no description set) n 45 (empty))>
I've set the can see the jj descriptors via the script borrowd from this gist: https://gist.github.com/hroi/d0dc0e95221af858ee129fd66251897e/
after fisher install . from your tide fork:
~/tide jj-item
❯
that is, no jj info.
On running the function you added, issues elsewhere in tide are reported:
❯ _tide_item_jj
test: Missing argument at index 3
= left
^
~/.config/fish/functions/_tide_print_item.fish (line 9):
else if test $_tide_side = left
^
in function '_tide_print_item' with arguments 'jj \(\e\[1m\e\[38\;5
\;5mq\e\[0m\ \e\[1m\e\[38\;5\;4mc\e\[0m\)'
called on line 32 of file ~/.config/fish/functions/_tide_it
em_jj.fish
in function '_tide_item_jj'
(q c)⏎
~/.files/fish @12a9aa2 !2
❯
@thor314
Re: "explicitly adding this"
Inserting jj into the tide_left_prompt_items universal variable seems to be sufficient.
I also inserted .jj into the tide_pwd_markers universal variable, for good measure.
thanks dragon. I asked claude how to do what you told me to, and after running:
set -U tide_left_prompt_items $tide_left_prompt_items jj
# Add .jj to the pwd markers
set -U tide_pwd_markers $tide_pwd_markers .jj
I see in my prompt: ~/.files @be7533b ❯ (w 2)
this is a little out of order, so I adjusted things around, and now we've got the right order. Cheers, love the tool.
❯ echo $tide_left_prompt_items
pwd git newline character
❯ set -U tide_left_prompt_items pwd git jj newline character
additionally, if relevant, the initial PR was marked tested on OS X. I have tested on Linux.
Also tested on Linux and thanks to 0.26 we can get diff info without resorting to manual string parsing. Currently just mimicking the Starship prompt's modified addition removals <#>m <#>+ <#>-, though other data is available: https://github.com/jj-vcs/jj/blob/main/docs/templates.md#treediff-type
Actually, I misread the m as "modified" but to replicate the prompt we should be counting files changed regardless of status
@IlanCosman did you close this as "won't fix"? Or you just plan some alternative implementation?
@IlanCosman did you close this as "won't fix"? Or you just plan some alternative implementation?
No, I just closed everything from before 2025 because it's easier to come back to a small number of PRs with people that want to actively drive them forward. Hopefully anything important will be resubmitted 😄