From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on dcvr.yhbt.net X-Spam-Level: X-Spam-ASN: AS53758 23.128.96.0/24 X-Spam-Status: No, score=-3.9 required=3.0 tests=AWL,BAYES_00, HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,RCVD_IN_DNSWL_MED, SPF_HELO_PASS,SPF_PASS shortcircuit=no autolearn=ham autolearn_force=no version=3.4.2 Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by dcvr.yhbt.net (Postfix) with ESMTP id ED5561F8C8 for ; Sun, 19 Sep 2021 19:04:11 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231284AbhISTBF (ORCPT ); Sun, 19 Sep 2021 15:01:05 -0400 Received: from cloud.peff.net ([104.130.231.41]:50636 "EHLO cloud.peff.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229477AbhISTBE (ORCPT ); Sun, 19 Sep 2021 15:01:04 -0400 Received: (qmail 27312 invoked by uid 109); 19 Sep 2021 18:59:39 -0000 Received: from Unknown (HELO peff.net) (10.0.1.2) by cloud.peff.net (qpsmtpd/0.94) with ESMTP; Sun, 19 Sep 2021 18:59:39 +0000 Authentication-Results: cloud.peff.net; auth=none Received: (qmail 9927 invoked by uid 111); 19 Sep 2021 18:59:37 -0000 Received: from coredump.intra.peff.net (HELO sigill.intra.peff.net) (10.0.0.2) by peff.net (qpsmtpd/0.94) with (TLS_AES_256_GCM_SHA384 encrypted) ESMTPS; Sun, 19 Sep 2021 14:59:37 -0400 Authentication-Results: peff.net; auth=none Date: Sun, 19 Sep 2021 14:59:36 -0400 From: Jeff King To: Philip Oakley Cc: Git List Subject: Re: Trimming 'deadheads' (TREESAME 2nd parent) from revision walks? Message-ID: References: <01fe28d8-2887-bc42-c91b-c3237b5186a7@iee.email> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline In-Reply-To: <01fe28d8-2887-bc42-c91b-c3237b5186a7@iee.email> Precedence: bulk List-ID: X-Mailing-List: git@vger.kernel.org On Sat, Sep 18, 2021 at 03:18:47PM +0100, Philip Oakley wrote: > Is there a method within `git rev-list` to trim side branch merges where > the merge's tree is identical to the first parent's commit-tree? > [...] > From my reading of the `rev-list` manual this is similar to the > TREESAME capability, but without specifying any paths (maybe just `.` ?). Yes, I'd just do "git log ." for this. I don't think there's another way to trigger simplification. In try_to_simplify_commit(), we bail early unless revs->prune is set, and that is set only by the presence of pathspecs or by --simplify-by-decoration. > * Is there a proper term for the treesame condition of the commit-tree > (as recorded in the commit object)? In a one-parent commit, I'd just call it an empty commit. For a merge, it is really I'd probably call it an "ours" merge, since one obvious way to get there is with "git merge -s ours" (of course you can also just resolve all conflicts in favor of one parent). I don't know of another name (besides treesame, of course, but that generally implies a particular scope of interest given by a pathspec). -Peff