# [PATCH 8/17] Documentation/git-cherry-pick: Add --replay and --no-commit.

12 messages from 2005-12-08 to 2005-12-09. Participants: Nikolai Weibull, Junio C Hamano, Peter Eriksen.
Thread: https://gitlist.dev/t/2783

## Nikolai Weibull, 2005-12-08 23:28

Subject: [PATCH 8/17] Documentation/git-cherry-pick: Add --replay and --no-commit.
Message-ID: <11340844851758-git-send-email-mailing-lists.git@rawuncut.elitemail.org>
URL: https://gitlist.dev/e/11340844851758-git-send-email-mailing-lists.git%40rawuncut.elitemail.org
In-Reply-To: <1134084485683-git-send-email-mailing-lists.git@rawuncut.elitemail.org>

```
Signed-off-by: Nikolai Weibull <nikolai@bitwi.se>

---

 Documentation/git-cherry-pick.txt |    4 ++--
 1 files changed, 2 insertions(+), 2 deletions(-)

e0a7bc3c18f904afade2da6146aeba4c5aa68340
diff --git a/Documentation/git-cherry-pick.txt b/Documentation/git-cherry-pick.txt
index a7a883b..744f2c9 100644
--- a/Documentation/git-cherry-pick.txt
+++ b/Documentation/git-cherry-pick.txt
@@ -24,7 +24,7 @@ OPTIONS
 	With this option, `git-cherry-pick` will let you edit the commit
 	message prior committing.
 
--r::
+-r|--replay::
 	Usually the command appends which commit was
 	cherry-picked after the original commit message when
 	making a commit.  This option, '--replay', causes it to
@@ -32,7 +32,7 @@ OPTIONS
 	when you are reordering the patches in your private tree
 	before publishing.
 
--n::
+-n|--no-commit::
 	Usually the command automatically creates a commit with
 	a commit log message stating which commit was
 	cherry-picked.  This flag applies the change necessary
-- 
0.99.9l

```

## Nikolai Weibull, 2005-12-08 23:28

Subject: [PATCH 7/17] Documentation/git-cvsimport.txt: Fix a slight glitch in description heading.
Message-ID: <1134084485683-git-send-email-mailing-lists.git@rawuncut.elitemail.org>
URL: https://gitlist.dev/e/1134084485683-git-send-email-mailing-lists.git%40rawuncut.elitemail.org
In-Reply-To: <1134084485869-git-send-email-mailing-lists.git@rawuncut.elitemail.org>

```
Signed-off-by: Nikolai Weibull <nikolai@bitwi.se>

---

 Documentation/git-cvsimport.txt |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

98723ba21e0ffdbfc183a2b878938ab17744317d
diff --git a/Documentation/git-cvsimport.txt b/Documentation/git-cvsimport.txt
index 88bd3b0..f89b251 100644
--- a/Documentation/git-cvsimport.txt
+++ b/Documentation/git-cvsimport.txt
@@ -60,7 +60,7 @@ the old cvs2git tool.
 +
 If you need to pass multiple options, separate them with a comma.
 
--P:: <cvsps-output-file>
+-P <cvsps-output-file>::
 	Instead of calling cvsps, read the provided cvsps output file. Useful
 	for debugging or when cvsps is being handled outside cvsimport.
 
-- 
0.99.9l

```

## Nikolai Weibull, 2005-12-08 23:28

Subject: [PATCH 6/17] Document the [<head>...] and -- arguments to git-prune.
Message-ID: <1134084485869-git-send-email-mailing-lists.git@rawuncut.elitemail.org>
URL: https://gitlist.dev/e/1134084485869-git-send-email-mailing-lists.git%40rawuncut.elitemail.org
In-Reply-To: <1134084485547-git-send-email-mailing-lists.git@rawuncut.elitemail.org>

