From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-3.8 required=3.0 tests=BAYES_00, HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS autolearn=no autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id B2AE3C4708F for ; Wed, 2 Jun 2021 19:43:55 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 90C29613E7 for ; Wed, 2 Jun 2021 19:43:55 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229753AbhFBTph (ORCPT ); Wed, 2 Jun 2021 15:45:37 -0400 Received: from cloud.peff.net ([104.130.231.41]:44350 "EHLO cloud.peff.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229489AbhFBTph (ORCPT ); Wed, 2 Jun 2021 15:45:37 -0400 X-Greylist: delayed 401 seconds by postgrey-1.27 at vger.kernel.org; Wed, 02 Jun 2021 15:45:37 EDT Received: (qmail 1998 invoked by uid 109); 2 Jun 2021 19:37:11 -0000 Received: from Unknown (HELO peff.net) (10.0.1.2) by cloud.peff.net (qpsmtpd/0.94) with ESMTP; Wed, 02 Jun 2021 19:37:11 +0000 Authentication-Results: cloud.peff.net; auth=none Received: (qmail 20393 invoked by uid 111); 2 Jun 2021 19:37:11 -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; Wed, 02 Jun 2021 15:37:11 -0400 Authentication-Results: peff.net; auth=none Date: Wed, 2 Jun 2021 15:37:10 -0400 From: Jeff King To: Mathieu Desnoyers Cc: git@vger.kernel.org, Peter Zijlstra , Thomas Gleixner , linux-kernel , Jiri Kosina , Greg Kroah-Hartman , Al Viro Subject: Re: git feature request: git blame --ignore-cleanup/--ignore-trivial Message-ID: References: <30399052.5964.1622647235870.JavaMail.zimbra@efficios.com> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline In-Reply-To: <30399052.5964.1622647235870.JavaMail.zimbra@efficios.com> Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Wed, Jun 02, 2021 at 11:20:35AM -0400, Mathieu Desnoyers wrote: > Considering the added value brought by splitting cleanups from functional changes > from a maintainer perspective (easier reverts) and from a reviewer perspective > (easier to focus on the functional changes), I think it would be good to improve > the git tooling to allow easily filtering out the noise from git blame. > > Perhaps a new git blame "--ignore-trivial" and/or "--ignore-cleanup" could solve > this by filtering out "trivial" and "cleanup" patches from the history it considers. There's "-w" to ignore whitespace-only changes. Since Git v2.23.0, there's also "--ignore-rev-file", which lets you ignore arbitrary commits. Since you have to generate a separate list of commits to feed it, it's a little more involved than your "--invert-grep" example. But it's also much more flexible (you can generate the file however you like, and even tweak it by hand). I do tend to agree with Al's notion that commits which are _supposed_ to be trivial sometimes end up not being so. Or another way of thinking about it is: relevance is a property of the query you're making, not the original change. So IMHO the best tool for this kind of thing is the "re-blame from parent" feature that many interactive blame viewers have (I use tig, but I'm sure other tools like magic have a similar feature). There when you land on a boring commit, it's a single key to skip past it and see how the earlier code came about. -Peff