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

No longer shows git current branch #809

Closed
jmiazga opened this issue Jan 20, 2016 · 4 comments
Closed

No longer shows git current branch #809

jmiazga opened this issue Jan 20, 2016 · 4 comments

Comments

@jmiazga
Copy link

jmiazga commented Jan 20, 2016

Cmder v1.2.9 no longer shows the current branch in git. Instead it shows the name and version from package.json.

image

@MartiUK MartiUK added 👆 clink-completions Upstream issue in clink-completions. and removed 👆 clink-completions Upstream issue in clink-completions. labels Jan 20, 2016
@vladimir-kotikov
Copy link
Contributor

@jmiazga, does this happen only in this particular directory, or in every git repo?

Could you please paste the output of git rev-parse --git-dir --is-inside-git-dir --is-bare-repository --is-inside-work-tree (@MartiUK, this is still a nice way to debug 😄 )

@jmiazga
Copy link
Author

jmiazga commented Jan 21, 2016

It happens in every git repo. If there is no package.json nothing is displayed. I downloaded v1.2 and everything works as expected.

Output:

.git
false
false
true

@vladimir-kotikov
Copy link
Contributor

Hm, that's strange. Just checked and the content of config/cmder.lua from 1.2.9 is strictly equal to the one from 1.2.0. So it seems the only reason is the different git versions.

@keathmilligan
Copy link

This seems to be a Windows environment issue. The redirect in the io.popen statement in the get_git_branch function in cmd.lua is causing the lines() function to return nothing in some cases.

One computer (that doesn't have the issue):

Lua 5.3.2  Copyright (C) 1994-2015 Lua.org, PUC-Rio
> for line in io.popen("git branch 2>nul"):lines() do print(line) end
* master
>

Another computer running the same LUA and git:

Lua 5.3.2  Copyright (C) 1994-2015 Lua.org, PUC-Rio
> for line in io.popen("git branch 2>nul"):lines() do print(line) end
>

You can remove the "2>nul" as a work-around for now.

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

5 participants