Skip to content

Added possibility to show shorten project dir on Git#300

Open
maoueh wants to merge 1 commit intocaiogondim:masterfrom
maoueh:feature/git-short-dir
Open

Added possibility to show shorten project dir on Git#300
maoueh wants to merge 1 commit intocaiogondim:masterfrom
maoueh:feature/git-short-dir

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