paulirish / git-recent

See your latest local git branches, formatted real fancy
https://www.npmjs.com/package/git-recent
MIT License
970 stars 36 forks source link

Workaround for broken format on Windows #9

Closed daniel-liuzzi closed 8 years ago

daniel-liuzzi commented 8 years ago

Before

1-before

After

2-after

Essentially, this trades yellow refnames with proper alignment. Once column is fixed, this can then be burned to ashes. This only affects Windows.

Ref. #8

paulirish commented 8 years ago

I think we can do this a little more elegantly. Like building our format string using a few bash variables, and we'll only branch for the first. Know what i mean?

daniel-liuzzi commented 8 years ago

If you mean to remove all duplication, I totally agree. I was going to do just that. If you that's not what you mean, then forgive my ignorance. This is the first time ever I work on a bash script!

The reason I did it like this is because I don't have access to a proper console (i.e. one where column works), so I can't test that use case. Also since this is a (hopefully) temporary fix, I did it all ad-hoc, so removing it when it's no longer needed is as simple as deleting it.

I'll try and set up a Linux VM to give this another shot.

daniel-liuzzi commented 8 years ago

Tried this on Git Bash on Windows as well as on "Bash on Ubuntu on Windows" (that's a mouthful). Both seem to work properly. Please try it on macOS when you get a chance, as I don't have access to a Mac computer. I have also reported the column bug (git-for-windows/git#865).

paulirish commented 8 years ago

breaks on mac:

image

daniel-liuzzi commented 8 years ago

Fixed. Tested on Mac, Linux, and Windows. Working consistently across all. Sorry about that.

paulirish commented 8 years ago

looks good. thx!