git/list[1] front-page[2] threads[3] people[4] search[5] about
 

Re: [BUG] Halt during fetch on MacOS

From
Jeff King <peff@peff.net>
Date
Mar 1, 2014, 06:15 UTC
Message-ID
<20140301061532.GC20397@sigill.intra.peff.net>
In-Reply-To
<CAFFUb6X455R4OD5FKnVFHFmvTyRqtV300bc=a8Xs03agM+=uLQ@mail.gmail.com>
On Fri, Feb 28, 2014 at 03:26:28PM -0800, Conley Owens wrote:
Show 11 quoted lines
> 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.

Show 7 quoted lines
> 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?

Show 12 quoted lines
> 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 \
    https://android.googlesource.com/platform/external/tinyxml2

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.

-Peff
Previous: Conley OwensNext: Kyle J. McKay
Message 2 of 11 in “[BUG] Halt during fetch on MacOS”
  1. Conley OwensFeb 28, 2014
  2. Jeff KingMar 1, 2014
  3. Kyle J. McKayMar 2, 2014
  4. Jacopo NotarstefanoMar 4, 2014
  5. Conley OwensMar 4, 2014
  6. Max HornMar 2, 2014
  7. Conley OwensMar 3, 2014
  8. Conley OwensMar 5, 2014
  9. Junio C HamanoMar 6, 2014
  10. Jeff KingMar 6, 2014
  11. Conley OwensMar 6, 2014

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.