Re: [PATCH v2 06/15] rev-list: make --count work with --objects
- From
Jeff King <peff@peff.net>
- Date
- Feb 15, 2020, 06:48 UTC
- Message-ID
- <20200215064818.GB1633703@coredump.intra.peff.net>
- In-Reply-To
- <20200215004216.GA15192@syl.local>
On Fri, Feb 14, 2020 at 04:42:16PM -0800, Taylor Blau wrote:
Show 16 quoted lines
> On Fri, Feb 14, 2020 at 01:22:20PM -0500, Jeff King wrote: > > The current behavior from "rev-list --count --objects" is nonsensical: > > we enumerate all of the objects except commits, but then give a count of > > commits. This wasn't planned, and is just what the code happens to do. > > > > Instead, let's give the answer the user almost certainly wanted: the > > full count of objects. > > This makes sense: I've often worried about introducing > backwards-incompatible changes in newer versions of Git, even for > behavior that didn't make sense to begin with. > > Of course, backwards-incompatible changes *are* something worth worrying > about, but I don't find that the behavior was sensible to begin with, so > I don't have a problem "breaking" it if "breaking" means making > something nonsensical behave correctly.
Yeah, I admit I'm guessing that nobody cares about the current behavior, or that it was unplanned. But it seems sufficiently insane to me to take a chance on.
Show 8 quoted lines
> > + if (revs->count) {
> > + revs->count_right++;
> > + return;
> > + }
> > +
>
> Hmm. This puzzled me at first. Do you think that it could benefit from a
> comment?What would it say (i.e., I'm not sure what confused you)?
-Peff