fork/fish-shell

git clone https://git.julia.blue/fork/fish-shell

Érico Rolimbuild_tools/list_committers_since: account for possibility of mktemp failure.ef4f3b733

master
948 B36 linesraw
1#! /usr/bin/env fish
2
3set -l TAG $argv[1]
4
5if test -z "$TAG"
6    echo "Tag name required."
7    exit 1
8end
9
10if not contains -- $TAG (git tag)
11    echo "$TAG is not a valid tag name."
12    exit 1
13end
14
15set -l committers_to_tag (mktemp)
16or exit 1
17set -l committers_from_tag (mktemp)
18or exit 1
19
20# You might think it would be better to case-insensitively sort/compare the names
21# to produce a more natural-looking list.
22# Unicode collation tables mean that this is fraught with danger; for example, the
23# "“" character will not case-fold in UTF-8 locales. sort suggests using the C locale!
24
25git log "$TAG" --format="%aN" --reverse | sort -u >$committers_to_tag
26git log "$TAG".. --format="%aN" --reverse | sort -u >$committers_from_tag
27
28echo New committers:
29echo (comm -13 $committers_to_tag $committers_from_tag)','
30
31echo
32
33echo Returning committers:
34echo (comm -12 $committers_to_tag $committers_from_tag)','
35
36rm $committers_to_tag $committers_from_tag