File: list_committers_since.fish

package info (click to toggle)
fish 4.2.1-3.2
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 35,976 kB
  • sloc: python: 6,972; javascript: 1,407; sh: 1,009; xml: 411; ansic: 230; objc: 78; makefile: 20
file content (36 lines) | stat: -rwxr-xr-x 948 bytes parent folder | download | duplicates (3)
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
#! /usr/bin/env fish

set -l TAG $argv[1]

if test -z "$TAG"
    echo "Tag name required."
    exit 1
end

if not contains -- $TAG (git tag)
    echo "$TAG is not a valid tag name."
    exit 1
end

set -l committers_to_tag (mktemp)
or exit 1
set -l committers_from_tag (mktemp)
or exit 1

# You might think it would be better to case-insensitively sort/compare the names
# to produce a more natural-looking list.
# Unicode collation tables mean that this is fraught with danger; for example, the
# "“" character will not case-fold in UTF-8 locales. sort suggests using the C locale!

git log "$TAG" --format="%aN" --reverse | sort -u >$committers_to_tag
git log "$TAG".. --format="%aN" --reverse | sort -u >$committers_from_tag

echo New committers:
echo (comm -13 $committers_to_tag $committers_from_tag)','

echo

echo Returning committers:
echo (comm -12 $committers_to_tag $committers_from_tag)','

rm $committers_to_tag $committers_from_tag