Re: [PATCH 3/5] Make verbosity configurable in reset_index_file()

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

 



On Sat, 2008-05-24 at 02:01 +0200, Miklos Vajna wrote:
> Till now reset_index_file() was always verbose. Add a new argument to be
> able to disable this behaviour.
> 
> Signed-off-by: Miklos Vajna <vmiklos@xxxxxxxxxxxxxx>
> ---
>  builtin-reset.c |    2 +-
>  reset.c         |    5 +++--
>  reset.h         |    2 +-
>  3 files changed, 5 insertions(+), 4 deletions(-)
> 
> diff --git a/builtin-reset.c b/builtin-reset.c
> index 6e6e168..179c59c 100644
> --- a/builtin-reset.c
> +++ b/builtin-reset.c
> @@ -216,7 +216,7 @@ int cmd_reset(int argc, const char **argv, const char *prefix)
>  		if (is_merge() || read_cache() < 0 || unmerged_cache())
>  			die("Cannot do a soft reset in the middle of a merge.");
>  	}
> -	else if (reset_index_file(sha1, (reset_type == HARD)))
> +	else if (reset_index_file(sha1, (reset_type == HARD), 1))
>  		die("Could not reset index file to revision '%s'.", rev);
>  
>  	/* Any resets update HEAD to the head being switched to,
> diff --git a/reset.c b/reset.c
> index a75fec6..baae947 100644
> --- a/reset.c
> +++ b/reset.c
> @@ -11,13 +11,14 @@
>  #include "cache.h"
>  #include "run-command.h"
>  
> -int reset_index_file(const unsigned char *sha1, int is_hard_reset)
> +int reset_index_file(const unsigned char *sha1, int is_hard_reset, int verbose)

I would suggest using flags here instead of a bunch of boolean args.
Consider the readability of

    reset_index_file(sha1, 1, 1);

vs

    reset_index_file(sha1, RESET_HARD | RESET_VERBOSE);

cheers,
Kristian

--
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]

  Powered by Linux