All of lore.kernel.org
 help / color / mirror / Atom feed
From: Junio C Hamano <junkio@cox.net>
To: Johannes Schindelin <Johannes.Schindelin@gmx.de>
Cc: James Bowes <jbowes@dangerouslyinc.com>, git@vger.kernel.org
Subject: Re: [PATCH 2/2] Make gc a builtin.
Date: Sun, 11 Mar 2007 19:11:02 -0700	[thread overview]
Message-ID: <7vtzwrtdmx.fsf@assigned-by-dhcp.cox.net> (raw)
In-Reply-To: <Pine.LNX.4.63.0703112332550.22628@wbgn013.biozentrum.uni-wuerzburg.de> (Johannes Schindelin's message of "Sun, 11 Mar 2007 23:48:45 +0100 (CET)")

Johannes Schindelin <Johannes.Schindelin@gmx.de> writes:

> And instead of die()ing, I'd rather do something like
>
> 	return (pack_refs || run_command_v_opt(argv_pack_refs, RUN_GIT_CMD) &&
> 		run_command_v_opt(argv_reflog_expire, RUN_GIT_CMD) &&
> 		run_command_v_opt(argv_repack, RUN_GIT_CMD) &&
> 		(prune || run_command_v_opt(argv_prune, RUN_GIT_CMD) &&
> 		run_command_v_opt(argv_rerere, RUN_GIT_CMD);

Gaaaaaaaah.

That may be valid C, but please do that as a sequence of
separate statements.

	if (we are told to pack-refs)
        	if (try to pack refs and find error)
			goto failure;

	if (try to reflog expire and find error)
		goto failure;

        ...

	return Ok;

	failure:

	return Error;

  reply	other threads:[~2007-03-12  2:11 UTC|newest]

Thread overview: 15+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2007-03-11 22:06 [PATCH 0/2] Make gc a builtin James Bowes
2007-03-11 22:06 ` [PATCH 1/2] run-command: Make run_command_va_opt public and add run_command_va James Bowes
2007-03-11 22:06 ` [PATCH 2/2] Make gc a builtin James Bowes
2007-03-11 22:48   ` Johannes Schindelin
2007-03-12  2:11     ` Junio C Hamano [this message]
2007-03-12  2:51       ` [PATCH] " James Bowes
2007-03-12 14:43         ` Shawn O. Pearce
2007-03-12  3:07       ` [PATCH 2/2] " Johannes Schindelin
2007-03-12  2:57 ` [PATCH 0/2] " Theodore Tso
2007-03-12 11:23   ` Johannes Schindelin
2007-03-12 13:36     ` Theodore Tso
2007-03-12 19:14       ` Linus Torvalds
2007-03-13  0:48         ` Jakub Narebski
2007-03-13  1:20           ` Linus Torvalds
2007-03-12 14:29     ` Shawn O. Pearce

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=7vtzwrtdmx.fsf@assigned-by-dhcp.cox.net \
    --to=junkio@cox.net \
    --cc=Johannes.Schindelin@gmx.de \
    --cc=git@vger.kernel.org \
    --cc=jbowes@dangerouslyinc.com \
    /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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.