Skip to content

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
# 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