git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: ojab <ojab@ojab.ru>
To: git@vger.kernel.org
Subject: [PATCH] Fix `git svn rebase` if top-level HEAD directory exist
Date: Tue, 04 Jun 2013 11:32:56 +0400	[thread overview]
Message-ID: <51AD9828.7080508@ojab.ru> (raw)

[-- Attachment #1: Type: text/plain, Size: 446 bytes --]

Oh hai!
I have a svn repo with the top-level directory named HEAD and `git svn 
rebase [HEAD] [--]` fails with
> $ git svn rebase
> fatal: ambiguous argument 'HEAD': both revision and filename
> Use '--' to separate paths from revisions, like this:
> 'git <command> [<revision>...] -- [<file>...]'
> rev-list --first-parent --pretty=medium HEAD: command returned error: 128

Works fine with patch in the attached file. please review.

//wbr ojab

[-- Attachment #2: 0001-Fix-git-svn-rebase-if-top-level-HEAD-directory-exist.patch --]
[-- Type: text/plain, Size: 745 bytes --]

From 522cbc8b8a7c4f2ab4268551a550585753164677 Mon Sep 17 00:00:00 2001
From: ojab <ojab@ojab.ru>
Date: Tue, 4 Jun 2013 11:28:16 +0400
Subject: [PATCH] Fix `git svn rebase` if top-level HEAD directory exist
Signed-off-by: ojab <ojab@ojab.ru>

---
 git-svn.perl | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/git-svn.perl b/git-svn.perl
index d070de0..e35a66a 100755
--- a/git-svn.perl
+++ b/git-svn.perl
@@ -1932,7 +1932,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>) {
-- 
1.8.2


             reply	other threads:[~2013-06-04  7:33 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-06-04  7:32 ojab [this message]
2013-06-04  7:49 ` [PATCH] Fix `git svn rebase` if top-level HEAD directory exist Jeff King
2013-06-05  5:32   ` ojab

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=51AD9828.7080508@ojab.ru \
    --to=ojab@ojab.ru \
    --cc=git@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).