6 FORMAT='%h %ai name=%an email=%ae'
13 This script filters the git log for commits whose
14 author's e-mail is _not_ on @lyx.org.
16 This script can be used to check that the LyX developers have
17 correctly configured their git to provide an e-mail address that's in
18 the @lyx.org domain. This is needed for proper functioning of the
19 e-mails being automatically sent to lyx-cvs@lyx.org.
22 # List contributions from non-@lyx.org-addresses since 2015-01-01
25 # Compute hash (SHA-512) of list of contributors
26 $SCRIPT --compute-hash
28 # Check hash of list of contributors against expected hash.
29 # This scripts exist with a non-zero error code if hash does not match.
30 $SCRIPT --check-hash \
31 1330d9fca5e385e9de8933cbf6d391222207b2f6af1cf7ca3175babfd4e5ab46b024ff2d98c7c8630b362be506da9376f9262a524755f9acf655d83dcce8a564
37 See e-mail thread on developers@lyx.org started by Scott 2017-07-30.
43 printf "An error occured: %s\n" "$*"
47 function list_filtered_git_log() {
48 git log --since=$SINCE_DATE --format="$FORMAT" \
52 function compute_current_hash() {
53 FILTERED_LOG=$( list_filtered_git_log )
54 echo "$FILTERED_LOG" | shasum -a 512 | cut -d ' ' -f 1
68 CURRENT_HASH=$( compute_current_hash )
69 printf "Current hash: %s\n" "$CURRENT_HASH"
75 CURRENT_HASH=$( compute_current_hash )
76 if [[ "$CURRENT_HASH" == "$DESIRED_HASH" ]]; then
77 printf "Hash matches current hash\n:"
78 printf " Current: %s\n" "$CURRENT_HASH"
81 printf "Hash mismatch:\n"
82 printf " Desired: %s\n" "$DESIRED_HASH"
83 printf " Current: %s\n" "$CURRENT_HASH"
84 printf "Latest log:\n%s\n" "$FILTERED_LOG"
90 fail "Unrecognised command(s), give '-h' for help: '$*'"