Skip to content
This repository was archived by the owner on Jan 20, 2018. It is now read-only.
This repository was archived by the owner on Jan 20, 2018. It is now read-only.

Getting the current branch name fails in macOS #66

@Mayeu

Description

@Mayeu

Hello,

I am using macOS 10.11.6, and I had trouble to use TopGit. The most basic tg info ended up into a not a TopGit-controlled branch when the branch was created via tg create.

After taking a pick in the source code, I end up finding the cause. The way the current branch name is inferred does not work with macOS'sed:

- ansible-consul git:(t/readme)
🍵  $ git symbolic-ref HEAD 2>/dev/null | sed 's#^refs/\(heads\|top-bases\)/##'
refs/heads/t/readme

I tried to fix the regex but without success, so I ended up installing gnu-sed via homebrew:

$ brew install gnu-sed --with-default-names

And now everything is working.

I believe it would be worth to make the regex also work on macOS, or making it explicit somewhere than GNU-sed is needed.

Now I am getting back to trying and playing with TopGit :) Thank you for your works!

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions