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 like git cvsexportcommit -P cvshead mybranch without having to do so in git first. Signed-off-by: Simon 'corecode' Schubert <corecode@fs.ei.tum.de> Signed-off-by: Junio C Hamano <junkio@cox.net>
Simon 'corecode' Schubert committed
Feb 1, 2007 at 11:43 UTC
ca28370a3567c14841c594b89fd62449abc166e6
2 files changed
+7
-4
Documentation/git-cvsexportcommit.txt
+4
-1
@@ -8,7 +8,7 @@ git-cvsexportcommit - Export a single commit to a CVS checkout
8
9
SYNOPSIS
10
--------
11
-'git-cvsexportcommit' [-h] [-v] [-c] [-p] [-a] [-f] [-m msgprefix] [PARENTCOMMIT] COMMITID
11
+'git-cvsexportcommit' [-h] [-v] [-c] [-P] [-p] [-a] [-f] [-m msgprefix] [PARENTCOMMIT] COMMITID
12
13
14
DESCRIPTION
@@ -46,6 +46,9 @@ OPTIONS
46
-f::
47
Force the merge even if the files are not up to date.
48
49
+-P::
50
+ Force the parent commit, even if it is not a direct parent.
51
+
52
-m::
53
Prepend the commit message with the provided prefix.
54
Useful for patch series and the like.
git-cvsexportcommit.perl
+3
-3
@@ -15,9 +15,9 @@ unless ($ENV{GIT_DIR} && -r $ENV{GIT_DIR}){
15
die "GIT_DIR is not defined or is unreadable";
16
}
17
18
-our ($opt_h, $opt_p, $opt_v, $opt_c, $opt_f, $opt_a, $opt_m );
18
+our ($opt_h, $opt_P, $opt_p, $opt_v, $opt_c, $opt_f, $opt_a, $opt_m );
19
20
-getopts('hpvcfam:');
20
+getopts('hPpvcfam:');
21
22
$opt_h && usage();
23
@@ -89,7 +89,7 @@ if ($parent) {
89
last;
90
}; # found it
91
}
92
- die "Did not find $parent in the parents for this commit!" if !$found;
92
+ die "Did not find $parent in the parents for this commit!" if !$found and !$opt_P;
93
} else { # we don't have a parent from the cmdline...
94
if (@parents == 1) { # it's safe to get it from the commit
95
$parent = $parents[0];