]> git.madduck.net Git - code/myrepos.git/blobdiff - mr

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:

capitalise sentence
[code/myrepos.git] / mr
diff --git a/mr b/mr
index 87618a22809a33ef03024528d19aa0ceb6c585be..2247e52a2bc0d8eaa078ada6951d72fc886bd124 100755 (executable)
--- a/mr
+++ b/mr
@@ -167,6 +167,12 @@ Be quiet.
 Expand the statistics line displayed at the end to include information
 about exactly which repositories failed and were skipped, if any.
 
 Expand the statistics line displayed at the end to include information
 about exactly which repositories failed and were skipped, if any.
 
+=item -i
+
+Interactive mode. If a repository fails to be processed, a subshell will be
+started which you can use to resolve or investigate the problem. Exit the
+subshell to continue the mr run.
+
 =item -n [number]
 
 If no number if specified, just operate on the repository for the current
 =item -n [number]
 
 If no number if specified, just operate on the repository for the current
@@ -333,6 +339,7 @@ my $config_overridden=0;
 my $verbose=0;
 my $quiet=0;
 my $stats=0;
 my $verbose=0;
 my $quiet=0;
 my $stats=0;
+my $interactive=0;
 my $max_depth;
 my $no_chdir=0;
 my $jobs=1;
 my $max_depth;
 my $no_chdir=0;
 my $jobs=1;
@@ -598,6 +605,11 @@ sub record { #{{{
                print "\n";
        }
        elsif ($ret == FAILED) {
                print "\n";
        }
        elsif ($ret == FAILED) {
+               if ($interactive) {
+                       chdir($dir) unless $no_chdir;
+                       print STDERR "mr: Starting interactive shell. Exit shell to continue.\n";
+                       system((getpwuid($<))[8]);
+               }
                push @failed, $dir;
                print "\n";
        }
                push @failed, $dir;
                print "\n";
        }
@@ -1072,6 +1084,7 @@ sub getopts { #{{{
                "v|verbose" => \$verbose,
                "q|quiet" => \$quiet,
                "s|stats" => \$stats,
                "v|verbose" => \$verbose,
                "q|quiet" => \$quiet,
                "s|stats" => \$stats,
+               "i|interactive" => \$interactive,
                "n|no-recurse:i" => \$max_depth,
                "j|jobs:i" => \$jobs,
        );
                "n|no-recurse:i" => \$max_depth,
                "j|jobs:i" => \$jobs,
        );
@@ -1183,12 +1196,7 @@ git_bare_test =
        test "`GIT_CONFIG="$MR_REPO"/config git config --get core.bare`" = true
 
 svn_update = svn update "$@"
        test "`GIT_CONFIG="$MR_REPO"/config git config --get core.bare`" = true
 
 svn_update = svn update "$@"
-git_update =
-       if [ "$@" ]; then
-               git pull "$@"
-       else
-               git pull
-       fi
+git_update = git pull "$@"
 bzr_update = bzr merge "$@"
 cvs_update = cvs update "$@"
 hg_update  = hg pull "$@" && hg update "$@"
 bzr_update = bzr merge "$@"
 cvs_update = cvs update "$@"
 hg_update  = hg pull "$@" && hg update "$@"