From: Jeff King Date: Fri, 11 Jan 2019 15:35:42 GMT Subject: Re: Make "git log --count" work like "git rev-list" Message-ID: <20190111153541.GC16754@sigill.intra.peff.net> In-Reply-To: On Thu, Jan 10, 2019 at 02:19:51PM -0800, Junio C Hamano wrote: > > I know "--follow" is a bit hacky in general, but I think there are other > > cases where log_tree_diff() may decide not to show a commit (maybe > > without --root, though I guess that's the default these days). > > > > I dunno. Certainly respecting "--count" even for the simple cases is an > > improvement over the status quo. Maybe it would be enough to give a > > warning in the manpage that it may not work with exotic options. > > Hmph, perhaps. I wonder if it is easy enough to redirect the entire > codeflow to that of rev-list when we see --count in cmd_log(). Interesting idea. I think it might end up creating weird inconsistencies for other cases, though (e.g., log respecting config like log.showroot that rev-list does not). I suppose it depends on whether we want to advertise that "log --count" is just a convenience wrapper for "rev-list --count". Personally, that sounds hacky to me. I'd expect "log --count " to give the same answer as "log --oneline | wc -l". -Peff