Skip to content

remote.pull prints Already up-to-date. #437

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

Closed
barry-scott opened this issue May 20, 2016 · 2 comments
Closed

remote.pull prints Already up-to-date. #437

barry-scott opened this issue May 20, 2016 · 2 comments
Assignees

Comments

@barry-scott
Copy link
Contributor

barry-scott commented May 20, 2016

The command print "Already up-to-date" to the console.

It seems that problem is the use of with_stdout=False that then does not both to do anything to stdout.

git-python-with-stdout.txt

The attached patch seems to fix the problem by setting stdout to DEVNULL. Tested on python 3.4.

@Byron Byron self-assigned this May 24, 2016
@Byron
Copy link
Member

Byron commented May 24, 2016

I believe it's the default and expected behaviour to use the parent-process file handles in subprocesses. Thus stdin and stdout will be cloned from the terminal in some cases.

However, the way the parameter is documented indicates the intention was different: If True, default True, we open stdout on the created process, and I guess otherwise you don't show anything.

Unfortunately DEVNULL is only available in python >=3.3, and the alternative, popen(stdout=open(os.devnull, 'wb'), ...) leaves me puzzled about who is going to close the opened file-handle.

Do you have any information on this ? Opening a stderr permanently and reusing the file-handle would be easy enough, but at least I'd like to know what this means for resource handling.

In the meanwhile, I will test it a little more.

@Byron
Copy link
Member

Byron commented May 24, 2016

Great, it looks like Popen takes care of the details automatically for you, and closes the freshly opened file-handle (or transfers it to the subprocess, who knows).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Development

No branches or pull requests

2 participants