git-svn: always use --first-parent
This makes git-svn unconditionally invoke git-log with --first-parent when it is trying to discover its upstream subversion branch and collecting the commit ids which should be pushed to it with dcommit. The reason for always using --first-parent is to make git-svn behave in a predictable way when the ancestry chain contains merges with other git-svn branches. Since git-svn now always uses 'git-log --first-parent' there is no longer any need for the --first-parent option to git-svn, so this is removed. Signed-off-by: Lars Hjemli <hjemli@gmail.com> Acked-by: Eric Wong <normalperson@yhbt.net> Signed-off-by: Junio C Hamano <gitster@pobox.com>
Lars Hjemli committed
Sep 7, 2007 at 02:00 UTC
4dbfe2e9bdfdde2d3257194573cee0d41471592b
2 files changed
+5
-22
Documentation/git-svn.txt
-10
@@ -317,16 +317,6 @@ This is only used with the 'dcommit' command.
317
Print out the series of git arguments that would show
318
which diffs would be committed to SVN.
319
320
---first-parent::
321
-
322
-This is only used with the 'dcommit', 'rebase', 'log', 'find-rev' and
323
-'show-ignore' commands.
324
-
325
-These commands tries to detect the upstream subversion branch by means of
326
-the embedded 'git-svn-id' line in commit messages. When --first-parent is
327
-specified, git-svn only follows the first parent of each commit, effectively
328
-ignoring commits brought into the current branch through merge-operations.
329
-
320
--
321
322
ADVANCED OPTIONS
git-svn.perl
+5
-12
@@ -59,7 +59,7 @@ my ($_stdin, $_help, $_edit,
59
$_template, $_shared,
60
$_version, $_fetch_all, $_no_rebase,
61
$_merge, $_strategy, $_dry_run, $_local,
62
- $_prefix, $_no_checkout, $_verbose, $_first_parent);
62
+ $_prefix, $_no_checkout, $_verbose);
63
$Git::SVN::_follow_parent = 1;
64
my %remote_opts = ( 'username=s' => \$Git::SVN::Prompt::_username,
65
'config-dir=s' => \$Git::SVN::Ra::config_dir,
@@ -119,14 +119,12 @@ my %cmd = (
119
'dry-run|n' => \$_dry_run,
120
'fetch-all|all' => \$_fetch_all,
121
'no-rebase' => \$_no_rebase,
122
- 'first-parent' => \$_first_parent,
122
%cmt_opts, %fc_opts } ],
123
'set-tree' => [ \&cmd_set_tree,
124
"Set an SVN repository to a git tree-ish",
125
{ 'stdin|' => \$_stdin, %cmt_opts, %fc_opts, } ],
126
'show-ignore' => [ \&cmd_show_ignore, "Show svn:ignore listings",
128
- { 'revision|r=i' => \$_revision,
129
- 'first-parent' => \$_first_parent
127
+ { 'revision|r=i' => \$_revision
128
} ],
129
'multi-fetch' => [ \&cmd_multi_fetch,
130
"Deprecated alias for $0 fetch --all",
@@ -147,20 +145,16 @@ my %cmd = (
145
'non-recursive' => \$Git::SVN::Log::non_recursive,
146
'authors-file|A=s' => \$_authors,
147
'color' => \$Git::SVN::Log::color,
150
- 'pager=s' => \$Git::SVN::Log::pager,
151
- 'first-parent' => \$_first_parent
148
+ 'pager=s' => \$Git::SVN::Log::pager
149
} ],
150
'find-rev' => [ \&cmd_find_rev, "Translate between SVN revision numbers and tree-ish",
154
- {
155
- 'first-parent' => \$_first_parent
156
- } ],
151
+ {} ],
152
'rebase' => [ \&cmd_rebase, "Fetch and rebase your working directory",
153
{ 'merge|m|M' => \$_merge,
154
'verbose|v' => \$_verbose,
155
'strategy|s=s' => \$_strategy,
156
'local|l' => \$_local,
157
'fetch-all|all' => \$_fetch_all,
163
- 'first-parent' => \$_first_parent,
158
%fc_opts } ],
159
'commit-diff' => [ \&cmd_commit_diff,
160
'Commit a diff between two trees',
@@ -818,8 +812,7 @@ sub cmt_metadata {
812
813
sub working_head_info {
814
my ($head, $refs) = @_;
821
- my @args = ('log', '--no-color');
822
- push @args, '--first-parent' if $_first_parent;
815
+ my @args = ('log', '--no-color', '--first-parent');
816
my ($fh, $ctx) = command_output_pipe(@args, $head);
817
my $hash;
818
my %max;