Add support for Unix lookup by name to user-uid and user-gid
[sxemacs] / contrib / git-for-steve.sh
1 #!/bin/sh
2 #
3 # A script to setup your git area to contribute back to SXEmacs
4 #
5 # (C) 2008 Nelson Ferreira
6 #
7 # This program is free software; you can redistribute it and/or modify it
8 # under a BSD-like licence.
9 #
10 # Redistribution and use in source and binary forms, with or without
11 # modification, are permitted provided that the following conditions are met:
12 # Redistributions of source code must retain the above copyright notice, this
13 # list of conditions and the following disclaimer.
14 # Redistributions in binary form must reproduce the above copyright notice,
15 # this list of conditions and the following disclaimer in the documentation
16 # and/or other materials provided with the distribution.
17 # Neither the name of the Technical University of Berlin nor the names of its
18 # contributors may be used to endorse or promote products derived from this
19 # software without specific prior written permission.
20 #
21 # THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
22 # AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
23 # IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
24 # ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
25 # LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
26 # CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
27 # SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
28 # INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
29 # CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
30 # ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
31 # POSSIBILITY OF SUCH DAMAGE.
32 #
33 USER_EMAIL=$(git config user.email)
34 if [ -z "$USER_EMAIL" ]; then
35     echo "You need to setup your email address with:"
36     echo "    git config user.email <your email address>"
37     exit 1
38 fi
39 USER_NAME=$(git config user.name)
40 if [ -z "$USER_NAME" ]; then
41     echo "You need to configure git with your name:"
42     echo "    git config user.name \"John Doe\""
43     exit 1
44 fi
45 git branch --track for-steve origin/master
46 git checkout for-steve
47 echo ""
48 SIGNKEY=$(git config user.signingkey)
49 if [ -z "$SIGNKEY" ]; then
50     echo "OPTIONAL: You might wish to setup your GPG signing key:"
51     echo "    git config user.signingkey <GPG key signature>"
52 fi
53 CO_ALIAS=$(git config alias.co)
54 if [ -z "$CO_ALIAS" ]; then
55     echo "RECOMMENDED: It is recommended you define the 'co' alias"
56     echo "             to quickly switch betwen the master and "
57     echo "             for-steve branches."
58     echo "    git config alias.co checkout"
59 fi
60 REMOTE=$(git remote | grep -v origin)
61 if [ -z "$REMOTE" ]; then
62     echo "MANDATORY: You now must configure your remote repository "
63     echo "           location using:"
64     echo "    git remote add <myremote> <repository location>"
65     echo ""
66     echo "           We recommend that you use 'myremote' explicitly"
67     echo "           for the remote name, but it can be whatever name"
68     echo "           you wish, except origin"
69     echo "           The repository location can be either a git server"
70     echo "               git://example.com/sxemacs.git"
71     echo "           or an ssh accessible location:"
72     echo "               ssh://user@example.com/~/path/to/git"
73     echo "           in this last case it is VERY convenient that you "
74     echo "           setup SSH public key authentication."
75 else
76     echo "Please verify that one of these remotes is for your SXEmacs "
77     echo "public repository"
78     for r in $REMOTE; do
79         git remote show $r
80     done
81 fi
82 echo ""
83 echo "Make sure to read the SPPM for more information."
84 echo "Info node: (sppm)Setting up a publicly accessible repo"
85 echo ""