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

Columns in git-effort adopt to file length #633

Merged
merged 3 commits into from
Mar 6, 2017
Merged

Columns in git-effort adopt to file length #633

merged 3 commits into from
Mar 6, 2017

Conversation

nschlimm
Copy link

@nschlimm nschlimm commented Mar 4, 2017

The columns in git-effort end up in a mess when you have longer file names.
I have fixed that so the column width matches the longest file in the current git repo.

Copy link
Author

@nschlimm nschlimm left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

columns=$(( $(git ls-files | awk '{ print length }' | sort -rn | head -1 ) + 5 ))
shorter and also works obviously

bin/git-effort Outdated
@@ -5,6 +5,7 @@ above=0
# if the output won't be printed to tty, disable the color
test -t 1 && to_tty=true
color=
columns=45
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

colums=45 seems duplicate now, because you will calculate it from longest filename later.

Copy link
Author

@nschlimm nschlimm Mar 5, 2017

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

taken that out. I have another branch where you can set the columns as option on the command line when calling git effort, this was the default setting. however it's not necessary here ...

@spacewander spacewander merged commit b0ba3e5 into tj:master Mar 6, 2017
@spacewander
Copy link
Collaborator

@nschlimm
Merged. Thanks for your contribution!

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.

2 participants