Skip to content

git clone does not honor --progress (anymore) #158

Closed
@nalla

Description

@nalla

I think that remote-curl.c#L974 is the reason why git clone does not report progress in mintty or git-cmd anymore.

$ GIT_TRACE=1 git clone --progress https://github.com/git-for-windows/git test
17:06:07.350913 git.c:348               trace: built-in: git 'clone' '--progress' 'https://github.com/git-for-windows/git' 'test'
Cloning into 'test'...
17:06:07.361913 run-command.c:347       trace: run_command: 'git-remote-https' 'origin' 'https://github.com/git-for-windows/git'
17:06:08.009913 run-command.c:347       trace: run_command: 'fetch-pack' '--stateless-rpc' '--stdin' '--lock-pack' '--thin' '--check-self-contained-and-connected' '--cloning' '--no-progress' 'https://github.com/git-for-windows/git/'
17:06:08.016913 git.c:348               trace: built-in: git 'fetch-pack' '--stateless-rpc' '--stdin' '--lock-pack' '--thin' '--check-self-contained-and-connected' '--cloning' '--no-progress' 'https://github.com/git-for-windows/git/'
17:06:08.286913 run-command.c:347       trace: run_command: 'index-pack' '--stdin' '--fix-thin' '--keep=fetch-pack 12920 on DEV' '--check-self-contained-and-connected' '--pack_header=2,214806'
17:06:08.293913 git.c:348               trace: built-in: git 'index-pack' '--stdin' '--fix-thin' '--keep=fetch-pack 12920 on DEV' '--check-self-contained-and-connected' '--pack_header=2,214806'
Checking connectivity... 17:07:09.976913 run-command.c:347       trace: run_command: 'rev-list' '--objects' '--stdin' '--not' '--all'
17:07:09.983913 git.c:348               trace: built-in: git 'rev-list' '--objects' '--stdin' '--not' '--all'
done.
C:\git-sdk-64\usr\src>set GIT_TRACE=1
C:\git-sdk-64\usr\src>git clone --progress https://github.com/git-for-windows/git test
17:20:14.797913 git.c:348               trace: built-in: git 'clone' '--progress' 'https://github.com/git-for-windows/git' 'test'
Klone nach 'test' ...
17:20:14.810913 run-command.c:347       trace: run_command: 'git-remote-https' 'origin' 'https://github.com/git-for-windows/git'
17:20:15.480913 run-command.c:347       trace: run_command: 'fetch-pack' '--stateless-rpc' '--stdin' '--lock-pack' '--thin' '--check-self-contained-and-connected' '--cloning' '--no-progress' 'https://github.com/git-for-windows/git/'
17:20:15.494913 git.c:348               trace: built-in: git 'fetch-pack' '--stateless-rpc' '--stdin' '--lock-pack' '--thin' '--check-self-contained-and-connected' '--cloning' '--no-progress' 'https://github.com/git-for-windows/git/'
17:20:15.732913 run-command.c:347       trace: run_command: 'index-pack' '--stdin' '--fix-thin' '--keep=fetch-pack 8548 on DEV' '--check-self-contained-and-connected' '--pack_header=2,214806'
17:20:15.745913 git.c:348               trace: built-in: git 'index-pack' '--stdin' '--fix-thin' '--keep=fetch-pack 8548 on DEV' '--check-self-contained-and-connected' '--pack_header=2,214806'
Prüfe Konnektivität ... 17:21:17.848913 run-command.c:347       trace: run_command: 'rev-list' '--objects' '--stdin' '--not' '--all'
17:21:17.862913 git.c:348               trace: built-in: git 'rev-list' '--objects' '--stdin' '--not' '--all'
Fertig.

Any ideas? I'll add some debug statements and will check why options.progress = !!isatty(2); is not true. Maybe 2 (stderr) is redirected?

fprintf(stderr, "%d", isatty(2));
options.progress = !!isatty(2);

returns 64.. so that seems even stranger now.. Ok. The --no-progress flag is set by the function set_option. I added fprintf(stderr, "%s:%s\n", name, value); there..

$ ./git clone --progress https://github.com/git-for-windows/git ../test
Cloning into '../test'...
warning: templates not found C:\git-sdk-64\usr\src/share/git-core/templates
progress:false
verbosity:1
check-connectivity:true
cloning:true

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Relationships

None yet

Development

No branches or pull requests

Issue actions