git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: "Kristian Høgsberg" <krh@redhat.com>
To: Miklos Vajna <vmiklos@frugalware.org>
Cc: git@vger.kernel.org
Subject: Re: [PATCH 3/5] Make verbosity configurable in reset_index_file()
Date: Tue, 27 May 2008 10:08:01 -0400	[thread overview]
Message-ID: <1211897281.13838.1.camel@gaara.bos.redhat.com> (raw)
In-Reply-To: <dace39a3a72957bec9a7f4b8528b08fc7fbe3341.1211586801.git.vmiklos@frugalware.org>

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@frugalware.org>
> ---
>  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

  parent reply	other threads:[~2008-05-27 14:09 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-05-24  0:01 [WIP PATCH 0/5] Build in merge Miklos Vajna
2008-05-24  0:01 ` [PATCH 1/5] Move reset_index_file() to a new reset.c Miklos Vajna
2008-05-24  0:01   ` [PATCH 2/5] Move split_cmdline() to libgit Miklos Vajna
2008-05-24  0:01     ` [PATCH 3/5] Make verbosity configurable in reset_index_file() Miklos Vajna
2008-05-24  0:01       ` [PATCH 4/5] Move commit_list_count() to commit.c Miklos Vajna
2008-05-24  0:01         ` [PATCH 5/5] Build in merge Miklos Vajna
2008-05-27 14:08       ` Kristian Høgsberg [this message]
2008-05-27 14:49         ` [PATCH 3/5] Make verbosity configurable in reset_index_file() Miklos Vajna
2008-05-24  4:21   ` [PATCH 1/5] Move reset_index_file() to a new reset.c Daniel Barkalow
2008-05-24 21:55     ` Miklos Vajna

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1211897281.13838.1.camel@gaara.bos.redhat.com \
    --to=krh@redhat.com \
    --cc=git@vger.kernel.org \
    --cc=vmiklos@frugalware.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).