git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Simon 'corecode' Schubert <corecode@fs.ei.tum.de>
To: git@vger.kernel.org
Subject: [PATCH] Allow forcing of a parent commit, even if the parent is not a direct one.
Date: Thu, 01 Feb 2007 11:43:39 +0100	[thread overview]
Message-ID: <45C1C45B.1000003@fs.ei.tum.de> (raw)

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

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>
---
 Documentation/git-cvsexportcommit.txt |    5 ++++-
 git-cvsexportcommit.perl              |    6 +++---
 2 files changed, 7 insertions(+), 4 deletions(-)

diff --git a/Documentation/git-cvsexportcommit.txt b/Documentation/git-cvsexportcommit.txt
index 347cbce..27d531b 100644
--- a/Documentation/git-cvsexportcommit.txt
+++ b/Documentation/git-cvsexportcommit.txt
@@ -8,7 +8,7 @@ git-cvsexportcommit - Export a single commit to a CVS checkout
 
 SYNOPSIS
 --------
-'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
 
 
 DESCRIPTION
@@ -46,6 +46,9 @@ OPTIONS
 -f::
 	Force the merge even if the files are not up to date.
 
+-P::
+	Force the parent commit, even if it is not a direct parent.
+
 -m::
 	Prepend the commit message with the provided prefix. 
 	Useful for patch series and the like.
diff --git a/git-cvsexportcommit.perl b/git-cvsexportcommit.perl
index 4863c91..870554e 100755
--- a/git-cvsexportcommit.perl
+++ b/git-cvsexportcommit.perl
@@ -15,9 +15,9 @@ unless ($ENV{GIT_DIR} && -r $ENV{GIT_DIR}){
     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 );
 
-getopts('hpvcfam:');
+getopts('hPpvcfam:');
 
 $opt_h && usage();
 
@@ -89,7 +89,7 @@ if ($parent) {
 	    last;
 	}; # 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];
-- 
1.5.0.rc2.g544a



[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 252 bytes --]

                 reply	other threads:[~2007-02-01 10:43 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

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=45C1C45B.1000003@fs.ei.tum.de \
    --to=corecode@fs.ei.tum.de \
    --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).