```
The documentation for git-prune was lacking descriptions of the head
arguments and the -- option.

Signed-off-by: Nikolai Weibull <nikolai@bitwi.se>

---

 Documentation/git-prune.txt |   10 +++++++++-
 1 files changed, 9 insertions(+), 1 deletions(-)

b4491eee9b9e371f4c9ea65c93be998a4f37498c
diff --git a/Documentation/git-prune.txt b/Documentation/git-prune.txt
index 3367c9b..04cea76 100644
--- a/Documentation/git-prune.txt
+++ b/Documentation/git-prune.txt
@@ -8,7 +8,7 @@ git-prune - Prunes all unreachable objec
 
 SYNOPSIS
 --------
-'git-prune' [-n]
+'git-prune' [-n] [--] [<head>...]
 
 DESCRIPTION
 -----------
@@ -26,7 +26,15 @@ OPTIONS
 -n::
 	Do not remove anything; just report what it would
 	remove.
+--::
+	Do not interpret any more arguments as options.
 
+<head>...::
+        The heads to look for unreachable objects in.  This is
+        relative to $GIT_DIR (e.g., "HEAD", "refs/heads/master").
+        When unspecified, all heads are updated to match the
+        remote repository.
+        
 
 Author
 ------
-- 
0.99.9l

```

## Nikolai Weibull, 2005-12-08 23:28

Subject: [PATCH 5/17] Documentation/git-verify-pack.txt: added documentation for --.
Message-ID: <1134084485547-git-send-email-mailing-lists.git@rawuncut.elitemail.org>
URL: https://gitlist.dev/e/1134084485547-git-send-email-mailing-lists.git%40rawuncut.elitemail.org
In-Reply-To: <11340844853670-git-send-email-mailing-lists.git@rawuncut.elitemail.org>

```
The -- option has been added to the documentation of git-verify-pack.

Signed-off-by: Nikolai Weibull <nikolai@bitwi.se>

---

 Documentation/git-verify-pack.txt |    4 +++-
 1 files changed, 3 insertions(+), 1 deletions(-)

ab7a137fa6d4629578c0d2b580189d58d556fa13
diff --git a/Documentation/git-verify-pack.txt b/Documentation/git-verify-pack.txt
index cd74ffd..d032280 100644
--- a/Documentation/git-verify-pack.txt
+++ b/Documentation/git-verify-pack.txt
@@ -8,7 +8,7 @@ git-verify-pack - Validate packed git ar
 
 SYNOPSIS
 --------
-'git-verify-pack' [-v] <pack>.idx ...
+'git-verify-pack' [-v] [--] <pack>.idx ...
 
 
 DESCRIPTION
@@ -25,6 +25,8 @@ OPTIONS
 -v::
 	After verifying the pack, show list of objects contained
 	in the pack.
+--::
+	Do not interpret any more arguments as options.
 
 OUTPUT FORMAT
 -------------
-- 
0.99.9l

```

## Nikolai Weibull, 2005-12-08 23:28

Subject: [PATCH 4/17] Documentation/git-commit.txt: Add long options and -- to documentation.
Message-ID: <11340844853670-git-send-email-mailing-lists.git@rawuncut.elitemail.org>
URL: https://gitlist.dev/e/11340844853670-git-send-email-mailing-lists.git%40rawuncut.elitemail.org
In-Reply-To: <11340844852030-git-send-email-mailing-lists.git@rawuncut.elitemail.org>

```
Added the following long options to documentation:

* --all
* --signoff
* --verify
* --no-verify
* --edit

Also added documentation for the -- option for terminating option parsing.

Signed-off-by: Nikolai Weibull <nikolai@bitwi.se>

---

 Documentation/git-commit.txt |   18 ++++++++++++------
 1 files changed, 12 insertions(+), 6 deletions(-)

f0cc0137f124e36fd31acb8d0d543bdc84923586
diff --git a/Documentation/git-commit.txt b/Documentation/git-commit.txt
index 1edc278..b92cf48 100644
--- a/Documentation/git-commit.txt
+++ b/Documentation/git-commit.txt
@@ -7,7 +7,7 @@ git-commit - Record your changes
 
 SYNOPSIS
 --------
-'git-commit' [-a] [-s] [-v] [(-c | -C) <commit> | -F <file> | -m <msg>] [-e] <file>...
+'git-commit' [-a] [-s] [-v] [(-c | -C) <commit> | -F <file> | -m <msg>] [-e] [--] <file>...
 
 DESCRIPTION
 -----------
@@ -22,7 +22,7 @@ information.
 
 OPTIONS
 -------
--a::
+-a|--all::
 	Update all paths in the index file.
 
 -c or -C <commit>::
@@ -39,23 +39,29 @@ OPTIONS
 -m <msg>::
 	Use the given <msg> as the commit message.
 
--s::
+-s|--signoff::
 	Add Signed-off-by line at the end of the commit message.
 
--v::
+-v|--verify::
 	Look for suspicious lines the commit introduces, and
 	abort committing if there is one.  The definition of
 	'suspicious lines' is currently the lines that has
 	trailing whitespaces, and the lines whose indentation
 	has a SP character immediately followed by a TAB
-	character.
+	character.  This is the default.
 
--e::
+-n|--no-verify::
+	The opposite of `--verify`.
+
+-e|--edit::
 	The message taken from file with `-F`, command line with
 	`-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.
 
