From mboxrd@z Thu Jan 1 00:00:00 1970 From: Carl Worth Subject: [PATCH] git-rebase: Clarify usage statement and copy it into the actual documentation. Date: Tue, 21 Feb 2006 17:10:12 -0800 Message-ID: <87mzgkryff.wl%cworth@cworth.org> Mime-Version: 1.0 (generated by SEMI 1.14.6 - "Maruoka") Content-Type: multipart/signed; boundary="pgp-sign-Multipart_Tue_Feb_21_17:10:12_2006-1"; micalg=pgp-sha1; protocol="application/pgp-signature" Content-Transfer-Encoding: 7bit Cc: git@vger.kernel.org X-From: git-owner@vger.kernel.org Wed Feb 22 02:11:39 2006 Return-path: Envelope-to: gcvg-git@gmane.org Received: from vger.kernel.org ([209.132.176.167]) by ciao.gmane.org with esmtp (Exim 4.43) id 1FBiXa-0004fI-DT for gcvg-git@gmane.org; Wed, 22 Feb 2006 02:11:38 +0100 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1030313AbWBVBLf (ORCPT ); Tue, 21 Feb 2006 20:11:35 -0500 Received: (majordomo@vger.kernel.org) by vger.kernel.org id S1030312AbWBVBLf (ORCPT ); Tue, 21 Feb 2006 20:11:35 -0500 Received: from theworths.org ([217.160.253.102]:25232 "EHLO theworths.org") by vger.kernel.org with ESMTP id S1030313AbWBVBLe (ORCPT ); Tue, 21 Feb 2006 20:11:34 -0500 Received: (qmail 20794 invoked from network); 21 Feb 2006 20:11:32 -0500 Received: from localhost (HELO raht.cworth.org) (127.0.0.1) by localhost with SMTP; 21 Feb 2006 20:11:32 -0500 To: Junio C Hamano User-Agent: Wanderlust/2.14.0 (Africa) Emacs/21.4 Mule/5.0 (SAKAKI) Sender: git-owner@vger.kernel.org Precedence: bulk X-Mailing-List: git@vger.kernel.org Archived-At: --pgp-sign-Multipart_Tue_Feb_21_17:10:12_2006-1 Content-Type: text/plain; charset=US-ASCII I found a paper thin man page for git-rebase, but was quite happy to see something much more useful in the usage statement of the script when I went there to find out how this thing worked. Here it is cleaned up slightly and expanded a bit into the actual documentation. Signed-off-by: Carl Worth --- Drat. I just realized I've been neglecting the Signed-off-by: line in my last few patches. Junio, if you'd like me to re-send those with that fixed, just let me know. Documentation/git-rebase.txt | 44 ++++++++++++++++++++++++++++++++++++++++-- git-rebase.sh | 24 +++++++++++++---------- 2 files changed, 56 insertions(+), 12 deletions(-) f78b6a97afd562d2cf2d30488892ff893dd81a3b diff --git a/Documentation/git-rebase.txt b/Documentation/git-rebase.txt index 16c158f..f037d12 100644 --- a/Documentation/git-rebase.txt +++ b/Documentation/git-rebase.txt @@ -7,14 +7,54 @@ git-rebase - Rebase local commits to new SYNOPSIS -------- -'git-rebase' [] +'git-rebase' [--onto ] [] DESCRIPTION ----------- -Rebases local commits to the new head of the upstream tree. +git-rebase applies to (or optionally to ) commits +from that do not appear in . When is not +specified it defaults to the current branch (HEAD). + +When git-rebase is complete, will be updated to point to the +newly created line of commit objects, so the previous line will not be +accessible unless there are other references to it already. + +Assume the following history exists and the current branch is "topic": + + A---B---C topic + / + D---E---F---G master + +From this point, the result of the following commands: + + git-rebase master + git-rebase master topic + +would be: + + A'--B'--C' topic + / + D---E---F---G master + +While, starting from the same point, the result of the following +commands: + + git-rebase --onto master~1 master + git-rebase --onto master~1 master topic + +would be: + + A'--B'--C' topic + / + D---E---F---G master OPTIONS ------- +:: + Starting point at which to create the new commits. If the + --onto option is not specified, the starting point is + . + :: Upstream branch to compare against. diff --git a/git-rebase.sh b/git-rebase.sh index 21c3d83..211bf68 100755 --- a/git-rebase.sh +++ b/git-rebase.sh @@ -4,24 +4,28 @@ # USAGE='[--onto ] []' -LONG_USAGE='If is specified, switch to that branch first. Then, -extract commits in the current branch that are not in , -and reconstruct the current on top of , discarding the original -development history. If --onto is specified, the history is -reconstructed on top of , instead of . For example, -while on "topic" branch: +LONG_USAGE='git-rebase applies to (or optionally to ) commits +from that do not appear in . When is not +specified it defaults to the current branch (HEAD). + +When git-rebase is complete, will be updated to point to the +newly created line of commit objects, so the previous line will not be +accessible unless there are other references to it already. + +Assuming the following history: A---B---C topic / D---E---F---G master - $ '"$0"' --onto master~1 master topic +The result of the following command: -would rewrite the history to look like this: + git-rebase --onto master~1 master topic + would be: - A'\''--B'\''--C'\'' topic - / + A'\''--B'\''--C'\'' topic + / D---E---F---G master ' -- 1.2.2.g0a5f5-dirty --pgp-sign-Multipart_Tue_Feb_21_17:10:12_2006-1 Content-Type: application/pgp-signature Content-Transfer-Encoding: 7bit -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.2 (GNU/Linux) iD8DBQBD+7n06JDdNq8qSWgRAnnrAJ9PGF77HkXE5g9Yy2Zbf4Vz+Vt1QQCfRpjs LchBLow9+F1U4qCgr34Hx7A= =m3RO -----END PGP SIGNATURE----- --pgp-sign-Multipart_Tue_Feb_21_17:10:12_2006-1--