Commit ca28370a authored by Simon 'corecode' Schubert's avatar Simon 'corecode' Schubert Committed by Junio C Hamano

Allow forcing of a parent commit, even if the parent is not a direct one.

This can be used to compress multiple changesets into one, for example

	git cvsexportcommit -P cvshead mybranch

without having to do so in git first.
Signed-off-by: default avatarSimon 'corecode' Schubert <>
Signed-off-by: default avatarJunio C Hamano <>
parent 4c550686
......@@ -8,7 +8,7 @@ git-cvsexportcommit - Export a single commit to a CVS checkout
'git-cvsexportcommit' [-h] [-v] [-c] [-p] [-a] [-f] [-m msgprefix] [PARENTCOMMIT] COMMITID
'git-cvsexportcommit' [-h] [-v] [-c] [-P] [-p] [-a] [-f] [-m msgprefix] [PARENTCOMMIT] COMMITID
......@@ -46,6 +46,9 @@ OPTIONS
Force the merge even if the files are not up to date.
Force the parent commit, even if it is not a direct parent.
Prepend the commit message with the provided prefix.
Useful for patch series and the like.
......@@ -15,9 +15,9 @@
die "GIT_DIR is not defined or is unreadable";
our ($opt_h, $opt_p, $opt_v, $opt_c, $opt_f, $opt_a, $opt_m );
our ($opt_h, $opt_P, $opt_p, $opt_v, $opt_c, $opt_f, $opt_a, $opt_m );
$opt_h && usage();
......@@ -89,7 +89,7 @@
}; # found it
die "Did not find $parent in the parents for this commit!" if !$found;
die "Did not find $parent in the parents for this commit!" if !$found and !$opt_P;
} else { # we don't have a parent from the cmdline...
if (@parents == 1) { # it's safe to get it from the commit
$parent = $parents[0];
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment