On Fri, Feb 28, 2014 at 03:26:28PM -0800, Conley Owens wrote:

> test.sh
> """""""""""""""""""""""""""""""""""""
> #!/bin/bash
> rungit() {
>     mkdir $1
>     GIT_DIR=$1 git init --bare
>     echo '[remote "aosp"]' > $1/config
>     echo '    url =
> https://android.googlesource.com/platform/external/tinyxml2' >>
> $1/config
>     GIT_DIR=$1 git fetch aosp +refs/heads/master:refs/remotes/aosp/master

I don't think this is affecting your test, but you probably want ">>" to
append to the config for the first line, too. Otherwise you are
overwriting some of git's default settings.

> When everything cools, you can see that there are some fetches hanging
> (typically).
> $ ps | grep 'git fetch'
> ...
> 63310 ttys004    0:00.01 git fetch aosp
> +refs/heads/master:refs/remotes/aosp/master
> [...]

I can't reproduce here on Linux. Can you find out what the processes are
doing with something like strace?

> You can look at the parent process of each and see that one half
> spawned the other half, or you can look at the environment variables
> for each to see that there are two processes operating in the same
> directory for each directory where there's an issue.
> $ echo "$(for pid in $(ps | grep 'git fetch' | grep -o '^[0-9]*'); do
> ps -p $pid -wwwE | grep 'GIT_DIR=[^ ]*' -o; done)" | sort
> GIT_DIR=testdir14
> GIT_DIR=testdir14
> GIT_DIR=testdir32
> GIT_DIR=testdir32
> GIT_DIR=testdir47
> GIT_DIR=testdir47

A fetch will start many sub-processes. Try:

  GIT_TRACE=1 git fetch \

which shows git-fetch starting the git-remote-https helper, which in
turn starts git-fetch-pack to do the actual protocol, which uses
git-unpack-objects to manage the incoming pack.

To unsubscribe from this list: send the line "unsubscribe git" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Reply via email to