* Updating the .mailmap file
@ 2012-12-01 18:50 Stefan Beller
2012-12-02 3:11 ` Joe Perches
0 siblings, 1 reply; 2+ messages in thread
From: Stefan Beller @ 2012-12-01 18:50 UTC (permalink / raw)
To: linux-doc, linux-kernel
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
^ permalink raw reply [flat|nested] 2+ messages in thread
* Re: Updating the .mailmap file
2012-12-01 18:50 Updating the .mailmap file Stefan Beller
@ 2012-12-02 3:11 ` Joe Perches
0 siblings, 0 replies; 2+ messages in thread
From: Joe Perches @ 2012-12-02 3:11 UTC (permalink / raw)
To: Stefan Beller, Philipp Riemer; +Cc: linux-doc, linux-kernel
On Sat, 2012-12-01 at 19:50 +0100, Stefan Beller wrote:
> 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.
You should get together with Philipp Riemer.
http://lkml.org/lkml/2012/5/3/98
I think it's a problem not really worth solving.
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2012-12-02 3:11 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2012-12-01 18:50 Updating the .mailmap file Stefan Beller
2012-12-02 3:11 ` Joe Perches
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 NNTP newsgroup(s).