Daniel Vetter <dan...@ffwll.ch> writes:
> On Sun, Feb 18, 2018 at 11:00:56AM +0100, Christophe LEROY wrote:
>> Le 17/02/2018 à 22:19, Pavel Machek a écrit :
>> > Fix double ;;'s in code.
>> > Signed-off-by: Pavel Machek <pa...@ucw.cz>
>> A summary of the files modified on top of the patch would help understand
>> the impact.
>> A maybe there should be one patch by area, eg one for each arch specific
>> modif and one for drivers/ and one for block/ ?
> Yeah, pls split this into one patch per area, with a suitable patch
> subject prefix. Look at git log of each file to get a feeling for what's
> the standard in each area.
This part is actually pretty annoying.
I hacked up a script (below) which seems to do a reasonable job in most
For this patch it gives:
$ for f in $(git ls-files -m); do ./guess-prefix.py $f; done
soc: imx: gpc:
I think those are correct except for:
- "drm:" for "drivers/gpu/drm/scheduler" which has only a single commit.
- "md:" for "drivers/md/raid1.c" which is tricked by inconsistent
usage of "md: raid1:" and "md/raid1:".
But that seems like a reasonable hit rate.
Another approach would be to have a file that defines for each subsystem
what the preferred style is, but that is likely to be a PITA to
from subprocess import check_output
from collections import Counter
if len(sys.argv) != 2:
print('Usage: %s <path>' % sys.argv, file=sys.stderr)
fname = sys.argv
cmd = ['git', 'log', '--format=%s', '-n', '100', fname]
output = check_output(cmd).decode('utf-8')
ignore = ['License', 'Merge']
# Ordered list of patterns
patterns = [
# Common style "foo/bar/baz: Fix the foo"
# Less common "foo bar baz: Fix the foo"
re.compile('^([\w\-_]+:? )+: ')
words = 
for line in output.splitlines():
prefix = line.split()
for patt in patterns:
match = patt.search(line)
prefix = match.group(0)
if prefix in ignore:
# Warn if we didn't find many examples
if len(words) < 5:
print("Warning: only found %d previous commits to guess from for" %
counts = Counter(words)
iommu mailing list