Re: [RFC PATCH 3/5] format-patch: extend --range-diff to accept revision range
- From
Eric Sunshine <sunshine@sunshineco.com>
- Date
- Jul 17, 2018, 10:50 UTC
- Message-ID
- <CAPig+cRXBjvgC6gmnQcYT85kGcE+Aaq1fRuQN-WqoNHQkam=aQ@mail.gmail.com>
- In-Reply-To
- <nycvar.QRO.7.76.6.1807171243410.71@tvgsbejvaqbjf.bet>
On Tue, Jul 17, 2018 at 6:45 AM Johannes Schindelin <Johannes.Schindelin@gmx.de> wrote:
Show 24 quoted lines
> On Wed, 30 May 2018, Eric Sunshine wrote:
> > + if (strstr(prev, "..")) {
> > + if (!origin)
> > + die(_("failed to infer range-diff ranges"));
> > + argv_array_push(args, prev);
> > + argv_array_pushf(args, "%s..%s",
> > + oid_to_hex(&origin->object.oid),
> > + oid_to_hex(&head->object.oid));
> > + } else {
> > + argv_array_pushf(args, "%s...%s", prev,
> > + oid_to_hex(&head->object.oid));
> > + }
>
> This would be easier to read if the order was inverted:
>
> if (!strstr(...))
> ...
> else if (!origin)
> die(...)
> else {
> ...
> }
>
> Otherwise, it makes sense to me.Thanks, I re-wrote it that way in the re-roll already.