Sync with 'maint'
[gitweb.git] / git-svn.perl
index 4e8275f3d1b6528f501cfa14fa9c6fd40ba63667..7349ffea5ad36f5677e7127fd693a72d155b1fa5 100755 (executable)
@@ -831,7 +831,7 @@ sub dcommit_rebase {
 sub cmd_dcommit {
        my $head = shift;
        command_noisy(qw/update-index --refresh/);
-       git_cmd_try { command_oneline(qw/diff-index --quiet HEAD/) }
+       git_cmd_try { command_oneline(qw/diff-index --quiet HEAD --/) }
                'Cannot dcommit with a dirty index.  Commit your changes first, '
                . "or stash them with `git stash'.\n";
        $head ||= 'HEAD';
@@ -1389,7 +1389,17 @@ sub cmd_multi_init {
                usage(1);
        }
 
-       $_prefix = '' unless defined $_prefix;
+       unless (defined $_prefix) {
+               $_prefix = '';
+               warn <<EOF
+WARNING: --prefix is not given, defaulting to empty prefix.
+         This is probably not what you want! In order to stay compatible
+         with regular remote-tracking refs, provide a prefix like
+         --prefix=origin/ (remember the trailing slash), which will cause
+         the SVN-tracking refs to be placed at refs/remotes/origin/*.
+NOTE: In Git v2.0, the default prefix will change from empty to 'origin/'.
+EOF
+       }
        if (defined $url) {
                $url = canonicalize_url($url);
                init_subdir(@_);
@@ -1759,7 +1769,7 @@ sub get_commit_entry {
                my $msgbuf = "";
                while (<$msg_fh>) {
                        if (!$in_msg) {
-                               $in_msg = 1 if (/^\s*$/);
+                               $in_msg = 1 if (/^$/);
                                $author = $1 if (/^author (.*>)/);
                        } elsif (/^git-svn-id: /) {
                                # skip this for now, we regenerate the
@@ -1932,7 +1942,7 @@ sub cmt_sha2rev_batch {
 sub working_head_info {
        my ($head, $refs) = @_;
        my @args = qw/rev-list --first-parent --pretty=medium/;
-       my ($fh, $ctx) = command_output_pipe(@args, $head);
+       my ($fh, $ctx) = command_output_pipe(@args, $head, "--");
        my $hash;
        my %max;
        while (<$fh>) {