Subject: Re: [RFC PATCH] Using no- for options instead of duplication

From: Ævar Arnfjörð Bjarmason <[email-masked]>
Date: Tue, 13 Nov 2018 11:18:39 +0100

On Tue, Nov 13 2018, Junio C Hamano wrote:

> 	A tangetn that somebody might want to tackle.  It would be
> 	nice if we had a tool that takes a grep expression (like
> 	'^--no' and '^\[no-' above) and shows histograms of the ages
> 	of lines that match.  It might tell us that all 44 combined
> 	ones are more recent (some of them may even have been
> 	updated from the separate form) than the 124 separate ones,
> 	in which case we can say "we started the process of
> 	migrating to list options singly, like '--[no-]option', in
> 	commit X; let's continue doing so" in the log message.  Or
> 	it may turn out that we have been going in the other
> 	direction and most of these 44 are stale ones yet to be
> 	split.  Without such a tool, the above numbers are the best
> 	measure to go by, which is not quite ideal.

This doesn't spew out a histogram, but you can use the various "git
grep/blame" one-liners (https://www.google.nl/search?q=git+grep+blame)
plus shell one-liner to get something useful:

    git grep -e '^--no-' -e '^--\[no-' -n | perl -F':' -anpe '$_=`git blame -L$F[1],+1 $F[0]`' | perl -pe 's/^.* (\d{4})-.*\) /$1 /' | sort -n