git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Junio C Hamano <junkio@cox.net>
To: git@vger.kernel.org
Subject: Re: [PATCH 6/17] Document the [<head>...] and -- arguments to git-prune.
Date: Thu, 08 Dec 2005 16:28:20 -0800	[thread overview]
Message-ID: <7voe3r9krf.fsf@assigned-by-dhcp.cox.net> (raw)
In-Reply-To: <7vzmnb9m7w.fsf@assigned-by-dhcp.cox.net> (Junio C. Hamano's message of "Thu, 08 Dec 2005 15:56:51 -0800")

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

  reply	other threads:[~2005-12-09  0:28 UTC|newest]

Thread overview: 25+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2005-12-08 23:28 [PATCH 0/17] Documentation fixes in response to my previous listing Nikolai Weibull
2005-12-08 23:28 ` [PATCH 1/17] Document the --non-empty command-line option to git-pack-objects Nikolai Weibull
2005-12-08 23:28   ` [PATCH 2/17] Fix the description of --utf8 and --keep to git-am Nikolai Weibull
2005-12-08 23:28     ` [PATCH 3/17] Use uniform description for the '--' option Nikolai Weibull
2005-12-08 23:28       ` [PATCH 4/17] Documentation/git-commit.txt: Add long options and -- to documentation Nikolai Weibull
2005-12-08 23:28         ` [PATCH 5/17] Documentation/git-verify-pack.txt: added documentation for -- Nikolai Weibull
2005-12-08 23:28           ` [PATCH 6/17] Document the [<head>...] and -- arguments to git-prune Nikolai Weibull
2005-12-08 23:28             ` [PATCH 7/17] Documentation/git-cvsimport.txt: Fix a slight glitch in description heading Nikolai Weibull
2005-12-08 23:28               ` [PATCH 8/17] Documentation/git-cherry-pick: Add --replay and --no-commit Nikolai Weibull
2005-12-08 23:28                 ` [PATCH 9/17] Add documentation for git-revert and git-cherry-pick Nikolai Weibull
2005-12-08 23:28                   ` [PATCH 10/17] Add documentation for the --topo-order option to git-show-branch Nikolai Weibull
2005-12-08 23:28                     ` [PATCH 11/17] Documentation/git-format-patch.txt: Add --signoff, --check, and long option-names Nikolai Weibull
2005-12-08 23:28                       ` [PATCH 12/17] Documentation/git-ls-remote.txt: Add -h and -t Nikolai Weibull
2005-12-08 23:28                         ` [PATCH 13/17] Documentation/git-repack.txt: Add -l and -n Nikolai Weibull
2005-12-08 23:28                           ` [PATCH 14/17] Documentation/git-http-fetch.txt: Document the commit-id argument Nikolai Weibull
2005-12-08 23:28                             ` [PATCH 15/17] Documentation/git-update-server-info.txt: Add -f alias for --force to documentation Nikolai Weibull
2005-12-08 23:28                               ` [PATCH 16/17] Documentation/git-tag.txt: Fix the order of sections (DESCRIPTION should come before OPTIONS) Nikolai Weibull
2005-12-08 23:28                                 ` [PATCH 17/17] Documentation/git-read-tree.txt: Add --reset to SYNOPSIS Nikolai Weibull
2005-12-08 23:49             ` [PATCH 6/17] Document the [<head>...] and -- arguments to git-prune Junio C Hamano
2005-12-08 23:56               ` Junio C Hamano
2005-12-09  0:28                 ` Junio C Hamano [this message]
2005-12-09  7:25                   ` [RFC/PATCH] git-prune: never lose objects reachable from our refs Junio C Hamano
2005-12-09 19:39                     ` Peter Eriksen
2005-12-09 20:38                       ` Junio C Hamano
2005-12-09  0:50                 ` [PATCH 6/17] Document the [<head>...] and -- arguments to git-prune Nikolai Weibull

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=7voe3r9krf.fsf@assigned-by-dhcp.cox.net \
    --to=junkio@cox.net \
    --cc=git@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
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;
as well as URLs for NNTP newsgroup(s).