Menu

[6834f0]: / tools / initial.sh  Maximize  Restore  History

Download this file

38 lines (33 with data), 765 Bytes

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
#!/bin/sh
TOPDIR=`pwd`
USERNAME=$1
if [ "x$1" = "x" ] ; then
echo "Usage: $0 <Username>"
exit 1
fi
add_remote()
{
remote_exist=`grep remote .git/config | grep review | wc -l`
if [ "x$remote_exist" = "x0" ] ; then
git remote add review ssh://$USERNAME@review.openocd.org:29418/openocd.git
git config remote.review.push HEAD:refs/for/master
else
echo "Remote review exists"
fi
}
update_commit_msg()
{
cd "${TOPDIR}/.git/hooks"
save_file=commit-msg-`date +%F-%T`
mv commit-msg $save_file
printf "%-30s" "Updating commit-msg"
status="OK"
wget -o log https://review.openocd.org/tools/hooks/commit-msg || status="FAIL"
echo $status
if [ $status = "FAIL" ] ; then
mv $save_file commit-msg
fi
chmod a+x commit-msg
}
add_remote
update_commit_msg
Want the latest updates on software, tech news, and AI?
Get latest updates about software, tech news, and AI from SourceForge directly in your inbox once a month.