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

Fix git branch name never shown as dirty #974

Merged
merged 1 commit into from Jun 2, 2016

Conversation

jankatins
Copy link
Contributor

@jankatins jankatins commented Jun 2, 2016

The problem was that io.popen() returns a file handle and not the return code of the
called program. The problem was introduced by 567889e.

The new code was inspired by
http://stackoverflow.com/a/14031974/1380673

Closes: #971
Closes: #928

The problem was that io.popen() returns a file and not the return code of the
called program.

The new code was inspired by
http://stackoverflow.com/a/14031974/1380673
@jankatins
Copy link
Contributor Author

jankatins commented Jun 2, 2016

A different way would be to use the hg way (read lines and see if there are any) with git status -s -uno.

@sveggiani
Copy link

Hi @JanSchulz.
I've done some test and this works. However, if I run the git diff --quiet --ignore-submodules HEAD 2 commnad with git version 2.7.4.windows.1 the output is always:

"fatal: ambiguous argument '2': unknown revision or path not in the working tree.
Use '--' to separate paths from revisions, like this:
'git <command> [<revision>...] -- [<file>...]'"

I'm a little curious about why it works. Do you know why?

Thanks!

@jankatins
Copy link
Contributor Author

@sveggiani the 2 is not part of the git command, but part of the redirection: in this case it means that the file handle 2 (stderr, which gets the error output) should be redirected to the special file NUL (aka "into nowhere"). In effect this means that error output should be hidden.

See here fore more info: https://www.microsoft.com/resources/documentation/windows/xp/all/proddocs/en-us/redirection.mspx?mfr=true

@sveggiani
Copy link

@JanSchulz ohh, I see. Thank you very much ;)

@Stanzilla Stanzilla merged commit 346680b into cmderdev:development Jun 2, 2016
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 this pull request may close these issues.

None yet

3 participants