public inbox for git@vger.kernel.org 
 help / color / mirror / Atom feed
From: Sam Vilain <sam.vilain@catalyst•net.nz>
To: git@vger•kernel.org
Subject: [PATCH 5/5] git-commit: add --prior to set prior link
Date: Tue, 25 Apr 2006 16:31:07 +1200	[thread overview]
Message-ID: <20060425043107.18382.34865.stgit@localhost.localdomain> (raw)
In-Reply-To: <20060425035421.18382.51677.stgit@localhost.localdomain>

From: Sam Vilain <sam.vilain@catalyst•net.nz>

Add command-line support for --prior and add a description to the
ASCIIDOC
---

 Documentation/git-commit.txt |   10 ++++++++++
 git-commit.sh                |   19 +++++++++++++++++--
 2 files changed, 27 insertions(+), 2 deletions(-)

diff --git a/Documentation/git-commit.txt b/Documentation/git-commit.txt
index 6f2c495..ca5073c 100644
--- a/Documentation/git-commit.txt
+++ b/Documentation/git-commit.txt
@@ -10,6 +10,7 @@ SYNOPSIS
 [verse]
 'git-commit' [-a] [-s] [-v] [(-c | -C) <commit> | -F <file> | -m <msg>]
 	   [--no-verify] [--amend] [-e] [--author <author>]
+           [-p <commit>]
 	   [--] [[-i | -o ]<file>...]
 
 DESCRIPTION
@@ -106,6 +107,15 @@ but can be used to amend a merge commit.
 	index and the latest commit does not match on the
 	specified paths to avoid confusion.
 
+-p|--prior <commit>::
+	Specify a commit that this new commit is the next version of.
+        Use when you want a branch to supercede another branch, but
+        with a new commit history.  It is also use for sub-projects,
+        where commits on the parent tree mirror commits in the
+        sub-project.  <commit> does not have to exist in the local
+        repository, if it is specified as a full 40-digit hex SHA1
+        sum.  Otherwise it is parsed as a local revision.
+
 --::
 	Do not interpret any more arguments as options.
 
diff --git a/git-commit.sh b/git-commit.sh
index 26cd7ca..3feb60d 100755
--- a/git-commit.sh
+++ b/git-commit.sh
@@ -3,7 +3,7 @@ #
 # Copyright (c) 2005 Linus Torvalds
 # Copyright (c) 2006 Junio C Hamano
 
-USAGE='[-a] [-s] [-v] [--no-verify] [-m <message> | -F <logfile> | (-C|-c) <commit>) [--amend] [-e] [--author <author>] [[-i | -o] <path>...]'
+USAGE='[-a] [-s] [-v] [--no-verify] [-m <message> | -F <logfile> | (-C|-c) <commit>) [--amend] [-e] [--author <author>] [-p <commit>] [[-i | -o] <path>...]'
 SUBDIRECTORY_OK=Yes
 . git-sh-setup
 
@@ -200,6 +200,7 @@ log_given=
 log_message=
 verify=t
 verbose=
+prior=
 signoff=
 force_author=
 only_include_assumed=
@@ -344,6 +345,19 @@ do
       shift
       break
       ;;
+  -p|--p|--pr|--pri|--prio|--prior)
+      shift
+      prior="$1"
+      if echo $prior | perl -ne 'exit 1 unless /^[0-9a-f]{40}$/i'
+      then
+          prior=`echo "$prior" | tr '[A-Z]' '[a-z]'`
+      else
+	  prior=`git-rev-parse "$prior"`
+	  [ -n "$prior" ] || exit 1
+      fi
+      PRIOR="-r $prior"
+      shift
+      ;;
   -*)
       usage
       ;;
@@ -602,6 +616,7 @@ then
 		PARENTS=$(git-cat-file commit HEAD |
 			sed -n -e '/^$/q' -e 's/^parent /-p /p')
 	fi
+	
 	current=$(git-rev-parse --verify HEAD)
 else
 	if [ -z "$(git-ls-files)" ]; then
@@ -673,7 +688,7 @@ then
 		tree=$(GIT_INDEX_FILE="$TMP_INDEX" git-write-tree) &&
 		rm -f "$TMP_INDEX"
 	fi &&
-	commit=$(cat "$GIT_DIR"/COMMIT_MSG | git-commit-tree $tree $PARENTS) &&
+	commit=$(cat "$GIT_DIR"/COMMIT_MSG | git-commit-tree $tree $PARENTS $PRIOR) &&
 	git-update-ref HEAD $commit $current &&
 	rm -f -- "$GIT_DIR/MERGE_HEAD" &&
 	if test -f "$NEXT_INDEX"

  parent reply	other threads:[~2006-04-25  4:32 UTC|newest]

