From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on dcvr.yhbt.net X-Spam-Level: X-Spam-ASN: AS31976 209.132.180.0/23 X-Spam-Status: No, score=-3.6 required=3.0 tests=AWL,BAYES_00, HEADER_FROM_DIFFERENT_DOMAINS,RCVD_IN_DNSWL_HI,RP_MATCHES_RCVD shortcircuit=no autolearn=ham autolearn_force=no version=3.4.0 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by dcvr.yhbt.net (Postfix) with ESMTP id A85BA202A4 for ; Fri, 8 Sep 2017 07:49:15 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754358AbdIHHtN (ORCPT ); Fri, 8 Sep 2017 03:49:13 -0400 Received: from cloud.peff.net ([104.130.231.41]:60642 "HELO cloud.peff.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with SMTP id S1753608AbdIHHtN (ORCPT ); Fri, 8 Sep 2017 03:49:13 -0400 Received: (qmail 24091 invoked by uid 109); 8 Sep 2017 07:49:12 -0000 Received: from Unknown (HELO peff.net) (10.0.1.2) by cloud.peff.net (qpsmtpd/0.94) with SMTP; Fri, 08 Sep 2017 07:49:12 +0000 Authentication-Results: cloud.peff.net; auth=none Received: (qmail 6593 invoked by uid 111); 8 Sep 2017 07:49:46 -0000 Received: from sigill.intra.peff.net (HELO sigill.intra.peff.net) (10.0.0.7) by peff.net (qpsmtpd/0.94) with SMTP; Fri, 08 Sep 2017 03:49:46 -0400 Authentication-Results: peff.net; auth=none Received: by sigill.intra.peff.net (sSMTP sendmail emulation); Fri, 08 Sep 2017 03:49:10 -0400 Date: Fri, 8 Sep 2017 03:49:10 -0400 From: Jeff King To: Junio C Hamano Cc: Stefan Beller , =?utf-8?B?0JLQsNC70LXQvdGC0LjQvQ==?= , "git@vger.kernel.org" Subject: Re: "git shortlog -sn --follow -- " counts all commits to entire repo Message-ID: <20170908074910.reoyb47navgsg6kt@sigill.intra.peff.net> References: <20170908051015.ybq4egdrddecl4se@sigill.intra.peff.net> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline In-Reply-To: Sender: git-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: git@vger.kernel.org On Fri, Sep 08, 2017 at 03:38:17PM +0900, Junio C Hamano wrote: > > I suspect a better solution might involve actually building on > > log-tree.c to do the traversal (since this internal traversal is > > supposed to be equivalent to "git log | git shortlog"). > > Probably. That approach would also have an added benefit that when > "--follow" is fixed to keep track of which path it is following per > traversal for "git log", the result from "git shortlog --follow" > would automatically become correct, I guess? Yeah. It depends on exactly how such a fix is made. I think one improvement would be to actually bump --follow handling into the limit_list() stage, so that we properly handle history simplification over followed paths. In which case get_revision() would just never return the uninteresting commits, and the current shortlog code would Just Work. That said, I don't think we can go wrong by making shortlog's traversal more like log's. Any changes we make to --follow will be aimed at and tested with git-log, so the more code they share the more likely it is that shortlog won't bitrot. -Peff