File: purity.sh

package info (click to toggle)
acl2 8.3dfsg-2
  • links: PTS
  • area: main
  • in suites: bullseye
  • size: 309,408 kB
  • sloc: lisp: 3,311,842; javascript: 22,569; cpp: 9,029; ansic: 7,872; perl: 6,501; xml: 3,838; java: 3,738; makefile: 3,383; ruby: 2,633; sh: 2,489; ml: 763; python: 741; yacc: 721; awk: 260; csh: 186; php: 171; lex: 154; tcl: 49; asm: 23; haskell: 17
file content (65 lines) | stat: -rwxr-xr-x 2,079 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
#!/bin/sh

# This script checks that only Matt Kaufmann has committed to files
# outside books/.  If others are to be included, update the first call
# of basecmd below.

if [ `basename $PWD` = devel ] ; then \
    echo "ERROR: Must not be in a devel directory." ; \
    exit 1 ; \
fi

export PAGER=cat

# Matt might update this when confident of purity since the indicated date.
export SINCE=2020-04-11

export basecmd="\
git log \
 --name-only \
 --pretty=oneline \
 --since $SINCE"

# Warning: Do not skip this fetch!  In particular, pull.sh relies on it.
echo "Executing git fetch --all"
git fetch --all
echo "-----"

$basecmd \
  --author='Matt Kaufmann <matthew.j.kaufmann@gmail.com>' \
  --author='Matt Kaufmann <kaufmann@wireless-10-147-200-122.public.utexas.edu>' \
  --author='Matt Kaufmann <kaufmann@horatio-123.cs.utexas.edu>' \
  --author='Matt Kaufmann <kaufmann@horatio-217.cs.utexas.edu>' \
  --author='Matt Kaufmann <kaufmann@horatio-168.cs.utexas.edu>' \
  --author='Matt Kaufmann <kaufmann@cs.utexas.edu>' \
  --author='MattKaufmann <matthew.j.kaufmann@gmail.com>' \
  --author='kaufmann <kaufmann@unknown58b035fde782.attlocal.net>' \
  --author='Matt Kaufmann <kaufmann@matts-mbp.attlocal.net>' \
  --author='Matt Kaufmann <kaufmann@Matts-MBP.attlocal.net>' \
  --author="Matt Kaufmann <kaufmann@Matts-MacBook-Pro.local>" \
  --author="Matt Kaufmann <kaufmann@Matts-MBP.home>" \
  --author="Matt Kaufmann <kaufmann@kestrel.edu>" \
  | grep -v '^[a-z0-9]\{40\}' \
  | grep -v '^books/' \
  > /tmp/git-log-matt.txt

$basecmd \
  | grep -v '^[a-z0-9]\{40\}' \
  | grep -v '^books/' \
  > /tmp/git-log-all.txt

export out_all=gitlog-all.txt

export diffcmd='diff /tmp/git-log-matt.txt /tmp/git-log-all.txt'
$diffcmd
if [ $? -ne 0 ] ; then \
    echo "-----"
    echo "ERROR: Someone committed to other than books/!" ; \
    echo "-----"
    git log --name-only --since $SINCE > $out_all
    echo "Search for the above file in $out_all."
    echo "If all is well, change SINCE in $0 to the date of the problem commit."
    exit 1 ; \
else
    echo "$0 PASSED."
fi