All of lore.kernel.org
 help / color / mirror / Atom feed
From: "Randall S. Becker" <rsbecker@nexbridge.com>
To: "'Junio C Hamano'" <gitster@pobox.com>
Cc: "'Đoàn Trần Công Danh'" <congdanhqx@gmail.com>, git@vger.kernel.org
Subject: RE: [Patch v1 1/3] bugreport.c: replace strbuf_write_fd with write_in_full
Date: Fri, 19 Jun 2020 15:37:27 -0400	[thread overview]
Message-ID: <02c201d64671$13c9a840$3b5cf8c0$@nexbridge.com> (raw)
In-Reply-To: <xmqqimfmhmzs.fsf@gitster.c.googlers.com>

On June 19, 2020 3:31 PM, Junio C Hamano wrote:
> To: Randall S. Becker <rsbecker@nexbridge.com>
> Cc: 'Đoàn Trần Công Danh' <congdanhqx@gmail.com>;
> randall.s.becker@rogers.com; git@vger.kernel.org
> Subject: Re: [Patch v1 1/3] bugreport.c: replace strbuf_write_fd with
> write_in_full
> 
> "Randall S. Becker" <rsbecker@nexbridge.com> writes:
> 
> >> > +	if (write_in_full(report, buffer.buf, buffer.len) < 0) {
> >> > +		die(_("couldn't write report contents '%s' to file '%s'"),
> >> > +			buffer.buf, report_path.buf);
> >>
> >> Doesn't this dump the whole report to the stderr?
> >> If it's the case, the error would be very hard to grasp.
> >
> > Where else can we put the error? By this point, we're likely out of disk or
> virtual memory.
> >
> >> Nit: We wouldn't want the pair of {}.
> >>
> >> > +	}
> >> >  	close(report);
> >
> > I'm not sure what you mean in this nit? {} are balanced. You mean in the
> error message?
> 
> I think he means that a block that consists of a single statement (i.e. call to
> die()) does not have to be enclosed in {}.
> 
> (partial quote from Documentation/CodingGuidelines):
> 
>  - We avoid using braces unnecessarily.  I.e.
> 
> 	if (bla) {
> 		x = 1;
> 	}
> 
>    is frowned upon. But there are a few exceptions:

I get that. I was trying to maintain visual consistency with the rest of bugreport.c. Will redo it.


  reply	other threads:[~2020-06-19 19:37 UTC|newest]

Thread overview: 15+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <20200619150445.4380-1-randall.s.becker.ref@rogers.com>
2020-06-19 15:04 ` [Patch v1 0/3] Replace strbuf_write_fd with write_in_full randall.s.becker
2020-06-19 15:04   ` [Patch v1 1/3] bugreport.c: replace " randall.s.becker
2020-06-19 16:35     ` Đoàn Trần Công Danh
2020-06-19 17:17       ` Randall S. Becker
2020-06-19 19:30         ` Junio C Hamano
2020-06-19 19:37           ` Randall S. Becker [this message]
2020-06-19 23:01         ` Đoàn Trần Công Danh
2020-06-19 23:26           ` Randall S. Becker
2020-06-19 19:47     ` Jeff King
2020-06-19 15:04   ` [Patch v1 2/3] strbuf.c: remove unreferenced strbuf_write_fd method randall.s.becker
2020-06-19 19:30     ` Junio C Hamano
2020-06-19 19:49     ` Jeff King
2020-06-19 15:04   ` [Patch v1 3/3] strbuf.h: remove declaration of deprecated " randall.s.becker
2020-06-19 19:31     ` Junio C Hamano
2020-06-19 19:34       ` Randall S. Becker

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='02c201d64671$13c9a840$3b5cf8c0$@nexbridge.com' \
    --to=rsbecker@nexbridge.com \
    --cc=congdanhqx@gmail.com \
    --cc=git@vger.kernel.org \
    --cc=gitster@pobox.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.