supercrabtree / k

k is the new l, yo
1.78k stars 123 forks source link

Prepend branch name to the end of output #81

Closed alankyshum closed 6 years ago

alankyshum commented 6 years ago
  1. Edited how SYMLINK_TARGET is printed. Since it's not available to all lines, I've moved the space to the variable itself.
  2. If a git directory is detected, it will check the branch name, and set it to $REPOBRANCH

Before

image

After

image

supercrabtree commented 6 years ago

Could you please add a screen shot of before and after. Thanks :)

alankyshum commented 6 years ago

@supercrabtree sure, more than willing to! I have edited the description.

alankyshum commented 6 years ago

IMO, this is useful when working on multiple repos and want to make sure they are from the correct branch.

supercrabtree commented 6 years ago

Hi sorry for delay

I tested this and works great except for when a folder contains a mix of repo and non repo directories. I was getting all the non-repos decorated with the previous repo branch. You can see this bug in your screenshots. It was because theREPOBRANCH needed to be reset on each iteration.

Also I don't think the colour should be blue, as that is the default for directories. I think just default foreground color should be okay for now.

I submitted a PR to your branch with these changes, if you are happy you can merge them, and then I will merge this.

Thanks for this, really nice feature.