+--::
+	Do not interpret any more arguments as options.
+
 <file>...::
 	Update specified paths in the index file before committing.
 
-- 
0.99.9l

```

## Junio C Hamano, 2005-12-08 23:49

Subject: Re: [PATCH 6/17] Document the [<head>...] and -- arguments to git-prune.
Message-ID: <7v4q5jb149.fsf@assigned-by-dhcp.cox.net>
URL: https://gitlist.dev/e/7v4q5jb149.fsf%40assigned-by-dhcp.cox.net
In-Reply-To: <1134084485869-git-send-email-mailing-lists.git@rawuncut.elitemail.org>

```
Nikolai Weibull <mailing-lists.git@rawuncut.elitemail.org> writes:

> The documentation for git-prune was lacking descriptions of the head
> arguments and the -- option.
>
> +<head>...::
> +        The heads to look for unreachable objects in.  This is
> +        relative to $GIT_DIR (e.g., "HEAD", "refs/heads/master").
> +        When unspecified, all heads are updated to match the
> +        remote repository.

? updated to match???

All others look very good.  Thanks for taking time to do this;
very much appreciated.

```

## Junio C Hamano, 2005-12-08 23:56

Subject: Re: [PATCH 6/17] Document the [<head>...] and -- arguments to git-prune.
Message-ID: <7vzmnb9m7w.fsf@assigned-by-dhcp.cox.net>
URL: https://gitlist.dev/e/7vzmnb9m7w.fsf%40assigned-by-dhcp.cox.net
In-Reply-To: <7v4q5jb149.fsf@assigned-by-dhcp.cox.net>

```
Junio C Hamano <junkio@cox.net> writes:

> Nikolai Weibull <mailing-lists.git@rawuncut.elitemail.org> writes:
>
>> The documentation for git-prune was lacking descriptions of the head
>> arguments and the -- option.
>>
>> +<head>...::
>> +        The heads to look for unreachable objects in.  This is
>> +        relative to $GIT_DIR (e.g., "HEAD", "refs/heads/master").
>> +        When unspecified, all heads are updated to match the
>> +        remote repository.
>
> ? updated to match???

Come to think of it, why would anybody want to pass heads
explicitly?  It seems to me that it would allow you to _lose_
objects referenced only from omitted branches...

```

## Junio C Hamano, 2005-12-09 00:28

Subject: Re: [PATCH 6/17] Document the [<head>...] and -- arguments to git-prune.
Message-ID: <7voe3r9krf.fsf@assigned-by-dhcp.cox.net>
URL: https://gitlist.dev/e/7voe3r9krf.fsf%40assigned-by-dhcp.cox.net
In-Reply-To: <7vzmnb9m7w.fsf@assigned-by-dhcp.cox.net>

```
Junio C Hamano <junkio@cox.net> writes:

> Come to think of it, why would anybody want to pass heads
> explicitly?  It seems to me that it would allow you to _lose_
> objects referenced only from omitted branches...

Not replacing but always including our own refs may be more
desirable (and unarguably much safer), but at the same time I
have a suspicion that that might be forbidding a useful usage I
haven't thought of, so...

---
diff --git a/Documentation/git-prune.txt b/Documentation/git-prune.txt
index 3367c9b..05c8d49 100644
--- a/Documentation/git-prune.txt
+++ b/Documentation/git-prune.txt
@@ -8,7 +8,7 @@ git-prune - Prunes all unreachable objec
 
 SYNOPSIS
 --------
-'git-prune' [-n]
+'git-prune' [-n] [--] [<head>...]
 
 DESCRIPTION
 -----------
@@ -27,6 +27,34 @@ OPTIONS
 	Do not remove anything; just report what it would
 	remove.
 
+--::
+	Do not interpret any more arguments as options.
+
+<head>...::
+	Instead of keeping objects
+	reachable from any of our references, keep objects
+	reachable from only listed <head>s.
++
+Note that the explicitly named <head>s are *not* appended to the
+default set of references, but they replace them.  In general you
+would want to say `git prune $(git-rev-parse --all) extra1
+extra2` to keep chains of commits leading to extra1, extra2,
+... in addition to what are reachable from your own refs.
+Saying `git prune extra1 extra2` would *lose* objects reachable
+only from the usual refs, which is usually not what you want.
+
+
+EXAMPLE
+-------
+
+To prune objects not used by your repository and another that
+borrows from your repository via its
+`.git/objects/info/alternates`:
+
+------------
+$ git prune $(git-rev-parse --all) \
+  $(cd ../another && $(git-rev-parse --all))
+------------
 
 Author
 ------

```

## Nikolai Weibull, 2005-12-09 00:50

Subject: Re: [PATCH 6/17] Document the [<head>...] and -- arguments to git-prune.
Message-ID: <20051209005025.GA8932@puritan.petwork>
URL: https://gitlist.dev/e/20051209005025.GA8932%40puritan.petwork
In-Reply-To: <7vzmnb9m7w.fsf@assigned-by-dhcp.cox.net>

```
Junio C Hamano wrote:

> Junio C Hamano <junkio@cox.net> writes:

> > Nikolai Weibull <mailing-lists.git@rawuncut.elitemail.org> writes:

> > > The documentation for git-prune was lacking descriptions of the head
> > > arguments and the -- option.
> > >
> > > +<head>...::
> > > +        The heads to look for unreachable objects in.  This is
> > > +        relative to $GIT_DIR (e.g., "HEAD", "refs/heads/master").
> > > +        When unspecified, all heads are updated to match the
> > > +        remote repository.

> > ? updated to match???

> Come to think of it, why would anybody want to pass heads explicitly?
> It seems to me that it would allow you to _lose_ objects referenced
> only from omitted branches...
 
Sorry.  I have no idea why I pasted in that description.  How about:

<head>...::
        A head to use for an unreachability trace.

(This mimics the description of <object> in git-fsck-objects.)

        nikolai

-- 
Nikolai Weibull: now available free of charge at http://bitwi.se/!
Born in Chicago, IL USA; currently residing in Gothenburg, Sweden.
main(){printf(&linux["\021%six\012\0"],(linux)["have"]+"fun"-97);}

```

## Junio C Hamano, 2005-12-09 07:25

Subject: [RFC/PATCH] git-prune: never lose objects reachable from our refs.
Message-ID: <7vmzja91gp.fsf_-_@assigned-by-dhcp.cox.net>
URL: https://gitlist.dev/e/7vmzja91gp.fsf_-_%40assigned-by-dhcp.cox.net
In-Reply-To: <7voe3r9krf.fsf@assigned-by-dhcp.cox.net>

```
Explicit <head> arguments to git-prune replaces, instead of
extends, the list of heads used for reachability analysis by
fsck-objects.  By giving a subset of heads by mistake, objects
reachable only from other heads can be removed, resulting in a
corrupted repository.

This commit stops replacing the list of heads, and makes the
command line arguments to add to them instead for safety.

Signed-off-by: Junio C Hamano <junkio@cox.net>

---

 * I think this is preferable in general than leaving the
   end-user tool too sharp-edged and dangerous.

 Documentation/git-prune.txt |   27 +++++++++------------------
 git-prune.sh                |    6 +++++-
 2 files changed, 14 insertions(+), 19 deletions(-)

2b86976bfd6e42609692d57fffaef72bd985c23a
diff --git a/Documentation/git-prune.txt b/Documentation/git-prune.txt
index 05c8d49..f694fcb 100644
--- a/Documentation/git-prune.txt
+++ b/Documentation/git-prune.txt
@@ -13,10 +13,11 @@ SYNOPSIS
 DESCRIPTION
 -----------
 
-This runs `git-fsck-objects --unreachable` using the heads
-specified on the command line (or `$GIT_DIR/refs/heads/\*` and
-`$GIT_DIR/refs/tags/\*` if none is specified), and prunes all
-unreachable objects from the object database.  In addition, it
+This runs `git-fsck-objects --unreachable` using all the refs
+available in `$GIT_DIR/refs`, optionally with additional set of
+objects specified on the command line, and prunes all
+objects unreachable from any of these head objects from the object database.
+In addition, it
 prunes the unpacked objects that are also found in packs by
 running `git prune-packed`.
 
