git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Johannes Schindelin <Johannes.Schindelin@gmx.de>
To: Junio C Hamano <gitster@pobox.com>
Cc: Jeff Hostetler <git@jeffhostetler.com>,
	git@vger.kernel.org, Jeff Hostetler <jeffhost@microsoft.com>
Subject: Re: [PATCH v5 4/9] status: collect per-file data for --porcelain=v2
Date: Sun, 7 Aug 2016 10:34:13 +0200 (CEST)	[thread overview]
Message-ID: <alpine.DEB.2.20.1608071026120.5786@virtualbox> (raw)
In-Reply-To: <xmqqbn16vnlf.fsf@gitster.mtv.corp.google.com>

Hi Junio,

On Fri, 5 Aug 2016, Junio C Hamano wrote:

> Jeff Hostetler <git@jeffhostetler.com> writes:
> 
> >  		if (ce_stage(ce)) {
> >  			d->index_status = DIFF_STATUS_UNMERGED;
> >  			d->stagemask |= (1 << (ce_stage(ce) - 1));
> > +			/*
> > +			 * Don't bother setting {mode,oid}_{head,index} since the print
> > +			 * code will output the stage values directly and not use the
> > +			 * values in these fields.
> > +			 */
> >  		}
> > -		else
> > +		else {
> >  			d->index_status = DIFF_STATUS_ADDED;
> > +			/* Leave {mode,oid}_head zero for adds. */
> > +			d->mode_index = ce->ce_mode;
> > +			hashcpy(d->oid_index.hash, ce->sha1);
> > +		}
> 
> Not a big deal (no need to resend for this one alone), but let's
> make the above properly formatted, i.e.
> 
> 		if (ce_stage(ce)) {
>                 	...
> 		} else {
>                 	...
> 		}                        

Do I understand correctly that your objections is against having the curly
brace before the "else" on its own line?

If so, when did our coding style change? I vividly remember that we
strongly favored putting the "else" on a new line after a closing brace,
to make diffs nicer in case the braces were removed or added.

BTW your suggestion has 24 extra spaces after the final closing brace ;-)

Ciao,
Dscho

  reply	other threads:[~2016-08-07  8:34 UTC|newest]

Thread overview: 19+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-08-05 22:00 [PATCH v5 0/9] status: V2 porcelain status Jeff Hostetler
2016-08-05 22:00 ` [PATCH v5 1/9] status: rename long-format print routines Jeff Hostetler
2016-08-05 22:00 ` [PATCH v5 2/9] status: cleanup API to wt_status_print Jeff Hostetler
2016-08-05 22:00 ` [PATCH v5 3/9] status: support --porcelain[=<version>] Jeff Hostetler
2016-08-05 22:00 ` [PATCH v5 4/9] status: collect per-file data for --porcelain=v2 Jeff Hostetler
2016-08-05 22:48   ` Junio C Hamano
2016-08-07  8:34     ` Johannes Schindelin [this message]
2016-08-07 22:29       ` Eric Wong
2016-08-08  1:57         ` Junio C Hamano
2016-08-05 22:00 ` [PATCH v5 5/9] status: print per-file porcelain v2 status data Jeff Hostetler
2016-08-05 22:51   ` Junio C Hamano
2016-08-05 22:00 ` [PATCH v5 6/9] status: print branch info with --porcelain=v2 --branch Jeff Hostetler
2016-08-05 22:00 ` [PATCH v5 7/9] git-status.txt: describe --porcelain=v2 format Jeff Hostetler
2016-08-05 22:00 ` [PATCH v5 8/9] test-lib-functions.sh: Add lf_to_nul Jeff Hostetler
2016-08-05 22:00 ` [PATCH v5 9/9] status: unit tests for --porcelain=v2 Jeff Hostetler
2016-08-08 17:07   ` Junio C Hamano
2016-08-10 21:28     ` Jeff Hostetler
2016-08-10 22:41       ` Junio C Hamano
2016-08-10 23:23         ` Jeff Hostetler

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=alpine.DEB.2.20.1608071026120.5786@virtualbox \
    --to=johannes.schindelin@gmx.de \
    --cc=git@jeffhostetler.com \
    --cc=git@vger.kernel.org \
    --cc=gitster@pobox.com \
    --cc=jeffhost@microsoft.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).