mirror of
https://review.coreboot.org/flashrom.git
synced 2025-07-04 07:15:18 +02:00
doc: autogenerate a list of authors and hall of fame
This adds a build-time option to automatically generate a list of authors from git history, and includes it in the documentation by reading the output from git in a Sphinx extension. When git isn't available or the project source doesn't appear to be a git checkout, the list is not generated and gracefully replaced with a message explaining its absence. Change-Id: I1e9634a90e84262aafd80590deba9875f4b71a3c Signed-off-by: Peter Marheine <pmarheine@chromium.org> Reviewed-on: https://review.coreboot.org/c/flashrom/+/86350 Tested-by: build bot (Jenkins) <no-reply@coreboot.org> Reviewed-by: Anastasia Klimchuk <aklm@chromium.org>
This commit is contained in:

committed by
Anastasia Klimchuk

parent
07beef6999
commit
0b39a3e00c
39
doc/collect-authors.sh
Normal file
39
doc/collect-authors.sh
Normal file
@ -0,0 +1,39 @@
|
||||
#!/bin/sh
|
||||
|
||||
if [ $# -ne 3 ]
|
||||
then
|
||||
echo "Wrong number of arguments. Usage: $0 [authors|reviewers] outfile git_dir" >&2
|
||||
exit 1
|
||||
fi
|
||||
|
||||
case "$1" in
|
||||
authors)
|
||||
GROUP_ARGS="--group=author --group=trailer:Co-Authored-by --group=trailer:Co-Developed-by"
|
||||
;;
|
||||
reviewers)
|
||||
GROUP_ARGS="--group=trailer:Reviewed-by"
|
||||
;;
|
||||
*)
|
||||
echo "Unknown contributor kind: \"$1\"" >&2
|
||||
exit 1
|
||||
;;
|
||||
esac
|
||||
OUTFILE="$2"
|
||||
# GIT_DIR is passed explicitly so we never need to guess where
|
||||
# the source directory is. It may be somewhere entirely different
|
||||
# from where meson is running us.
|
||||
GIT_DIR="$3"
|
||||
|
||||
if ! command -v git >/dev/null
|
||||
then
|
||||
echo "git not available" >&2
|
||||
exit 1
|
||||
fi
|
||||
|
||||
if [ ! -d "$GIT_DIR" ]
|
||||
then
|
||||
echo "GIT_DIR ($GIT_DIR) does not exist" >&2
|
||||
exit 1
|
||||
fi
|
||||
|
||||
git --no-pager --git-dir="$GIT_DIR" shortlog --summary --numbered $GROUP_ARGS HEAD > "$OUTFILE"
|
Reference in New Issue
Block a user