Skip to content
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 module for Jujutsu current change ID #5814

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

poliorcetics
Copy link

Description

Adds support for getting and displaying the current Jujutsu change ID (when in a Jujutsu repo)

Motivation and Context

Jujutsu is a new VCS that is change-based.

I want to do several PRs to add various parts of its informations to starship, starting with the simplest one, the current change ID.

Screenshots (if appropriate):

Explained prompt, with the JJ change ID module:

Screenshot 2024-03-02 at 13 45 29

Result of explained prompt above:

Screenshot 2024-03-02 at 13 45 50

How Has This Been Tested?

  • I have tested using MacOS
  • I have tested using Linux
  • I have tested using Windows

Checklist:

  • I have updated the documentation accordingly.
  • I have updated the tests accordingly.

@poliorcetics poliorcetics changed the title feat: jj: add jj current change ID feat: jj: add module for Jujutsu current change ID Mar 2, 2024
@poliorcetics
Copy link
Author

I see #5772 exists, it uses the approach of computing everything at once and only displaying the wanted elements, I'm not sure which starship prefers

@necauqua
Copy link

necauqua commented Mar 2, 2024

I'd strongly prefer the jj calls would have --ignore-working-copy to avoid snapshots being made literally on every prompt. Somebody might want it I guess, but at least make it configurable then.

Not snapshotting works fine for change ids and branches, for diffs you'd either give up and do snapshots or wait for --no--commit-transaction option to be a thing

edit: well that other PR does this and more, oh well :)

[Jujutsu](https://github.com/martinvonz/jj) is a new VCS that is change-based.

I want to do several PRs to add various parts of its informations to starship, starting with the 
simplest one, the current change ID.
@poliorcetics
Copy link
Author

@necauqua you're right, and --ignore-working-copy is much faster too.

I also added the --repository, I though it would interfere with testing but since I mocked jj root too, it doesn't 🎉

The step has gone from 48ms before to 35ms with those

@andytom andytom changed the title feat: jj: add module for Jujutsu current change ID feat(JJ): add module for Jujutsu current change ID Mar 2, 2024
@andytom andytom changed the title feat(JJ): add module for Jujutsu current change ID feat(jj): add module for Jujutsu current change ID Mar 3, 2024
@ckoehler
Copy link

ckoehler commented Apr 3, 2024

Would love to also be able to indicate whether the change is empty or missing a description. Thanks! Happy to help move this along...

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants