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

git-prompt show errors if the current branch is a tag #5747

Closed
robsonpeixoto opened this issue Jan 3, 2017 · 3 comments · Fixed by #7322
Closed

git-prompt show errors if the current branch is a tag #5747

robsonpeixoto opened this issue Jan 3, 2017 · 3 comments · Fixed by #7322

Comments

@robsonpeixoto
Copy link

➜  cd ~/.nvm
git_super_status:[:4: integer expression expected: origin/HEAD,
git_super_status:[:7: integer expression expected: origin/master,
git_super_status:[:11: integer expression expected: master
git_super_status:[:23: integer expression expected: master
.nvm
➜  git branch                                                                                                                                                       (tags/v0.33.0,|)
* (HEAD detached at v0.33.0)
  master
git_super_status:[:4: integer expression expected: origin/HEAD,
git_super_status:[:7: integer expression expected: origin/master,
git_super_status:[:11: integer expression expected: master
git_super_status:[:23: integer expression expected: master
@Obbi89
Copy link

Obbi89 commented May 10, 2017

Line 20 in plugins/git-prompt/gitstatus.py has a greedy .* that has to be non-greedy to work.

This is a sample where greedy will cause issues:
79445c1 (HEAD, tag: v1.0.0-rc.2, origin/master, origin/HEAD, master)

the current regex selects v1.0.0-rc.2, origin/master, origin/HEAD, master as tag.
Since this contains whitespaces it breaks gitstatuses output format.

Simply adding a ? after .* will fix the issue.
Not sure however if that fixes all problems.
Maybe there should be a stronger approach to parse this.

There is already a pull request open for this:
#4991

@cweekly
Copy link

cweekly commented Dec 20, 2017

Same issue when simply doing git init:

$ mkdir tmp && cd $_
$ git init
Initialized empty Git repository in /Users/cweekly/.git/
git_super_status:[:4: integer expression expected: yet
git_super_status:[:7: integer expression expected: commits
git_super_status:[:11: integer expression expected: on
git_super_status:[:14: integer expression expected: master
git_super_status:[:23: integer expression expected: master

@tillydray
Copy link

FWIW I had this issue when I cloned a new, empty repo this morning. After 20 minutes of troubleshooting, I decided to make a first commit and push, after which this error stopped showing up. So if this is happening with a new, empty repo, try pushing a commit and see if it goes away. Not ideal, but good enough.

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 a pull request may close this issue.

4 participants