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(directory): Add truncate_repo_length option #5872

Open
wants to merge 5 commits into
base: master
Choose a base branch
from

Conversation

Sberm
Copy link

@Sberm Sberm commented Mar 23, 2024

Description

Expand truncated repo name to the parent directories to preserve more information.

The default value for truncate_repo_length is 1, which doesn't change any behavior that truncate_to_repo = true already has.

truncate_repo_length will work only when truncate_to_repo is set to true.

For example, you are in sub directory src where you initialized as a git repo. But you also want to know what it's parent directory is, like project/src, you can set truncate_repo_length = 2 to do that.

Motivation and Context

Closes #5774

Screenshots (if appropriate):

starship is the git repo, when truncate_repo_length = 2 is set, directories expand to left by one.

截屏2024-03-23 下午11 47 25

when truncate_repo_length = 4

截屏2024-03-23 下午11 49 12

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.

@andytom andytom changed the title feat: Add truncate_repo_length option feat(directory): Add truncate_repo_length option Mar 29, 2024
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.

[directory] add an option to add a lendth to truncate_to_repo
1 participant