threads / patch / 3804

patchgit-commit: document --append

Subject: [PATCH] git-commit: document --append

## tl;dr

5 messages between Apr 5, 2006 and Apr 5, 2006. Diffs are folded; open one to read it.

replies: 4people: 2as markdown or json

Marco Roeland· Apr 5, 2006, 19:16 UTC · lore

The "--amend" option is used to amend the tip of the current branch. This documentation text was copied straight from the commit that implemented it.

Signed-off-by: Marco Roeland <marco.roeland@xs4all.nl>
---
 Documentation/git-commit.txt |   22 +++++++++++++++++++++-
 1 files changed, 21 insertions(+), 1 deletions(-)
ca7d3b4fdd0cb24b7353da312fb9306531468f54
Show changes to Documentation/git-commit.txt +21 −1
diff --git a/Documentation/git-commit.txt b/Documentation/git-commit.txt
index d04b342..3701cb3 100644
--- a/Documentation/git-commit.txt
+++ b/Documentation/git-commit.txt
@@ -9,7 +9,8 @@ SYNOPSIS
 --------
 [verse]
 'git-commit' [-a] [-s] [-v] [(-c | -C) <commit> | -F <file> | -m <msg>]
-	   [-e] [--author <author>] [--] [[-i | -o ]<file>...]
+	   [--no-verify] [--amend] [-e] [--author <author>]
+	   [--] [[-i | -o ]<file>...]
 
 DESCRIPTION
 -----------
@@ -70,6 +71,25 @@ OPTIONS
 	`-m`, and from file with `-C` are usually used as the
 	commit log message unmodified.  This option lets you
 	further edit the message taken from these sources.
+
+--amend::
+
+	Used to amend the tip of the current branch. Prepare the tree
+	object you would want to replace the latest commit as usual
+	(this includes the usual -i/-o and explicit paths), and the
+	commit log editor is seeded with the commit message from the
+	tip of the current branch. The commit you create replaces the
+	current tip -- if it was a merge, it will have the parents of
+	the current tip as parents -- so the current top commit is
+	discarded.
+
+	It is a rough equivalent for:
+
+		$ git reset --soft HEAD^
+		$ ... do something else to come up with the right tree ...
+		$ git commit -c ORIG_HEAD
+
+	but can be used to amend a merge commit.
 
 -i|--include::
 	Instead of committing only the files specified on the
-- 
1.3.0.rc2.gca38
Junio C Hamano· Apr 5, 2006, 19:34 UTC · re: Marco Roeland · lore

Re: [PATCH] git-commit: document --append

Thanks for resurrecting this.

I suspect that some formatting tweak is needed; I recall asciidoc needs some special formatting when multi- paragraph description is involved in the list.

Of course, munging the patch title with s/append/amend/ would not hurt ;-).

Marco Roeland· Apr 5, 2006, 19:46 UTC · re: Junio C Hamano · lore

Re: [PATCH] git-commit: document --append (amend really!)

On Wednesday April 5th 2006 Junio C Hamano wrote:
Show 5 quoted lines
> Thanks for resurrecting this.
> 
> I suspect that some formatting tweak is needed; I recall
> asciidoc needs some special formatting when multi- paragraph
> description is involved in the list.

Here with asciidoc 7.1.2 (Debian 'sid') it looks good in the generated man page. But I'll investigate if nobody beats me to it. Perhaps we should develop a "sparse" like module for asciidoc.

> Of course, munging the patch title with s/append/amend/ would
> not hurt ;-).

Oops. Well I suppose I could use "git commit --amend" and then run "git format-patch" again I suppose. ;-)

-- 
Marco Roeland
Junio C Hamano· Apr 5, 2006, 19:55 UTC · re: Marco Roeland · lore

Re: [PATCH] git-commit: document --append (amend really!)

