git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Junio C Hamano <gitster@pobox.com>
To: Lea Wiemann <lewiemann@gmail.com>
Cc: git@vger.kernel.org, Adam Roben <aroben@apple.com>
Subject: Re: [PATCH] cat-file --batch: flush stdout also when objects are missing
Date: Tue, 03 Jun 2008 12:40:34 -0700	[thread overview]
Message-ID: <7vve0q1f4d.fsf@gitster.siamese.dyndns.org> (raw)
In-Reply-To: 1212518057-9137-1-git-send-email-LeWiemann@gmail.com

Lea Wiemann <lewiemann@gmail.com> writes:

> cat-file --batch/--batch-check only flushes stdout when the object
> exists, but not when it doesn't ("<object> missing").  This makes
> bidirectional pipes hang.
>
> Signed-off-by: Lea Wiemann <LeWiemann@gmail.com>
> ---
>  builtin-cat-file.c |    1 +
>  1 files changed, 1 insertions(+), 0 deletions(-)
>
> diff --git a/builtin-cat-file.c b/builtin-cat-file.c
> index 200345e..f8b3160 100644
> --- a/builtin-cat-file.c
> +++ b/builtin-cat-file.c
> @@ -159,6 +159,7 @@ static int batch_one_object(const char *obj_name, int print_contents)
>  
>  	if (get_sha1(obj_name, sha1)) {
>  		printf("%s missing\n", obj_name);
> +		fflush(stdout);
>  		return 0;
>  	}
>  
> -- 
> 1.5.6.rc0.92.g27fd.dirty

Ah, good catch.

Thanks.

      reply	other threads:[~2008-06-03 19:41 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-06-03 18:34 [PATCH] cat-file --batch: flush stdout also when objects are missing Lea Wiemann
2008-06-03 19:40 ` Junio C Hamano [this message]

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=7vve0q1f4d.fsf@gitster.siamese.dyndns.org \
    --to=gitster@pobox.com \
    --cc=aroben@apple.com \
    --cc=git@vger.kernel.org \
    --cc=lewiemann@gmail.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 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).