lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Date:	Sat, 01 Dec 2012 19:50:02 +0100
From:	Stefan Beller <stefanbeller@...glemail.com>
To:	linux-doc@...r.kernel.org, linux-kernel@...r.kernel.org
Subject: Updating the .mailmap file

Hello,

I was just browsing the shortlog and it looked to 
me as if there are many double entries, i.e. the same person
being there with multiple email addresses.

So I wrote a script, which finds double names and adds them 
to the .mailmap file. However manual checking, whether these 
are really the same person is required.

---
#!/bin/bash

git shortlog -sne > shortlog.txt

# find double names in the shortlog
cat shortlog.txt |awk '{ NF--; $1=""; print }' |sort |uniq -d | sed 's/^ *//g' > names.txt

while read line
do
    echo "process name $line"
    # get the current mailmap file in a state where each person is listed
    # with their first line:
    rm mailmap_tmp*
    cat .mailmap |grep -v "^[# ]"|grep -v "^$" | sort > mailmap_tmp1
    while read <&9 line2
    do
        nameonly="$(echo "$line2" |awk '{NF--; print}')"
        grep -m1 "$nameonly" mailmap_tmp1 >> mailmap_tmp2
    done 9< "mailmap_tmp1"
    cat mailmap_tmp2 |uniq > mailmap_tmp3

    # find all occurences of one name
    cat shortlog.txt |grep "$line" | awk '{ $1=""; print }' | sed 's/^ *//g' > currentname.txt

    # get that guy alphabetically sorted into the mailmap file:
    echo $line > name
    cat mailmap_tmp3 name |sort > mailmap_tmp4

    # find the place where we need to insert this
    insertbeforeline=$(cat mailmap_tmp4 |grep -A1 "$line" |tail -n1)
    if [ "$insertbeforeline" != "" ] ; then
        # insert all in the middle of .mailmap:
        while read <&9 line2; do
            echo "adding line $line2 to mailmap before $insertbeforeline"
            sed "/$insertbeforeline/i $line2" .mailmap > mailmap_tmp5
            mv mailmap_tmp5 .mailmap
        done 9< "currentname.txt"
    else
        # must appended to end
        cat currentname.txt >> .mailmap
    fi

    git commit -a -m "Updating .mailmap file: Adding ${line}" > /dev/null
    echo "---"
done < "names.txt"

rm mailmap_tmp*
rm shortlog.txt
rm names.txt
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