The Wayback Machine - https://web.archive.org/web/20201223062335/https://github.com/b-ryan/powerline-shell/pull/482
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

Config options added to truncate git branch names #482

Open
wants to merge 4 commits into
base: master
from

Conversation

@shervinsahba
Copy link

@shervinsahba shervinsahba commented Oct 29, 2019

This is related to #438 . I added two options to truncate git branch names to use with config.json.

  "git": {
      "master_is_M": true,
      "branch_max_length": 5
  }

The first abbreviates master to M. The second sets a maximum number of characters to display for the branch name. Names past that length are truncated and appended with the unicode ellipsis.

I didn't look at bzr or other vc systems, so I kept this git specific.

Shervin Sahba added 4 commits Oct 29, 2019
Shervin Sahba
Two config.json options added that help truncate git branch names. The first shortens "master" to "M". The second truncates the branch name to a given length. For example, with these config settings:
```
  "git": {
      "master_is_M": true,
      "branch_max_length": 5
}
```
We would see "M" in lieu of "master" and "whate…" in lieu of "whatever".
Shervin Sahba
Shervin Sahba
Shervin Sahba
Forgot to check if a branch existed! Fixed that. Now the script works in both .git repos and other directories.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Linked issues

Successfully merging this pull request may close these issues.

None yet

1 participant
You can’t perform that action at this time.