tools/initial.sh
authorUlf Samuelsson <ulf@emagii.com>
Tue, 20 Dec 2011 14:16:08 +0000 (15:16 +0100)
committerSpencer Oliver <spen@spen-soft.co.uk>
Wed, 4 Apr 2012 08:51:17 +0000 (08:51 +0000)
Small script to setup Gerrit with the local repository

Usage: tools/initial.sh <username>

Change-Id: I26527c35cfe040c7752efec06064d5dc9e3ec6a2
Signed-off-by: Ulf Samuelsson <ulf@emagii.com>
Signed-off-by: Attila Kinali <attila@kinali.ch>
Reviewed-on: http://openocd.zylin.com/290
Tested-by: jenkins
Reviewed-by: Spencer Oliver <spen@spen-soft.co.uk>
HACKING
tools/initial.sh [new file with mode: 0755]

diff --git a/HACKING b/HACKING
index d6a6b5b835033fb42d94940a492462f735846664..9e7b92ac2294c46ca10dbe9a6af7aaa4f8ff8dda 100644 (file)
--- a/HACKING
+++ b/HACKING
@@ -86,6 +86,11 @@ wget http://openocd.zylin.com/tools/hooks/commit-msg
 mv commit-msg .git/hooks
 chmod +x .git/hooks/commit-msg
 @endcode
 mv commit-msg .git/hooks
 chmod +x .git/hooks/commit-msg
 @endcode
+@b NOTE A script exists to simplify the two items above. execute:
+@code
+tools/initial.sh <username>
+@endcode
+With <username> being your Gerrit username.
 -# Set up git with your name and email:
 @code
 git config --global user.name "John Smith"
 -# Set up git with your name and email:
 @code
 git config --global user.name "John Smith"
diff --git a/tools/initial.sh b/tools/initial.sh
new file mode 100755 (executable)
index 0000000..c183d01
--- /dev/null
@@ -0,0 +1,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@openocd.zylin.com: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     http://openocd.zylin.com/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

Linking to existing account procedure

If you already have an account and want to add another login method you MUST first sign in with your existing account and then change URL to read https://review.openocd.org/login/?link to get to this page again but this time it'll work for linking. Thank you.

SSH host keys fingerprints

1024 SHA256:YKx8b7u5ZWdcbp7/4AeXNaqElP49m6QrwfXaqQGJAOk gerrit-code-review@openocd.zylin.com (DSA)
384 SHA256:jHIbSQa4REvwCFG4cq5LBlBLxmxSqelQPem/EXIrxjk gerrit-code-review@openocd.org (ECDSA)
521 SHA256:UAOPYkU9Fjtcao0Ul/Rrlnj/OsQvt+pgdYSZ4jOYdgs gerrit-code-review@openocd.org (ECDSA)
256 SHA256:A13M5QlnozFOvTllybRZH6vm7iSt0XLxbA48yfc2yfY gerrit-code-review@openocd.org (ECDSA)
256 SHA256:spYMBqEYoAOtK7yZBrcwE8ZpYt6b68Cfh9yEVetvbXg gerrit-code-review@openocd.org (ED25519)
+--[ED25519 256]--+
|=..              |
|+o..   .         |
|*.o   . .        |
|+B . . .         |
|Bo. = o S        |
|Oo.+ + =         |
|oB=.* = . o      |
| =+=.+   + E     |
|. .=o   . o      |
+----[SHA256]-----+
2048 SHA256:0Onrb7/PHjpo6iVZ7xQX2riKN83FJ3KGU0TvI0TaFG4 gerrit-code-review@openocd.zylin.com (RSA)