Thread overview: 63+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2006-04-25  3:54 [RFC] [PATCH 0/5] Implement 'prior' commit object links Sam Vilain
2006-04-25  4:31 ` [PATCH 1/5] add 'prior' link in commit structure Sam Vilain
2006-04-25  5:18   ` Junio C Hamano
2006-04-25  4:31 ` [PATCH 2/5] git-merge-base: follow 'prior' links to find merge bases Sam Vilain
2006-04-25  5:19   ` Junio C Hamano
2006-04-25  4:31 ` [PATCH 4/5] git-commit-tree: add support for prior Sam Vilain
2006-04-25  4:31 ` [PATCH 3/5] commit.c: parse 'prior' link Sam Vilain
2006-04-25  4:31 ` Sam Vilain [this message]
2006-04-25  4:34 ` [RFC] [PATCH 0/5] Implement 'prior' commit object links Sam Vilain
2006-04-25  5:16 ` Junio C Hamano
2006-04-25 23:19   ` Sam Vilain
2006-04-26  5:06     ` Jakub Narebski
2006-04-26  5:22       ` Jakub Narebski
2006-04-26  5:36         ` [OT] " Junio C Hamano
2006-04-26  6:35           ` Jakub Narebski
2006-04-26  6:50             ` Junio C Hamano
2006-04-26  7:22               ` Jakub Narebski
2006-04-26  7:50                 ` Junio C Hamano
2006-04-26  8:44                   ` Jakub Narebski
2006-04-26  9:21                     ` Junio C Hamano
2006-04-26  9:28                   ` Jakub Narebski
2006-04-26  6:51       ` Sam Vilain
2006-04-25  6:44 ` [RFC] [PATCH 0/5] Implement 'prior' commit object links (and other commit links ideas) Jakub Narebski
2006-04-25  7:29   ` Junio C Hamano
2006-04-25  7:43     ` Jakub Narebski
     [not found]       ` <20060425043436.2ff53318.seanlkml@sympatico.ca>
2006-04-25  8:34         ` sean
     [not found]         ` <20060425045752.0c6fbc21.seanlkml@sympatico.ca>
2006-04-25  8:57           ` sean
2006-04-25  9:10             ` Jakub Narebski
2006-04-25  9:58               ` Junio C Hamano
2006-04-25 10:08                 ` Jakub Narebski
2006-04-29 14:59                   ` Jakub Narebski
2006-04-25 15:21     ` Linus Torvalds
2006-04-25 15:40       ` Linus Torvalds
     [not found]         ` <20060425121700.2d1a0032.seanlkml@sympatico.ca>
2006-04-25 16:17           ` sean
2006-04-25 17:04             ` Linus Torvalds
2006-04-26 11:25             ` Andreas Ericsson
2006-04-26 12:01               ` Jakub Narebski
2006-04-25 16:27         ` Jakub Narebski
2006-04-25 17:11           ` Linus Torvalds
2006-04-25 17:36             ` Jakub Narebski
2006-04-25 17:57               ` Linus Torvalds
2006-04-25 18:06                 ` Linus Torvalds
2006-04-25 18:24                   ` Jakub Narebski
     [not found]             ` <20060425135250.5fd889f4.seanlkml@sympatico.ca>
2006-04-25 17:52               ` sean
2006-04-25 18:08                 ` Linus Torvalds
     [not found]                   ` <20060425141412.5c115f51.seanlkml@sympatico.ca>
2006-04-25 18:14                     ` sean
2006-04-25 18:26                       ` Linus Torvalds
2006-04-25 18:41                         ` Jakub Narebski
2006-04-25 18:52                           ` Linus Torvalds
2006-04-25 19:00                             ` Jakub Narebski
2006-04-25 22:17                               ` Jason Riedy
     [not found]                         ` <20060425144525.3ef957cf.seanlkml@sympatico.ca>
2006-04-25 18:45                           ` sean
2006-04-25 19:00                             ` Linus Torvalds
2006-04-25 19:18                               ` Junio C Hamano
2006-04-25 19:34                                 ` Linus Torvalds
2006-04-25 19:51                                   ` Junio C Hamano
2006-04-25 19:58                                     ` Linus Torvalds
2006-04-26 12:42                                 ` Jakub Narebski
2006-04-25 19:00                         ` Junio C Hamano
2006-04-25 19:09                           ` Linus Torvalds
2006-04-25 18:34                       ` Jakub Narebski
2006-04-25 23:18     ` Sam Vilain
2006-04-25 15:10 ` [RFC] [PATCH 0/5] Implement 'prior' commit object links Linus Torvalds

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=20060425043107.18382.34865.stgit@localhost.localdomain \
    --to=sam.vilain@catalyst$(echo .)net.nz \
    --cc=git@vger$(echo .)kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html
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