Marco Roeland <marco.roeland@xs4all.nl> writes:
> Here with asciidoc 7.1.2 (Debian 'sid') it looks good in the generated
> man page. But I'll investigate if nobody beats me to it.
Please see below for an example.
> Oops. Well I suppose I could use "git commit --amend" and then run "git
> format-patch" again I suppose. ;-)
Yup ;-).
diff-tree b0d08a504bee17dfc46f761e166ff2c20c59a91a (from 3103cf9e1e09b0045a60542f24a2a1e4ed7b1237)
Author: Francis Daly <francis@daoine.org>
Date:   Wed Mar 22 09:53:57 2006 +0000
    Format tweaks for asciidoc.
    
    Some documentation "options" were followed by independent preformatted
    paragraphs. Now they are associated plain text paragraphs. The
    difference is clear in the generated html.
    
    Signed-off-by: Junio C Hamano <junkio@cox.net>
Show changes to Documentation/git-grep.txt +7 −7
diff --git a/Documentation/git-grep.txt b/Documentation/git-grep.txt
index fbd2394..d55456a 100644
--- a/Documentation/git-grep.txt
+++ b/Documentation/git-grep.txt
@@ -24,13 +24,13 @@ OPTIONS
 
 <option>...::
 	Either an option to pass to `grep` or `git-ls-files`.
-
-	The following are the specific `git-ls-files` options
-	that may be given: `-o`, `--cached`, `--deleted`, `--others`,
-	`--killed`, `--ignored`, `--modified`, `--exclude=*`,
-	`--exclude-from=*`, and `--exclude-per-directory=*`.
-
-	All other options will be passed to `grep`.
++
+The following are the specific `git-ls-files` options
+that may be given: `-o`, `--cached`, `--deleted`, `--others`,
+`--killed`, `--ignored`, `--modified`, `--exclude=\*`,
+`--exclude-from=\*`, and `--exclude-per-directory=\*`.
++
+All other options will be passed to `grep`.
 
 <pattern>::
 	The pattern to look for.  The first non option is taken
Marco Roeland· Apr 5, 2006, 20:28 UTC · re: Junio C Hamano · lore

[PATCH] git-commit: document --amend

The "--amend" option is used to amend the tip of the current branch. This documentation text was copied straight from the commit that implemented it.

Some minor format tweaks for asciidoc were taken from work by Francis Daly in commit b0d08a5.. It looks good now also in the html page.

Signed-off-by: Marco Roeland <marco.roeland@xs4all.nl>
---
 Documentation/git-commit.txt |   24 +++++++++++++++++++++++-
 1 files changed, 23 insertions(+), 1 deletions(-)
293dccf6f8c47294a42376ad96d8c1130b06c9b9
Show changes to Documentation/git-commit.txt +23 −1
diff --git a/Documentation/git-commit.txt b/Documentation/git-commit.txt
index d04b342..ec8b562 100644
--- a/Documentation/git-commit.txt
+++ b/Documentation/git-commit.txt
@@ -9,7 +9,8 @@ SYNOPSIS
 --------
 [verse]
 'git-commit' [-a] [-s] [-v] [(-c | -C) <commit> | -F <file> | -m <msg>]
-	   [-e] [--author <author>] [--] [[-i | -o ]<file>...]
+	   [--no-verify] [--amend] [-e] [--author <author>]
+	   [--] [[-i | -o ]<file>...]
 
 DESCRIPTION
 -----------
@@ -70,6 +71,27 @@ OPTIONS
 	`-m`, and from file with `-C` are usually used as the
 	commit log message unmodified.  This option lets you
 	further edit the message taken from these sources.
+
+--amend::
+
+	Used to amend the tip of the current branch. Prepare the tree
+	object you would want to replace the latest commit as usual
+	(this includes the usual -i/-o and explicit paths), and the
+	commit log editor is seeded with the commit message from the
+	tip of the current branch. The commit you create replaces the
+	current tip -- if it was a merge, it will have the parents of
+	the current tip as parents -- so the current top commit is
+	discarded.
++
+It is a rough equivalent for:
++
+$ git reset --soft HEAD^
++
+$ ... do something else to come up with the right tree ...
++
+$ git commit -c ORIG_HEAD
++
+but can be used to amend a merge commit.
 
 -i|--include::
 	Instead of committing only the files specified on the
-- 
1.3.0.rc2.gca38

← back to recent threads