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

5 messages from 2006-04-05 to 2006-04-05. Participants: Marco Roeland, Junio C Hamano.
Thread: https://gitlist.dev/t/3804

## Marco Roeland, 2006-04-05 19:16

Subject: [PATCH] git-commit: document --append
Message-ID: <20060405191608.GA20572@fiberbit.xs4all.nl>
URL: https://gitlist.dev/e/20060405191608.GA20572%40fiberbit.xs4all.nl

```
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
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, 2006-04-05 19:34

Subject: Re: [PATCH] git-commit: document --append
Message-ID: <7vfykr24wi.fsf@assigned-by-dhcp.cox.net>
URL: https://gitlist.dev/e/7vfykr24wi.fsf%40assigned-by-dhcp.cox.net
In-Reply-To: <20060405191608.GA20572@fiberbit.xs4all.nl>

```
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, 2006-04-05 19:46

Subject: Re: [PATCH] git-commit: document --append (amend really!)
Message-ID: <20060405194607.GB20854@fiberbit.xs4all.nl>
URL: https://gitlist.dev/e/20060405194607.GB20854%40fiberbit.xs4all.nl
In-Reply-To: <7vfykr24wi.fsf@assigned-by-dhcp.cox.net>

```
On Wednesday April 5th 2006 Junio C Hamano wrote:

> 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, 2006-04-05 19:55

Subject: Re: [PATCH] git-commit: document --append (amend really!)
Message-ID: <7vacaz23wr.fsf@assigned-by-dhcp.cox.net>
URL: https://gitlist.dev/e/7vacaz23wr.fsf%40assigned-by-dhcp.cox.net
In-Reply-To: <20060405194607.GB20854@fiberbit.xs4all.nl>

```
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>

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, 2006-04-05 20:28

Subject: [PATCH] git-commit: document --amend
Message-ID: <20060405202828.GA21037@fiberbit.xs4all.nl>
URL: https://gitlist.dev/e/20060405202828.GA21037%40fiberbit.xs4all.nl
In-Reply-To: <7vacaz23wr.fsf@assigned-by-dhcp.cox.net>

```
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
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

```
