In-place progress output in the terminal or console

后端 未结 5 426
我寻月下人不归
我寻月下人不归 2020-12-13 09:39

When you run git clone, it updates progress in place. For example, the percentage of the objects received changes in place.

user@athena:~/cloj/s         


        
5条回答
  •  时光说笑
    2020-12-13 09:54

    git/progress.c

    ...
            eol = done ? done : "   \r";
    ...
                    fprintf(stderr, "...%s", ..., eol);
                    fflush(stderr);
    

    Git simply emits a carriage return and no line feed, which the terminal interprets as "move to first column".

提交回复
热议问题