git/list[1] front-page[2] threads[3] people[4] search[5] about
 

[PATCH] git-svn: fix --file/-F option in commit-diff

From
EWEric Wong <normalperson@yhbt.net>
Date
Jul 10, 2006, 03:20 UTC
Message-ID
<11525016483767-git-send-email-normalperson@yhbt.net>

Also, allow messages from tags to be used as commit messages.

Signed-off-by: Eric Wong <normalperson@yhbt.net>
---
 contrib/git-svn/git-svn.perl |    6 +++---
 1 files changed, 3 insertions(+), 3 deletions(-)
diff --git a/contrib/git-svn/git-svn.perl b/contrib/git-svn/git-svn.perl
index 8bc4188..7cbfb6e 100755
--- a/contrib/git-svn/git-svn.perl
+++ b/contrib/git-svn/git-svn.perl
@@ -760,7 +760,7 @@ sub commit_diff {
 		exit 1;
 	}
 	if (defined $_file) {
-		$_message = file_to_s($_message);
+		$_message = file_to_s($_file);
 	} else {
 		$_message ||= get_commit_message($tb,
 					"$GIT_DIR/.svn-commit.tmp.$$")->{msg};
@@ -1518,12 +1518,12 @@ sub get_commit_message {
 	open my $msg, '>', $commit_msg or croak $!;
 
 	chomp(my $type = `git-cat-file -t $commit`);
-	if ($type eq 'commit') {
+	if ($type eq 'commit' || $type eq 'tag') {
 		my $pid = open my $msg_fh, '-|';
 		defined $pid or croak $!;
 
 		if ($pid == 0) {
-			exec(qw(git-cat-file commit), $commit) or croak $!;
+			exec('git-cat-file', $type, $commit) or croak $!;
 		}
 		my $in_msg = 0;
 		while (<$msg_fh>) {
-- 
1.4.1.gda58
Message 1 of 1 in “git-svn: fix --file/-F option in commit-diff”
  1. git-svn: fix --file/-F option in commit-diffEric Wong, Jul 10, 2006

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.