]> git.sesse.net Git - vlc/blob - extras/misc/authors_list.sh
decoder: reduce lock scope and cosmetic
[vlc] / extras / misc / authors_list.sh
1 #!/bin/bash
2
3 # A script checking the git logs for commits. Final goal is updating AUTHORS.
4 # Run it in source root
5
6 # To be copied and run in the git directory for having "git shortlog -sn po/" find the logs.
7 # It will generate a subdirectory temp_update_AUTHORS
8
9 OLD_AUTHORS="AUTHORS_unmodified_by_No_se_script.txt"
10 # The last version before modifying AUTHORS with this kind of script. Important, since the script shall not remove anyone.
11 # Not even the manual editings delete anyone.
12 # 4f696a88ec9544b98e22ee45e010869717608bd2  here did j-b start using the script
13
14 if [ -f $OLD_AUTHORS ]; then
15  echo "Starting with credits from $OLD_AUTHORS ..."
16 else
17  echo "You need an old AUTHORS file. Only if you know what you are doing, you can use the current AUTHORS."
18  echo "Aborting..."
19  exit
20 fi
21
22
23 mkdir -p temp_update_AUTHORS
24
25 echo "Checking all git logs"
26 git shortlog -sn -- > temp_update_AUTHORS/all_git.txt
27
28 echo "Checking "po only" git logs"
29 #git shortlog -sn po/ > temp_update_AUTHORS/po_git.txt
30 # This modified command identified more translators, leading to the removal of existing entries in AUTHORS, impossible by design.
31 # So, start with a AUTHORS version with validated entries.
32 # Only if the script is not modified (wrt finding translators) you can use the current AUTHORS
33 git shortlog -sn -- po extras/package/win32/languages/ share/vlc.desktop.in  share/vlc.desktop share/applications/vlc.desktop extras/package/win32/vlc.win32.nsi.in > temp_update_AUTHORS/po_git_previous.txt
34
35 # Some typical (ancient) l10n files:
36 #share/applications/vlc.desktop
37 #extras/package/win32/languages/declaration.nsh
38 #extras/package/win32/languages/english.nsh
39 #extras/package/win32/languages/french.nsh
40 #extras/package/win32/vlc.win32.nsi.in
41
42 sed -n '{
43 s/.*Song Ye Wen.*//
44 s/.*Florian Hubold.*//
45 s/.*Sveinung Kvilhaugsvik.*//
46 s/.*Julien Humbert.*//
47 /^$/ !p
48 }
49 ' <temp_update_AUTHORS/po_git_previous.txt >temp_update_AUTHORS/po_git.txt
50
51 # Checking the logs, this ^^ persons did not do l10n
52 # commited to share/vlc.desktop, but this seems to be media types, not l10n things.
53 # Florian Hubold
54 # share/applications/vlc.desktop
55 # Sveinung Kvilhaugsvik
56 # commited to extras/package/win32/vlc.win32.nsi.in   and   include/vlc_interface.h
57 # Julien Humbert
58 # comitted to po/POTFILES.in
59 # Song Ye Wen
60
61 # TODO: add this newly discovered translators
62 # czech translator
63 # Radek Vybiral <radek@ns.snake.cz>
64 # zh_TW
65 # Thanks to Hsi-Ching Chao
66 # Thanks to Ruei-Yuan Lu <RueiYuan.Lu@gmail.com>
67 #extras/package/win32/languages/schinese.nsh
68 #share/vlc.desktop
69
70
71 # there are some artwork designers in git log, too. If one of them wants to be mentioned in "Programmers" also, remove here:
72 echo "Damien Erambert"  >  temp_update_AUTHORS/artwork_git.txt
73 echo "Daniel Dreibrodt" >> temp_update_AUTHORS/artwork_git.txt
74 echo "Dominic Spitaler" >> temp_update_AUTHORS/artwork_git.txt
75
76
77
78
79 echo "reading AUTHORS"
80 sed -n '/Programming/,/^$/  s/[^-].*/&/p' < $OLD_AUTHORS | sed '1 d'  > temp_update_AUTHORS/programmers_part.txt
81 # The part of AUTHORS between Programming and the first empty line, without the ---- line
82
83
84 echo "Removing commit counts from git log"
85 sed 's/[0-9 \t]*\(.*\)/\1/g' < temp_update_AUTHORS/all_git.txt |sort|uniq > temp_update_AUTHORS/all_git_namesonly.txt
86 # I think "uniq" is not needed here.
87
88
89 echo "Removing translators from the git log"
90 # Remove translators. (Commiters with the same count in /po and total and hence are listed twice). Then the commit counter is removed
91 cat temp_update_AUTHORS/all_git.txt temp_update_AUTHORS/po_git.txt|sort|uniq -u |sed 's/[0-9 \t]*\(.*\)/\1/g' | sort|uniq> temp_update_AUTHORS/coders_only.txt
92
93
94 ####
95 #For script tuning: Are there other files the translators modified? =>probably l10n files
96 cat temp_update_AUTHORS/all_git.txt temp_update_AUTHORS/po_git.txt|sort|uniq -u| sed 's/[0-9 \t]*\(.*\)/\1/g' | sort|uniq -d> temp_update_AUTHORS/both_sides.txt
97 ####
98
99 # Similar effect with second sed run:
100 # Remove translators. I remove every line containing the name. Maybe the .* before and after the last \1 should be removed (i.e. for contributors "Firstname Secondname aka something_you_want_to_keep"
101 #cat temp_update_AUTHORS/all_git.txt temp_update_AUTHORS/po_git.txt|sort|uniq -D|uniq|sed 's/[0-9 \t]*\(.*\)/\1/g' |sed 's:[0-9 \t]*\(.*\):s^.*\1.*^^g:' > temp_update_AUTHORS/remove_translators_gen
102 #
103 #sed -f temp_update_AUTHORS/remove_translators_gen < temp_update_AUTHORS/all_git_namesonly.txt > temp_update_AUTHORS/coders_only.txt
104 # This is everyone who did code commits with git. The blank lines are the removed translators.
105
106
107 # Now, I want to reduce the number of lines the human reader has to check, so we are going to kill the already listed contributors.
108
109 echo "Finding pre-git contributors in AUTHORS"
110 sed 's:\(.*\):s^.*\1.*^^g:' < temp_update_AUTHORS/coders_only.txt > temp_update_AUTHORS/remove_git_commiters_gen
111 sed -f temp_update_AUTHORS/remove_git_commiters_gen < temp_update_AUTHORS/programmers_part.txt |sort| uniq -u > temp_update_AUTHORS/pre-git.txt
112
113 sed 's:\(.*\):s^.*\1.*^^g:' < temp_update_AUTHORS/programmers_part.txt > temp_update_AUTHORS/remove_programmers_part_gen
114 sed -f temp_update_AUTHORS/remove_programmers_part_gen < temp_update_AUTHORS/coders_only.txt |sort| uniq -u > temp_update_AUTHORS/new_coders_only.txt
115
116 # VideoLAN as a contributor can be removed, I think
117
118
119
120 sed 's/[0-9 \t]*\(.*\)/\1/g' < temp_update_AUTHORS/all_git.txt  > temp_update_AUTHORS/all_git_namesonly_ordered.txt
121 # Just remove the tab an the # commits, keep the order. This file is going to be the sort order.
122 # You can re-order the complete programmers part like that and simply append the pre-git commiters.
123 # Ordering the contributors that way is not a bad idea.
124 # The question: Is it easier/better to check the new commiters in this order?
125 # One can find (UPPERCASE issues, middle names,..) better when listing them alphabetically.
126
127 # I suggest checking manually a file build like that:
128 # alphabetically ordered, complete list of contributors/git (code) commiters, with an extra marking for new ones. Example
129 # Old Commiter
130 # New Commiter           ---XXX---NEW
131 # New COMMITER           ---XXX---NEW   |same name with UPPERCASE part
132 # Very Commiter
133 # Very New Commiter      ---XXX---NEW   |Same person with a middle name
134
135 # The uppercase case can be done by script I guess, I did not look up how to make sure the intended version will be picked.
136 # How to proceed with manually found problems? Solve them for the future (.mailmap/own script/...)
137
138 rm -f temp_update_AUTHORS/ordering_log.txt
139 rm -f temp_update_AUTHORS/ordered_by_commits.txt 
140 FileName='temp_update_AUTHORS/all_git_namesonly_ordered.txt' 
141 while read LINE
142 do
143  if [ "$LINE" = "VideoLAN" ]; then
144   echo "VideoLAN is not a person"
145  else
146 #  grep "$LINE" temp_update_AUTHORS/new_coders_only.txt >> temp_update_AUTHORS/ordering_log.txt
147   grep "$LINE" temp_update_AUTHORS/coders_only.txt >> temp_update_AUTHORS/ordering_log.txt
148 #  grep "$LINE" temp_update_AUTHORS/coders_only.txt >> temp_update_AUTHORS/ordering_log.txt
149 # I want to keep the $? (it removes some broken names) but I could send the output to /dev/null
150 # If someone's name is a prefix to some other's name, this diff will show it:
151 # diff temp_update_AUTHORS/ordering_log.txt temp_update_AUTHORS/ordered_by_commits.txt
152 # AFAIK this will not effect the output, since we don't use the grep output but only the git output
153   if [ $? = "0" ]; then
154     grep "$LINE" temp_update_AUTHORS/artwork_git.txt ||  echo "$LINE" >> temp_update_AUTHORS/ordered_by_commits.txt
155   fi
156  fi
157 done < $FileName
158
159
160
161 cat temp_update_AUTHORS/all_git.txt temp_update_AUTHORS/po_git.txt|sort|uniq -D|uniq|sed 's/[0-9 \t]*\(.*\)/\1/g' > temp_update_AUTHORS/translators.txt
162 wc -l temp_update_AUTHORS/*
163 echo "Some contributors only commited into po. Please cross-check that with the localization part. See: temp_update_AUTHORS/translators.txt"
164 echo "But first, please check if temp_update_AUTHORS/review.txt contains complete names and other constraints for publishing (i.e. UPPERCASE name parts, broken text, a name and it's abbreviation both present...)"
165
166
167 sed 's/\(.*\)/\1               ---XXX---NEW/g' < temp_update_AUTHORS/new_coders_only.txt | cat - temp_update_AUTHORS/programmers_part.txt |sort > temp_update_AUTHORS/review.txt
168 # This file contains VideoLAN as a contributor.
169
170 echo
171 echo "For the lazy ones: Have a look at temp_update_AUTHORS/final.txt"
172 echo "Contains all git code commiters (the translators are stored somewhere else) sorted by commits, and the pre-git commiters"
173 echo
174 echo 'For the lazy and brave (stupid?) ones: "cp new_AUTHORS AUTHORS" and check "git diff AUTHORS"'
175
176 echo "Programming" >  temp_update_AUTHORS/final.txt
177 echo "-----------" >> temp_update_AUTHORS/final.txt
178 cat temp_update_AUTHORS/ordered_by_commits.txt temp_update_AUTHORS/pre-git.txt >> temp_update_AUTHORS/final.txt
179 echo
180
181 echo "Listing email adresses used with different names..."
182 git shortlog -sne |sed 's/[^<]*\(.*\)/\1/g' |sort|uniq -d
183 echo "If something was listed here you should probably modify .mailmap"
184
185 # This last part puts the relevant addresses into temp_twice_used_adress/check_for_this.txt
186 # Currently, this is not needed (.mailmap is up to date)
187
188 #mkdir -p temp_twice_used_adress
189 #echo "Checking all git logs"
190 #git shortlog -sne > temp_twice_used_adress/all_shortlog_sne.txt
191 #
192 #echo "Removing everything but email addresses"
193 #sed 's/[^<]*\(.*\)/\1/g' < temp_twice_used_adress/all_shortlog_sne.txt |sort|uniq -d > temp_twice_used_adress/all_git_addresses_only.txt
194 #
195 #FileName='temp_twice_used_adress/all_git_addresses_only.txt'
196 #while read LINE
197 #do
198 #  grep "$LINE" temp_twice_used_adress/all_shortlog_sne.txt >> temp_twice_used_adress/check_for_this.txt
199 ## I want to keep the $? (it removes some broken names) but I could send the output to /dev/null
200 #  if [ $? = "0" ]; then
201 #    echo "$LINE"
202 #  fi
203 #done < $FileName
204
205
206
207 sed -n '1,2  p' < AUTHORS   > temp_update_AUTHORS/new_AUTHORS
208 cat temp_update_AUTHORS/final.txt >> temp_update_AUTHORS/new_AUTHORS
209 echo >>temp_update_AUTHORS/new_AUTHORS
210 sed -n '/Artwork/,$ p' < AUTHORS >> temp_update_AUTHORS/new_AUTHORS
211
212 cp temp_update_AUTHORS/new_AUTHORS .
213 #rm -rf temp_update_AUTHORS/