# Pull and fetch don't honor `--progress` flag

3 messages from 2013-10-16 to 2013-10-16. Participants: Jacobs, Todd, John Keeping.
Thread: https://gitlist.dev/t/35153

## Jacobs, Todd, 2013-10-16 19:50

Subject: Pull and fetch don't honor `--progress` flag
Message-ID: <48AC4CE6F0887542B2A5E28E4E7A929740FA5349A9@Viper-RSG.pc.cognex.com>
URL: https://gitlist.dev/e/48AC4CE6F0887542B2A5E28E4E7A929740FA5349A9%40Viper-RSG.pc.cognex.com

```
When I use the `--progress` flag with the push command, I get transfer-speed statistics like this:

    $ git push -progress origin master 2>&1 | tee /tmp/push
    Counting objects: 30, done.
    Compressing objects: 100% (20/20), done.
    Writing objects: 100% (30/30), 9.02 MiB | 206.00 KiB/s, done.
    Total 30 (delta 0), reused 0 (delta 0)

This also works similarly with clone:

    $ git clone --progress "$url" foo.git 2>&1 | tee /tmp/clone
    Cloning into 'foo.git'...
    remote: Counting objects: 61, done.
    remote: Compressing objects: 100% (43/43), done.
    remote: Total 61 (delta 3), reused 0 (delta 0)
    Receiving objects: 100% (61/61), 15.22 MiB | 473.00 KiB/s, done.
    Resolving deltas: 100% (3/3), done.
    Checking connectivity... done

However, even though pull and fetch also have the same flag documented, git never reports any network statistics at all. For example:

    $ git pull --progress origin master 2>&1 | tee /tmp/pull
    remote: Counting objects: 5, done.
    remote: Compressing objects: 100% (3/3), done.
    remote: Total 3 (delta 1), reused 0 (delta 0)

This is repeatable with both Git 1.7.9 and Git 1.8.4.1 running under Cygwin. Is this a bug? If not, how can I make fetch and pull cough up throughput statistics?

```

## John Keeping, 2013-10-16 20:12

Subject: Re: Pull and fetch don't honor `--progress` flag
Message-ID: <20131016201210.GR27238@serenity.lan>
URL: https://gitlist.dev/e/20131016201210.GR27238%40serenity.lan
In-Reply-To: <48AC4CE6F0887542B2A5E28E4E7A929740FA5349A9@Viper-RSG.pc.cognex.com>

```
On Wed, Oct 16, 2013 at 03:50:51PM -0400, Jacobs, Todd wrote:
> When I use the `--progress` flag with the push command, I get transfer-speed statistics like this:
> 
>     $ git push -progress origin master 2>&1 | tee /tmp/push
>     Counting objects: 30, done.
>     Compressing objects: 100% (20/20), done.
>     Writing objects: 100% (30/30), 9.02 MiB | 206.00 KiB/s, done.
>     Total 30 (delta 0), reused 0 (delta 0)
> 
> This also works similarly with clone:
> 
>     $ git clone --progress "$url" foo.git 2>&1 | tee /tmp/clone
>     Cloning into 'foo.git'...
>     remote: Counting objects: 61, done.
>     remote: Compressing objects: 100% (43/43), done.
>     remote: Total 61 (delta 3), reused 0 (delta 0)
>     Receiving objects: 100% (61/61), 15.22 MiB | 473.00 KiB/s, done.
>     Resolving deltas: 100% (3/3), done.
>     Checking connectivity... done
> 
> However, even though pull and fetch also have the same flag documented, git never reports any network statistics at all. For example:
> 
>     $ git pull --progress origin master 2>&1 | tee /tmp/pull
>     remote: Counting objects: 5, done.
>     remote: Compressing objects: 100% (3/3), done.
>     remote: Total 3 (delta 1), reused 0 (delta 0)
> 
> This is repeatable with both Git 1.7.9 and Git 1.8.4.1 running under Cygwin. Is this a bug? If not, how can I make fetch and pull cough up throughput statistics?

Does it make a difference how you invoke "git fetch"?  From a quick look
at the code, "git fetch" with no remote or refspec should display
progress data, but if you specify "--all" or a remote and refspec then
it won't.

The following patch (untested) will fix it if that is the case:

-- >8 --
diff --git a/builtin/fetch.c b/builtin/fetch.c
index bd7a101..487381e 100644
--- a/builtin/fetch.c
+++ b/builtin/fetch.c
@@ -952,6 +952,10 @@ static void add_options_to_argv(struct argv_array *argv)
 		argv_array_push(argv, "-v");
 	else if (verbosity < 0)
 		argv_array_push(argv, "-q");
+	if (progress > 0)
+		argv_array_push(argv, "--progress");
+	else if (progress == 0)
+		argv_array_push(argv, "--no-progress");
 
 }
 

```

## Jacobs, Todd, 2013-10-16 21:27

Subject: RE: Pull and fetch don't honor `--progress` flag
Message-ID: <48AC4CE6F0887542B2A5E28E4E7A929740FA5349B8@Viper-RSG.pc.cognex.com>
URL: https://gitlist.dev/e/48AC4CE6F0887542B2A5E28E4E7A929740FA5349B8%40Viper-RSG.pc.cognex.com
In-Reply-To: <20131016201210.GR27238@serenity.lan>

```
> Does it make a difference how you invoke "git fetch"?  From a quick look at
> the code, "git fetch" with no remote or refspec should display progress data,
> but if you specify "--all" or a remote and refspec then it won't.

Thanks for your prompt response.  However, it doesn't make any
difference.  The behavior remains the same even without specifying
a refspec.  For example:

    $ git pull
    remote: Counting objects: 5, done.
    remote: Compressing objects: 100% (3/3), done.
    remote: Total 3 (delta 1), reused 0 (delta 0)
    Unpacking objects: 100% (3/3), done.

    $ git fetch
    remote: Counting objects: 5, done.
    remote: Compressing objects: 100% (3/3), done.
    remote: Total 3 (delta 1), reused 0 (delta 0)
    Unpacking objects: 100% (3/3), done. 

```
