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

branch detection with new git #37

Closed
rurban opened this issue Dec 10, 2013 · 1 comment
Closed

branch detection with new git #37

rurban opened this issue Dec 10, 2013 · 1 comment

Comments

@rurban
Copy link

rurban commented Dec 10, 2013

new git ( in my case 1.8.5.1 ) changed git status output, the '# ' prefix is gone

So I have to use now:

        eval " $(
                git status 2>/dev/null |
                    sed -n '
                        s/^On branch /branch=/p
                        s/^nothing to commi.*/clean=clean/p
                        s/^Initial commi.*/init=init/p
                        s/^Your branch is ahead of \(.\).\+\1 by [[:digit:]]\+ commit.*/freshness=${WHITE}↑/p
                        s/^Your branch is behind \(.\).\+\1 by [[:digit:]]\+ commit.*/freshness=${YELLOW}↓/p
                        s/^Your branch and \(.\).\+\1 have diverged.*/freshness=${YELLOW}↕/p
                    '
        )"

sed doesn't understand s/^(# )?On branch /branch=/p
so I fear the change has to check the git version

@lvv
Copy link
Owner

lvv commented Dec 10, 2013

Thanks for heads up. Fix is in the repo, though not very well tested.
Sed does not understand (# )?, but it will understand (# )*

@lvv lvv closed this as completed Dec 10, 2013
amiryal added a commit to amiryal/git-prompt that referenced this issue Jun 5, 2014
amiryal added a commit to amiryal/git-prompt that referenced this issue Jun 5, 2014
amiryal added a commit to amiryal/git-prompt that referenced this issue Jun 5, 2014
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

No branches or pull requests

2 participants