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

Added possibility to show shorten project dir on Git #300

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

Conversation

maoueh
Copy link

@maoueh maoueh commented Dec 22, 2018

Added a new option BULLETTRAIN_DIR_SHORTEN_GIT_REPO available through prompt_dir that
will displays a shorten prompt dir if the current working directory is within a git repository.

For a prompt_dir of /Users/john/work/project/a where a has a .git folder, the prompt dir when using BULLETTRAIN_DIR_SHORTEN_GIT_REPO would be simply a. For a prompt_dir of /Users/john/work/project/b/nested/deep where b has a .git folder, the prompt dir when using BULLETTRAIN_DIR_SHORTEN_GIT_REPO would be b/nested/deep.

If there is no .git directory within the working directory or its parent, then prompt_dir behaves as before.

Added a new option `BULLETTRAIN_DIR_SHORTEN_GIT_REPO` available through
`prompt_dir` that will displays a shorten prompt dir if the current
working directory is within a git repository.

For a `prompt_dir` of `/Users/john/work/project/a` where `a` has a
`.git` folder, the prompt dir when using
`BULLETTRAIN_DIR_SHORTEN_GIT_REPO` would be simply `a`. For a
`prompt_dir` of `/Users/john/work/project/b/nested/deep` where `b` has a
`.git` folder, the prompt dir when using
`BULLETTRAIN_DIR_SHORTEN_GIT_REPO` would be `b/nested/deep`.

If there is no `.git` directory within the working directory or
its parent, then `prompt_dir` behaves as before.
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.

1 participant