Skip to content
Snippets Groups Projects
Commit bfdc5219 authored by Zihao Yu's avatar Zihao Yu
Browse files

init.sh: record the HEADs of each subproject in the initialization commit log

parent d5348589
No related branches found
No related tags found
No related merge requests found
#!/bin/bash #!/bin/bash
log=""
function init() { function init() {
if test -d $1; then if test -d $1; then
echo "$1 is already initialized, exiting..." echo "$1 is already initialized, exiting..."
...@@ -7,6 +9,7 @@ function init() { ...@@ -7,6 +9,7 @@ function init() {
fi fi
git clone -b ics2017 https://github.com/NJU-ProjectN/$1.git git clone -b ics2017 https://github.com/NJU-ProjectN/$1.git
log="$log$1 `cd $1 && git log --oneline --no-abbrev-commit -n1`"$'\n'
rm -rf $1/.git rm -rf $1/.git
if test $2; then if test $2; then
...@@ -25,7 +28,7 @@ case $input in ...@@ -25,7 +28,7 @@ case $input in
source ~/.bashrc source ~/.bashrc
git add -A git add -A
git commit -am "ics2017 initialized" git commit -am "ics2017 initialized"$'\n\n'"$log"
echo "Initialization finishes!" echo "Initialization finishes!"
;; ;;
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment