There is no reason not to, really.
Signed-off-by: Junio C Hamano <junkio@cox.net>
---
diff --git a/Documentation/git-pack-refs.txt b/Documentation/git-pack-refs.txt
index 5da5105..464269f 100644
--- a/Documentation/git-pack-refs.txt
+++ b/Documentation/git-pack-refs.txt
@@ -7,7 +7,7 @@ git-pack-refs - Pack heads and tags for efficient repository access
SYNOPSIS
--------
-'git-pack-refs' [--all] [--prune]
+'git-pack-refs' [--all] [--no-prune]
DESCRIPTION
-----------
@@ -40,10 +40,11 @@ developed and packing their tips does not help performance.
This option causes branch tips to be packed as well. Useful for
a repository with many branches of historical interests.
-\--prune::
+\--no-prune::
+
+The command usually removes loose refs under `$GIT_DIR/refs`
+hierarchy after packing them. This option tells it not to.
-After packing the refs, remove loose refs under `$GIT_DIR/refs`
-hierarchy. This should probably become default.
Author
------
diff --git a/builtin-pack-refs.c b/builtin-pack-refs.c
index 8dc5b9e..6de7128 100644
--- a/builtin-pack-refs.c
+++ b/builtin-pack-refs.c
@@ -4,7 +4,7 @@
#include "tag.h"
static const char builtin_pack_refs_usage[] =
-"git-pack-refs [--all] [--prune]";
+"git-pack-refs [--all] [--prune | --no-prune]";
struct ref_to_prune {
struct ref_to_prune *next;
@@ -90,10 +90,15 @@ int cmd_pack_refs(int argc, const char **argv, const char *prefix)
memset(&cbdata, 0, sizeof(cbdata));
+ cbdata.prune = 1;
for (i = 1; i < argc; i++) {
const char *arg = argv[i];
if (!strcmp(arg, "--prune")) {
- cbdata.prune = 1;
+ cbdata.prune = 1; /* now the default */
+ continue;
+ }
+ if (!strcmp(arg, "--no-prune")) {
+ cbdata.prune = 0;
continue;
}
if (!strcmp(arg, "--all")) {
diff --git a/t/t3210-pack-refs.sh b/t/t3210-pack-refs.sh
index b1e9f2e..16bdae4 100755
--- a/t/t3210-pack-refs.sh
+++ b/t/t3210-pack-refs.sh
@@ -34,7 +34,7 @@ test_expect_success \
'see if a branch still exists when packed' \
'git-branch b &&
git-pack-refs --all &&
- rm .git/refs/heads/b &&
+ rm -f .git/refs/heads/b &&
echo "$SHA1 refs/heads/b" >expect &&
git-show-ref b >result &&
diff expect result'
-
To unsubscribe from this list: send the line "unsubscribe git" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
| Manu Abraham | PCIE |
| Jared Hulbert | [PATCH 00/10] AXFS: Advanced XIP filesystem |
| Pardo | Re: pthread_create() slow for many threads; also time to revisit 64b context switc... |
| Tomasz Chmielewski | Re: [PATCH] Intel IXP4xx network drivers v.2 - Ethernet and HSS |
git: | |
| Thomas Glanzmann | fatal: serious inflate inconsistency |
| Jeff Garzik | Re: Using GIT to store /etc (Or: How to make GIT store all file permission bits) |
| Andy Parkins | Re: git-fetch and unannotated tags |
| Yossi Leybovich | corrupt object on git-gc |
| Richard Stallman | Real men don't attack straw men |
| Bertram Scharpf | First install: Grub doesn't find partitions |
| Unix Fan | Chatting with developers? Is it soo 1996? |
| Joel Wiramu Pauling | Re: Suggested PF Setup when using BitTorrent? |
| Vegard Nossum | Re: [bug, netconsole, SLUB] BUG skbuff_head_cache: Poison overwritten |
| Jarek Poplawski | Re: NMI lockup, 2.6.26 release |
| Tomas Winkler | [PATCH] iwlwifi: RS small compile warnings without CONFIG_IWLWIFI_DEBUG |
| Simon Horman | Re: [PATCH] sendfile() and UDP socket |
