From: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
To: Taylor Blau <me@ttaylorr.com>
Cc: Alexander Viro <viro@zeniv.linux.org.uk>,
git <git@vger.kernel.org>, Peter Zijlstra <peterz@infradead.org>,
Thomas Gleixner <tglx@linutronix.de>,
linux-kernel <linux-kernel@vger.kernel.org>,
Jiri Kosina <trivial@kernel.org>,
Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Subject: Re: git feature request: git blame --ignore-cleanup/--ignore-trivial
Date: Thu, 3 Jun 2021 11:33:57 -0400 (EDT) [thread overview]
Message-ID: <654904857.6915.1622734437354.JavaMail.zimbra@efficios.com> (raw)
In-Reply-To: <YLfe+HXl4hkzs44b@nand.local>
----- 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
next prev parent reply other threads:[~2021-06-03 15:34 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2021-06-02 15:20 git feature request: git blame --ignore-cleanup/--ignore-trivial Mathieu Desnoyers
2021-06-02 15:29 ` Al Viro
2021-06-02 19:41 ` Taylor Blau
2021-06-03 15:33 ` Mathieu Desnoyers [this message]
2021-06-03 10:13 ` David Sterba
2021-06-02 19:37 ` Jeff King
2021-06-02 21:16 ` Felipe Contreras
2021-06-03 10:23 ` David Sterba
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
List information: http://vger.kernel.org/majordomo-info.html
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=654904857.6915.1622734437354.JavaMail.zimbra@efficios.com \
--to=mathieu.desnoyers@efficios.com \
--cc=git@vger.kernel.org \
--cc=gregkh@linuxfoundation.org \
--cc=linux-kernel@vger.kernel.org \
--cc=me@ttaylorr.com \
--cc=peterz@infradead.org \
--cc=tglx@linutronix.de \
--cc=trivial@kernel.org \
--cc=viro@zeniv.linux.org.uk \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
Code repositories for project(s) associated with this public inbox
https://80x24.org/mirrors/git.git
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).