mirror of
https://github.com/torvalds/linux.git
synced 2026-04-21 16:23:59 -04:00
Currently, the testid.txt file in the top-level directory of the rcutorture results contains the output of "git rev-parse HEAD", which just gives the full SHA-1 of the current commit. This is followed by the output of "git status", which is further followed by the output of "git diff". This works, but is less than helpful to human readers scanning a list of commits. This commit therefore instead uses "git show --oneline --no-patch HEAD", which provides a short SHA-1, but also the names of any branches and the commit's title. Signed-off-by: Paul E. McKenney <paulmck@kernel.org> Signed-off-by: Boqun Feng <boqun.feng@gmail.com>
30 lines
866 B
Bash
Executable File
30 lines
866 B
Bash
Executable File
#!/bin/bash
|
|
# SPDX-License-Identifier: GPL-2.0+
|
|
#
|
|
# Create a testid.txt file in the specified directory.
|
|
#
|
|
# Usage: mktestid.sh dirpath
|
|
#
|
|
# Copyright (C) Meta Platforms, Inc. 2025
|
|
#
|
|
# Author: Paul E. McKenney <paulmck@kernel.org>
|
|
|
|
resdir="$1"
|
|
if test -z "${resdir}" || ! test -d "${resdir}" || ! test -w "${resdir}"
|
|
then
|
|
echo Path '"'${resdir}'"' not writeable directory, no ${resdir}/testid.txt.
|
|
exit 1
|
|
fi
|
|
echo Build directory: `pwd` > ${resdir}/testid.txt
|
|
if test -d .git
|
|
then
|
|
echo Current commit: `git show --oneline --no-patch HEAD` >> ${resdir}/testid.txt
|
|
echo >> ${resdir}/testid.txt
|
|
echo ' ---' Output of "'"git status"'": >> ${resdir}/testid.txt
|
|
git status >> ${resdir}/testid.txt
|
|
echo >> ${resdir}/testid.txt
|
|
echo >> ${resdir}/testid.txt
|
|
echo ' ---' Output of "'"git diff HEAD"'": >> ${resdir}/testid.txt
|
|
git diff HEAD >> ${resdir}/testid.txt
|
|
fi
|