]> git.madduck.net Git - code/myrepos.git/commitdiff

madduck's git repository

Every one of the projects in this repository is available at the canonical URL git://git.madduck.net/madduck/pub/<projectpath> — see each project's metadata for the exact URL.

All patches and comments are welcome. Please squash your changes to logical commits before using git-format-patch and git-send-email to patches@git.madduck.net. If you'd read over the Git project's submission guidelines and adhered to them, I'd be especially grateful.

SSH access, as well as push access can be individually arranged.

If you use my repositories frequently, consider adding the following snippet to ~/.gitconfig and using the third clone URL listed for each project:

[url "git://git.madduck.net/madduck/"]
  insteadOf = madduck:

mr register: default to registering the current directory
authorJoey Hess <joey@kodama.kitenet.net>
Sat, 13 Oct 2007 17:24:56 +0000 (13:24 -0400)
committerJoey Hess <joey@kodama.kitenet.net>
Sat, 13 Oct 2007 17:24:56 +0000 (13:24 -0400)
mr

diff --git a/mr b/mr
index c5efb749dd9cc2072744038e2743bfcc692a098d..b65e623f09192d7703d883190e335e7662463f5e 100755 (executable)
--- a/mr
+++ b/mr
@@ -18,7 +18,7 @@ B<mr> [options] diff
 
 B<mr> [options] log
 
 
 B<mr> [options] log
 
-B<mr> [options] register repository
+B<mr> [options] register [repository]
 
 B<mr> [options] config section [parameter=[value] ...]
 
 
 B<mr> [options] config section [parameter=[value] ...]
 
@@ -80,8 +80,9 @@ List the repositories that mr will act on.
 
 =item register
 
 
 =item register
 
-The next parameter is the directory of an existing repository. The
-repository will be registered in the mrconfig file.
+Register an existing repository in the mrconfig file. By default, the
+epository in the current directory is registered, or you can specify a
+directory to register.
 
 =item config
 
 
 =item config
 
@@ -710,13 +711,12 @@ log =                                                     \
                error "unknown repo type"               \
        fi
 register =                                                             \
                error "unknown repo type"               \
        fi
 register =                                                             \
-       if [ -z "$1" ]; then                                            \
-               error "repository directory not specified"              \
+       if [ -n "$1" ]; then                                            \
+               cd "$1"                                                 \
        fi                                                              \
        fi                                                              \
-       cd "$1"                                                         \
        basedir="$(basename $(pwd))"                                    \
        if [ -d .svn ]; then                                            \
        basedir="$(basename $(pwd))"                                    \
        if [ -d .svn ]; then                                            \
-               url=$(LANG=C svn info . |                                       \
+               url=$(LANG=C svn info . |                               \
                      grep -i ^URL: | cut -d ' ' -f 2)                  \
                if [ -z "$url" ]; then                                  \
                        error "cannot determine svn url"                \
                      grep -i ^URL: | cut -d ' ' -f 2)                  \
                if [ -z "$url" ]; then                                  \
                        error "cannot determine svn url"                \
@@ -724,7 +724,7 @@ register =                                                          \
                echo "Registering svn url: $url"                        \
                mr config "$(pwd)" checkout="svn co $url $basedir"      \
        elif [ -d .git ]; then                                          \
                echo "Registering svn url: $url"                        \
                mr config "$(pwd)" checkout="svn co $url $basedir"      \
        elif [ -d .git ]; then                                          \
-               url=$(LANG=C git-config --get remote.origin.url)                \
+               url=$(LANG=C git-config --get remote.origin.url)        \
                if [ -z "$url" ]; then                                  \
                        error "cannot determine git url"                \
                fi                                                      \
                if [ -z "$url" ]; then                                  \
                        error "cannot determine git url"                \
                fi                                                      \