Skip to content

Hang in git.Repo.clone_from() [Inter-process Communication Problem] #72

Description

@mandaarp

Task:
Clone from a remote repository having ssh://abc@domain.com/git/remote_repo format, which has submodules included from the outside of domain.com.

Problem:
current_repository = git.Repo.clone_from(r"ssh://abc@domain.com/git/remote_repo", r"d:\temp")

the remote_repo has 313 objects (files and folders). Above method call hangs after fetching 294 objects. Total size of remote_repo is 82 MB.

Observations:

  1. Command Prompt: "git clone -v ssh://abc@domain.com/git/remote_repo d:\temp" works
  2. Git Bash: "git clone -v ssh://abc@domain.com/git/remote_repo d:\temp" works
  3. Python interpreter: os.system("git clone -v ssh://abc@domain.com/git/remote_repo d:\temp") works

Possible but incomplete solution:

there is some problem with stderr=PIPE parameter of subprocess.Popen call in execute method of Python27\Lib\site-packages\GitPython-0.3.2.RC1-py2.7.egg\git\cmd.py.

If I change the code to below:

            err_file = open("d:\\err.txt","w")
    # Start the process
    proc = Popen(command,
                    cwd=cwd,
                    stdin=istream,
                    stderr=err_file,
                    #stderr=PIPE,
                    stdout=PIPE,
                    close_fds=(os.name=='posix'),# unsupported on linux
                    **subprocess_kwargs
                    )

The process does not hang.

Activity

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

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions