New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feat(jj): add jj module to display repository status #5772
base: master
Are you sure you want to change the base?
Conversation
2a643ce
to
569dc09
Compare
The only unresolved message is how to make jj module mutual exclusive to git module - show only jj status if it's available, otherwise show git* modules. |
My suggestion: provide an option to prefer status from Implementation: we can get the repo root with |
I think it's possible to filter the git module's output if jj is present here, but a better mechanism can be implemented. |
Is it possible to get this jj status through git, to avoid duplication and perhaps external command spawning? |
Sadly, no. JJ maintains its own database in the |
I'm daily driving it for a week, haven't found any problems. It resolves in 90ms even it linux repo.
|
569dc09
to
e90721a
Compare
Hi, I was wondering if someone could take a look at this PR when you have a chance. Thank you! |
I would rather avoid that as long as it still depends on In general regarding the module, I would prefer if the module here was named and structured in line with other starship vcs modules for git/hg/fossil. |
Even if gitoxide was used instead inside JJ, there would still be the problem of future or private backends, which |
e90721a
to
a3c7fa9
Compare
a3c7fa9
to
611c9b4
Compare
611c9b4
to
d9acbbc
Compare
@davidkna, do you want me to refactor this PR to match the structure of #5814? I can do that, but I'm still unsure about how to handle output that conflicts with Git. For example, if we break down the |
I think we could introduce a config to say "disable git if jj is present", since if both are there, jj is very probably the one wanted by users. Something like [jj]
disable-git = true there are several cases as a result:
|
If we make the JJ module disabled by default (or not in the default status line) the cost of checking should be one easily cached boolean |
@davidkna can you please comment on this? |
Maybe what we need is not separate modules per VCS but instead a single "VCS" module with a behavior like this: [vcs]
# Order in which the VCSs are tried for the current directory.
# The first successful one is picked
order = [
"jj",
"git",
"pijul",
# ...
] # The default would be git first probably, to make the first check successful for most people ?
# and the final status line would replace the whole "$vcs" module with the relevant format
jj_format = "jj: $jj_change$jj_status"
git_format = "git: $git_branch$git_state" People could then still configure their modules independently and (de)activate one by one but the final statusline would only ever display one VCS. If they want several VCS, they could still directly use the relevant modules in the directly in the overall statusline What do you all think ? |
@0xdeafbeef Please do split the module up. |
```toml | ||
# ~/.config/starship.toml | ||
|
||
[jj] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
[jj] | |
[jj_status] |
The docs here are out of sync with the code. Also needs changing in the initial prose.
Description
Add jj status module, which shows basics info for jj repos.
Screenshots (if appropriate):
Change without branch
Change set to some branch
Change with description
How Has This Been Tested?
Checklist: