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
Choose a base branch
from

Conversation

shervinsahba
Copy link

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 October 28, 2019 20:50
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".
Forgot to check if a branch existed! Fixed that. Now the script works in both .git repos and other directories.
@minelminel
Copy link

Any action on this? Our branch names are automatically generated using the ticket title and often end up exceeding the width of the terminal, this would be a very welcome feature addition for anyone in a similar situation.

@shervinsahba
Copy link
Author

I haven't seen much action on this project in the last two years despite its popularity, unfortunately.

@jeffabailey
Copy link

Why isn't this PR getting any love?

I need to be able to do this and I would rather not have to hack powerline.

This is what the shell looks like, it's not cool.

image

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.

3 participants