Received: by 2002:a05:6a10:206:0:0:0:0 with SMTP id 6csp367345pxj; Thu, 3 Jun 2021 08:36:49 -0700 (PDT) X-Google-Smtp-Source: ABdhPJyDpNxL34Vfjs10ndPdKP/iVbJXYC9UcCb0FPVpyR5HNJusMpa6eM64kDRuKkmN+m637Z6p X-Received: by 2002:a17:907:988a:: with SMTP id ja10mr157448ejc.527.1622734609540; Thu, 03 Jun 2021 08:36:49 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1622734609; cv=none; d=google.com; s=arc-20160816; b=ha5A3B1BuiWl210dkdlA6yYticZy5TbLK0RQcHI+creFSOlHZlEntM5/hFh2iBRUr3 zcAejEC5WgrPPlDRP2liQKBmI6clSt2gZsnEwRwcGx2M+Uvviawk6VEj2YjK4VUCZuSU VEMywncPotPpQ6IXsFW77JhisH87IBnR6+/sR5hemLj5t7CXEGtSRUnTbaYspsIWt5uP FX5B+PvXnxCePirTnfzVOKGKNaghu8+bBGybV/lF9udO8U1Fu6EkIaM6AYIhBMhqcQJM 5rwl9Dk+RkMSt5n2T+osm4KlVVWS1r0ByiF7rmxqG7gcJbtCQBQUdDeZ5UqjcV0nRHTm PRxQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:thread-index:thread-topic :content-transfer-encoding:mime-version:subject:references :in-reply-to:message-id:cc:to:from:date:dkim-signature:dkim-filter; bh=DKp9Kn9IOFj0rAa1smoreoI1xPw87j9ngxQ24mYrJBs=; b=UzfRen4hrGu3UYCy+CffhkHXhjcG/KCRRm6RGbVkfdmqpsmDuXUHQMcCzkzs0GMEgC OzNJ8TzROIFJ85BYuNgUNQkH/fNIHnoSYps22kuXJ5QPFTPApFA7XlwosKC1vW1VDB9A r76pK4Ryuxkflm0Li20wVXGKDJ6cCdhjrqHhMRCfkLCKEiuzOcbmJpS4tG9Pz5wfL3vJ no5PNAZlfLpn06oDl1dHWT7ItWxHD/EuySAz2/8oLFZtVTGIXykeqJ5NvNCSMMFcUApZ tM0edb85WJhAQ2Gk4AaHns/CxL9eYg2lVsHiTv8aTNOjIApjTt+QcoI1/jiApDTYN4iD 4lRA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@efficios.com header.s=default header.b=W0NLN8o2; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=efficios.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id t7si645113ejx.540.2021.06.03.08.36.24; Thu, 03 Jun 2021 08:36:49 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@efficios.com header.s=default header.b=W0NLN8o2; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=efficios.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229809AbhFCPfn (ORCPT + 99 others); Thu, 3 Jun 2021 11:35:43 -0400 Received: from mail.efficios.com ([167.114.26.124]:58866 "EHLO mail.efficios.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229617AbhFCPfn (ORCPT ); Thu, 3 Jun 2021 11:35:43 -0400 Received: from localhost (localhost [127.0.0.1]) by mail.efficios.com (Postfix) with ESMTP id E594131C75D; Thu, 3 Jun 2021 11:33:57 -0400 (EDT) Received: from mail.efficios.com ([127.0.0.1]) by localhost (mail03.efficios.com [127.0.0.1]) (amavisd-new, port 10032) with ESMTP id eJCp_a_nWEsK; Thu, 3 Jun 2021 11:33:57 -0400 (EDT) Received: from localhost (localhost [127.0.0.1]) by mail.efficios.com (Postfix) with ESMTP id 8672F31CA04; Thu, 3 Jun 2021 11:33:57 -0400 (EDT) DKIM-Filter: OpenDKIM Filter v2.10.3 mail.efficios.com 8672F31CA04 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=efficios.com; s=default; t=1622734437; bh=DKp9Kn9IOFj0rAa1smoreoI1xPw87j9ngxQ24mYrJBs=; h=Date:From:To:Message-ID:MIME-Version; b=W0NLN8o2HF9zHyJNFN8BDFot3aaEfAH2+zoVLTmd57z+jKtE6U5EZcAprQHQ+vOCh qpg93Ht8CIYSYPxeg0yDDT/rI1nuCyNBYRqYANHbfPRPUTiaWD8rracpx2KhvwfJSu UT8hNkzFCWbsvoDGL7a+FM2r1YhKRCMw2YNogE+SH4P/H+/q7krRXge0Qr7YWMQ+LX C+47md2mINyIRJtq1LIBfefRlwm4GwfzRGbq2jiYozeE3I0kfR+qfcjaOTOxkW3bi3 E0rAhytfp7wydLmIjOhz85W7ZYu7IY03t6lx3NLVFfRkJhC49qxM6PUKkkRwpl0EuD 0ZzqS91BP7xnA== X-Virus-Scanned: amavisd-new at efficios.com Received: from mail.efficios.com ([127.0.0.1]) by localhost (mail03.efficios.com [127.0.0.1]) (amavisd-new, port 10026) with ESMTP id 7cKoZnbOfF31; Thu, 3 Jun 2021 11:33:57 -0400 (EDT) Received: from mail03.efficios.com (mail03.efficios.com [167.114.26.124]) by mail.efficios.com (Postfix) with ESMTP id 765FB31C813; Thu, 3 Jun 2021 11:33:57 -0400 (EDT) Date: Thu, 3 Jun 2021 11:33:57 -0400 (EDT) From: Mathieu Desnoyers To: Taylor Blau Cc: Alexander Viro , git , Peter Zijlstra , Thomas Gleixner , linux-kernel , Jiri Kosina , Greg Kroah-Hartman Message-ID: <654904857.6915.1622734437354.JavaMail.zimbra@efficios.com> In-Reply-To: References: <30399052.5964.1622647235870.JavaMail.zimbra@efficios.com> Subject: Re: git feature request: git blame --ignore-cleanup/--ignore-trivial MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit X-Originating-IP: [167.114.26.124] X-Mailer: Zimbra 8.8.15_GA_4018 (ZimbraWebClient - FF88 (Linux)/8.8.15_GA_4026) Thread-Topic: git feature request: git blame --ignore-cleanup/--ignore-trivial Thread-Index: XLr69/WnC7jKcuBW+k7l9LYtwadObQ== Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org ----- On Jun 2, 2021, at 3:41 PM, Taylor Blau me@ttaylorr.com wrote: > On Wed, Jun 02, 2021 at 03:29:44PM +0000, Al Viro wrote: >> > Any maybe the patterns associated to "cleanup" and "trivial" commits >> > should be something that can be configured through a git config >> > file. >> >> Just an observation: quite a few subtle bugs arise from mistakes in >> what should've been a trivial cleanup. Hell, I've seen bugs coming >> from rebase of provably no-op patches - with commit message unchanged. >> So IME this is counterproductive... > > Yes, I find excluding revisions from 'git blame' to be rarely useful, > exactly for this reason. > > You could probably use the '--ignore-revs-file' option of 'git blame' to > exclude commits you consider trivial ahead of time. If you had an > 'Is-trivial' trailer, I would probably do something like: > > $ git log --format='%H %(trailers:key=Is-trivial)' | > grep "Is-trivial: true" | cut -d" " -f1 >exclude > $ git blame --ignore-revs-file exclude ... Nice trick! So within a project which standardize on a "Cleanup: " prefix at the beginning of the patch subject, this would look like: git log --format='%H Subject=("%s")' file.c | grep 'Subject=(\"Cleanup: ' | cut -d" " -f1 > exclude.txt git blame --ignore-revs-file exclude.txt file.c I fully understand that in many cases having the entire set of revisions is needed, because even a cleanup patch could be buggy, but IMHO it's nice to have a way to achieve this in situations where the cleanup patches get in the way of figuring out the most recent behavior changes in a given area of the code. Thanks, Mathieu -- Mathieu Desnoyers EfficiOS Inc. http://www.efficios.com