GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — repo, cmd: DROP UNEEDED Win path for chcwd & check for '~' homedir by ankostis · Pull Request #529 · gitpython-developers/GitPython

Conversation

@ankostis

@ankostis ankostis commented Oct 11, 2016

Copy link
Copy Markdown
Contributor
  • Do not abspath twice when constructing cloned repo.
  • Add git.repo.base logger.

According to the TCs, the changes in this PR are OK.
@Byron is there any reason for not deleting this Window-only code-path about changing-cwd?

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
@ankostis
repo, cmd: DROP UNEEDED Win path for chcwd & check for '~' homedir
cc6529c
+ Do not abspath twice when contructing cloned repo.
+ Add `git.repo.base` logger.
@Byron Byron added the in progress label Oct 11, 2016
@codecov-io

codecov-io commented Oct 11, 2016 •
edited
Loading

Uh oh!

There was an error while loading. Please reload this page.

Copy link
Copy Markdown

Current coverage is 93.97% (diff: 91.66%)

Merging #529 into master will increase coverage by 0.13%

@@             master       #529   diff @@
==========================================
  Files            63         63          
  Lines          9628       9612    -16   
  Methods           0          0          
  Messages          0          0          
  Branches          0          0          
==========================================
- Hits           9035       9033     -2   
+ Misses          593        579    -14   
  Partials          0          0          

Powered by Codecov. Last update 4b84602...cc6529c

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@ankostis

ankostis commented Oct 15, 2016

Copy link
Copy Markdown
Contributor Author

Has already been merged in 8ea7e26 with #530.

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@ankostis ankostis closed this Oct 15, 2016
@Byron Byron removed the in progress label Oct 15, 2016
@ankostis ankostis added this to the v2.1.0 - proper windows support milestone Oct 15, 2016
@ankostis ankostis self-assigned this Oct 15, 2016
@ankostis ankostis added the tag.Windows label Oct 15, 2016
Byron
Byron reviewed Oct 16, 2016
View reviewed changes
Comment thread git/repo/base.py
if progress:
handle_process_output(proc, None, progress.new_message_handler(), finalize_process)
else:
(stdout, stderr) = proc.communicate() # FIXME: Will block of outputs are big!

@Byron Byron Oct 16, 2016

Copy link
Copy Markdown
Member

There was a problem hiding this comment.

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It's quite amazing that communicate() actually cannot be trusted or is simply not implemented correctly :/.

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions

@ankostis ankostis Oct 16, 2016

Copy link
Copy Markdown
Contributor Author

There was a problem hiding this comment.

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Well, you are quite right - communicate() CAN be trusted.

I did a small experiment of reading a Gbyte, both in PY27 and PY35, and they do not block:

>>> import subprocess as sb
>>> proc=sb.Popen('dd if=/dev/zero bs=1024 count=1000000', bufsize=0, stdin=sb.PIPE, stdout=sb.PIPE, stderr=sb.PIPE)
>>> a,b=proc.communicate()

I don't remember when I got this mistrust for communicate(), maybe when I had tried PY33, or maybe when epxerimenting with interactive processes (like the git.cmd.Git.cat-file persistent command); there the comminicate() is not suitable because it will start consuming streams till the death of the process, but the process is awaiting for more input from python-side before ending, so it's a deadlock.

One or two changes in my windows fixes were under this wrong assumption that communicate() should not be trusted. But mostly I replaced code accessing directly proc.stderr/stdout from the main thread - this is definitely freeze-prone code.

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions

@Byron Byron Oct 16, 2016

Copy link
Copy Markdown
Member

There was a problem hiding this comment.

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

A nice experiment ! It doesn't seem to output both on stdout and stderr though, which might be causing the problem we see. The implementation of communicate looks asynchronous, but who knows what's hidden in the details.

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions

@ankostis ankostis Oct 16, 2016

Copy link
Copy Markdown
Contributor Author

There was a problem hiding this comment.

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Even when stdout/stderr is interplexed, communicate() does not block (at least in PY3):

>>> import subprocess as sb
>>> proc = sb.Popen(['python','-c',"import sys\nfor i in range(1000000):\n    print('a'*1024); print('b'*1024, file=sys.stderr)"], stdin=sb.PIPE, stdout=sb.PIPE, stderr=sb.PIPE)
>>> %time a,b=proc.communicate()
Wall time: 48.3 s
>>> len(a), len(b)
(1026000000, 1026000000)

For some "unicode" reason cannot run the above experiment in PY2.

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
@Byron

Byron commented Oct 16, 2016

Copy link
Copy Markdown
Member

@ankostis This looks like a massive simplification, which in any case is a good thing. Given that Appveyor will alert us of breakage, I think it is fine to go ahead with it.

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@ankostis ankostis mentioned this pull request Oct 16, 2016
Test project on Windows with MINGW git (conda2.7&3.4/cpy-3.5) #519
Merged
@ankostis ankostis mentioned this pull request Oct 31, 2016
git clone hangs sometimes #547
Closed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Reviewers

@Byron Byron Byron left review comments

Uh oh!

There was an error while loading. Please reload this page.

Assignees

@ankostis ankostis

Labels

tag.Windows

Milestone

v2.1.0 - better windows support

Development

Successfully merging this pull request may close these issues.

Uh oh!

There was an error while loading. Please reload this page.

3 participants

@ankostis @codecov-io @Byron
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
You are visitor 01402503 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.