Re: [PATCH] add --progress to git-gc and git-repack

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Tue, Sep 27, 2011 at 10:32:45PM +0200, Oleg Andreev wrote:

> From 1f261e13e72770deabd77087e354f304be850efc Mon Sep 17 00:00:00 2001
> From: Oleg Andreev <oleganza@xxxxxxxxx>
> Date: Tue, 27 Sep 2011 08:24:25 +0200
> Subject: [PATCH 1/2] git-repack: pass --progress down to git-pack-objects

Please follow Documentation/SubmittingPatches.  This should be part of
the actual email headers. And there should be one patch per email.

My first thought was "doesn't git-repack already show progress?".
There's no motivation in the commit message, so I have to guess why you
want this. I assume you want to override the isatty(2) decision that
pack-objects uses?

> diff --git a/git-repack.sh b/git-repack.sh
> index 624feec..b86d60e 100755
> --- a/git-repack.sh
> +++ b/git-repack.sh
> [...]
> @@ -35,6 +36,7 @@ do
>  		unpack_unreachable=--unpack-unreachable ;;
>  	-d)	remove_redundant=t ;;
>  	-q)	GIT_QUIET=t ;;
> +	--progress) progress=--progress ;;
>  	-f)	no_reuse=--no-reuse-delta ;;
>  	-F)	no_reuse=--no-reuse-object ;;
>  	-l)	local=--local ;;

Should this also handle --no-progress? Maybe it is not a big deal, as
"-q" will also suppress progress, but it would be consistent with other
git commands that take --progress.

> diff --git a/Documentation/git-gc.txt b/Documentation/git-gc.txt
> index 815afcb..b65fa3e 100644
> --- a/Documentation/git-gc.txt
> +++ b/Documentation/git-gc.txt
> [...]
>  --quiet::
> -	Suppress all progress reports.
> +	Suppress all progress reports. Progress is not reported to
> +	the standard error stream.

This just seems redundant to me.

> +--progress::
> +	Progress status is reported on the standard error stream
> +	by default when it is attached to a terminal, unless -q
> +	is specified. This flag forces progress status even if the
> +	standard error stream is not directed to a terminal.

Though this is a nice description.

> --- a/builtin/gc.c
> +++ b/builtin/gc.c
>  	struct option builtin_gc_options[] = {
>  		OPT__QUIET(&quiet, "suppress progress reporting"),
> +		OPT_BOOLEAN(0, "progress", &progress, "force progress reporting"),

This will handle --no-progress for us automatically, which is good.

> diff --git a/contrib/examples/git-gc.sh b/contrib/examples/git-gc.sh
> index 1597e9f..52ea808 100755
> --- a/contrib/examples/git-gc.sh
> +++ b/contrib/examples/git-gc.sh
> [...]
>  while test $# != 0
>  do
>  	case "$1" in
>  	--prune)
>  		no_prune=
>  		;;
> +	--progress)
> +		progress=--progress
> +		;;

This won't, but I think this whole hunk is unnecessary. The files in
contrib/examples are kept around for people to see how git commands can
be composed of plumbing building blocks. But they don't need to gain new
features as their C counterparts do. I think we can just leave them
frozen in time as of when each script was rewritten in C.

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


[Index of Archives]     [Linux Kernel Development]     [Gcc Help]     [IETF Annouce]     [DCCP]     [Netdev]     [Networking]     [Security]     [V4L]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux SCSI]     [Fedora Users]