> configure
ysyx_22040000 李心杨 Linux calcite 6.1.69 #1-NixOS SMP PREEMPT_DYNAMIC Wed Dec 20 16:00:29 UTC 2023 x86_64 GNU/Linux 00:43:00 up 1 day 9:29, 2 users, load average: 0.45, 0.46, 0.41
This commit is contained in:
parent
4c0d17004a
commit
66d0ce915b
2 changed files with 42 additions and 2 deletions
40
git_commit.sh
Executable file
40
git_commit.sh
Executable file
|
@ -0,0 +1,40 @@
|
||||||
|
#/usr/bin/env bash
|
||||||
|
#
|
||||||
|
# Environment Variables:
|
||||||
|
# NEMU_HOME
|
||||||
|
set -x
|
||||||
|
|
||||||
|
STUID=ysyx_22040000
|
||||||
|
STUNAME=李心杨
|
||||||
|
|
||||||
|
TRACER=tracer-ysyx
|
||||||
|
GITFLAGS="-q --author=$TRACER<tracer@ysyx.org> --no-verify --allow-empty"
|
||||||
|
|
||||||
|
YSYX_HOME=$NEMU_HOME/..
|
||||||
|
WORK_BRANCH=$(git rev-parse --abbrev-ref HEAD)
|
||||||
|
WORK_INDEX=$YSYX_HOME/.git/index.${WORK_BRANCH}
|
||||||
|
TRACER_BRANCH=$TRACER
|
||||||
|
|
||||||
|
LOCK_DIR=$YSYX_HOME/.git/
|
||||||
|
|
||||||
|
git_soft_checkout () {
|
||||||
|
git checkout --detach -q && git reset --soft $1 -q -- && git checkout $1 -q -- ;
|
||||||
|
}
|
||||||
|
|
||||||
|
git_commit () {
|
||||||
|
# create tracer branch if not existent
|
||||||
|
git branch $TRACER_BRANCH -q 2>/dev/null || true
|
||||||
|
# backup git index
|
||||||
|
cp -a .git/index $WORK_INDEX
|
||||||
|
# switch to tracer branch
|
||||||
|
git_soft_checkout "$TRACER_BRANCH"
|
||||||
|
# add files to commit
|
||||||
|
git add . -A --ignore-errors
|
||||||
|
# generate commit msg, commit changes in tracer branch
|
||||||
|
printf "> $1 \n $STUID $STUNAME \n $(uname -a) \n $(uptime)\n" | git commit -F - $GITFLAGS
|
||||||
|
git_soft_checkout "$WORK_BRANCH"
|
||||||
|
mv $WORK_INDEX .git/index
|
||||||
|
}
|
||||||
|
|
||||||
|
git_commit $1
|
||||||
|
|
|
@ -5,8 +5,8 @@ set (CMAKE_CXX_STANDARD 11)
|
||||||
cmake_policy(SET CMP0144 NEW)
|
cmake_policy(SET CMP0144 NEW)
|
||||||
|
|
||||||
execute_process(
|
execute_process(
|
||||||
COMMAND ${CMAKE_SOURCE_DIR}/../git_commit.sh "configure\ npc"
|
COMMAND ${CMAKE_SOURCE_DIR}/../git_commit.sh "configure npc"
|
||||||
WORKING_DIRECTORY ../
|
WORKING_DIRECTORY ${CMAKE_SOURCE_DIR}/..
|
||||||
)
|
)
|
||||||
|
|
||||||
find_package(SDL2 REQUIRED)
|
find_package(SDL2 REQUIRED)
|
||||||
|
|
Loading…
Reference in a new issue