@@ -31,29 +32,19 @@ OPTIONS
 	Do not interpret any more arguments as options.
 
 <head>...::
-	Instead of keeping objects
+	In addition to objects
 	reachable from any of our references, keep objects
-	reachable from only listed <head>s.
-+
-Note that the explicitly named <head>s are *not* appended to the
-default set of references, but they replace them.  In general you
-would want to say `git prune $(git-rev-parse --all) extra1
-extra2` to keep chains of commits leading to extra1, extra2,
-... in addition to what are reachable from your own refs.
-Saying `git prune extra1 extra2` would *lose* objects reachable
-only from the usual refs, which is usually not what you want.
-
+	reachable from listed <head>s.
 
 EXAMPLE
 -------
 
-To prune objects not used by your repository and another that
+To prune objects not used by your repository nor another that
 borrows from your repository via its
 `.git/objects/info/alternates`:
 
 ------------
-$ git prune $(git-rev-parse --all) \
-  $(cd ../another && $(git-rev-parse --all))
+$ git prune $(cd ../another && $(git-rev-parse --all))
 ------------
 
 Author
diff --git a/git-prune.sh b/git-prune.sh
index 1fd8c73..7e7f0ad 100755
--- a/git-prune.sh
+++ b/git-prune.sh
@@ -16,7 +16,11 @@ do
 done
 
 sync
-git-fsck-objects --full --cache --unreachable "$@" |
+case "$#" in
+0) git-fsck-objects --full --cache --unreachable ;;
+*) git-fsck-objects --full --cache --unreachable $(git-rev-parse --all) "$@" ;;
+esac |
+
 sed -ne '/unreachable /{
     s/unreachable [^ ][^ ]* //
     s|\(..\)|\1/|p
-- 
0.99.9.GIT

```

## Peter Eriksen, 2005-12-09 19:39

Subject: Re: [RFC/PATCH] git-prune: never lose objects reachable from our refs.
Message-ID: <20051209193922.GA31228@ebar091.ebar.dtu.dk>
URL: https://gitlist.dev/e/20051209193922.GA31228%40ebar091.ebar.dtu.dk
In-Reply-To: <7vmzja91gp.fsf_-_@assigned-by-dhcp.cox.net>

```
On Thu, Dec 08, 2005 at 11:25:10PM -0800, Junio C Hamano wrote:
> Explicit <head> arguments to git-prune replaces, instead of
> extends, the list of heads used for reachability analysis by
> fsck-objects.  By giving a subset of heads by mistake, objects
> reachable only from other heads can be removed, resulting in a
> corrupted repository.
> 
> This commit stops replacing the list of heads, and makes the
> command line arguments to add to them instead for safety.

Shouldn't the first sentence be "Explicit <head> arguments to git-prune
extends, instead of replaces,...", that is, interchange the words 
extends and replaces?  Did I miss something?

Peter

```

## Junio C Hamano, 2005-12-09 20:38

Subject: Re: [RFC/PATCH] git-prune: never lose objects reachable from our refs.
Message-ID: <7vvexy2egz.fsf@assigned-by-dhcp.cox.net>
URL: https://gitlist.dev/e/7vvexy2egz.fsf%40assigned-by-dhcp.cox.net
In-Reply-To: <20051209193922.GA31228@ebar091.ebar.dtu.dk>

```
"Peter Eriksen" <s022018@student.dtu.dk> writes:

> On Thu, Dec 08, 2005 at 11:25:10PM -0800, Junio C Hamano wrote:
>> Explicit <head> arguments to git-prune replaces, instead of
>> extends, the list of heads used for reachability analysis by
>> fsck-objects.  By giving a subset of heads by mistake, objects
>> reachable only from other heads can be removed, resulting in a
>> corrupted repository.
>> 
>> This commit stops replacing the list of heads, and makes the
>> command line arguments to add to them instead for safety.
>
> Shouldn't the first sentence be "Explicit <head> arguments to git-prune
> extends, instead of replaces,...", that is, interchange the words 
> extends and replaces?  Did I miss something?

Sorry, what I meant was: "before this proposed change, it
replaces instead of extends --- which means DANGER.  This
proposed change is to make things safer".

```
