Hi, documentation about pack.packSizeLimit says: The default maximum size of a pack. This setting only affects packing to a file, i.e. the git:// protocol is unaffected. It can be overridden by the --max-pack-size option of git-repack(1). I would suggest clarifying it into The default maximum size of a pack in bytes. This setting only affects packing to a file, i.e. the git:// protocol is unaffected. It can be overridden by the --max-pack-size option of git-repack(1). Since --max-pack-size takes MB and one might be tempted to assume that the same is valid for pack.packSizeLimit. Also note that some safety check on pack.packSizeLimit could probably be desirable to avoid an unreasonably small limit. For instance: Assume that pack.packSizeLimit is set to 1 (believing it would be 1MB, but it is in fact 1B). With this at the first git gc every object goes in its own pack. You realize the mistake, you fix pack.packSizeLimit to 1000000, but at this point you cannot go back since git gc cannot run anymore (too many open files). Maybe, considering all the possible use cases of pack.packSizeLimit could help finding a reasonable lower bound. --
Grrrrr. This is a terrible discrepency given that all the other arguments in Git are always byte based, with the optional k/m/g suffix, by using git_parse_ulong(). So IMHO I'd just change --max-pack-size to be in line with all the rest and have it accept bytes instead of MB. And of course I'd push such a change to be included in v1.7.0 along with the other incompatible fixes. That's a totally orthogonal issue. There are other ways to get into trouble with too many open files and that deserves a fix of its own (such as limiting the number of simultaneous opened packs). Nicolas --
While at it, also change --big-file-threshold that fast-import learnt the other day... -- Hannes --
Yup. WTF was I thinking when I did megabytes as the default unit on the command line... -- Shawn. --
That thing is new, so it is worth fixing before 1.7.0 final. Please make it so. Thanks. --
All of the "other incompatible" changes had ample leading time for transition with warnings and all. I am afraid that doing this "unit change" is way too late for 1.7.0, and it makes me somewhat unhappy to hear such a suggestion. It belittles all the careful planning that has been done for these other changes to help protect the users from transition pain. Introduce --max-pack-megabytes that is a synonym for --max-pack-size for now, and warn when --max-pack-size is used; warn that --max-pack-size will count in bytes in 1.8.0. Ship 1.7.0 with that change. --max-pack-bytes can also be added if you feel like, while at it. But changing the unit --max-pack-size counts in to bytes in 1.7.0 feels a bit too irresponsible for the existing users. --
Thing is... I don't know if the --max-pack-size argument is really that used. I'd expect people relying on that feature to use the config variable instead, given that 'git gc' has no idea about --max-pack-size anyway. People using the --max-pack-size argument directly are probably doing so only to experiment with it, and then setting the config variable, probably using the wrong unit. The fact that such a discrepancy just came to our attention after all the time this feature has existed is certainly a good indicator of its popularity. I understand the really unfortunate timing for such a change. OTOH there is a big advantage to bundle as much incompatibilities together at the same time, as people will be prepared for such things already. While I share your concern for advance warning and such, I think those concerns are worth an effort proportional to the depth of user exposure. Like for the THREADED_DELTA_SEARCH case, I'm wondering how much pain if at all might be saved with a transition plan vs the cost of maintaining that plan and carrying the discrepancy further. Nicolas --
Absolutely. I just wanted to hear that --max-pack-size command line option is not widely used and it is Ok to change it. --
I suspect one of us need to be careful not to forget this thing...
-- >8 --
Subject: pack-objects --max-pack-size=<n> counts in bytes
The --window-memory argument and pack.packsizelimit configuration used by
the same program counted in bytes and honored the standard k/m/g suffixes.
Make this option do the same for consistency.
Signed-off-by: Junio C Hamano <gitster@pobox.com>
---
Documentation/RelNotes-1.7.0.txt | 6 ++++++
Documentation/git-pack-objects.txt | 3 ++-
builtin-pack-objects.c | 7 +++----
3 files changed, 11 insertions(+), 5 deletions(-)
diff --git a/Documentation/RelNotes-1.7.0.txt b/Documentation/RelNotes-1.7.0.txt
index 323ae54..adf8824 100644
--- a/Documentation/RelNotes-1.7.0.txt
+++ b/Documentation/RelNotes-1.7.0.txt
@@ -46,6 +46,12 @@ Notes on behaviour change
environment, and diff.*.command and diff.*.textconv in the config
file.
+ * "git pack-objects --max-pack-size=<n>" used to count in megabytes,
+ which was inconsistent with its corresponding configuration
+ variable and other options the command takes. Now it counts in bytes
+ and allows standard k/m/g suffixes to be given.
+
+
Updates since v1.6.6
--------------------
diff --git a/Documentation/git-pack-objects.txt b/Documentation/git-pack-objects.txt
index 097a147..fdaf775 100644
--- a/Documentation/git-pack-objects.txt
+++ b/Documentation/git-pack-objects.txt
@@ -106,7 +106,8 @@ base-name::
default.
--max-pack-size=<n>::
- Maximum size of each output packfile, expressed in MiB.
+ Maximum size of each output packfile, expressed in bytes. The
+ size can be suffixed with "k", "m", or "g".
If specified, multiple packfiles may be created.
The default is unlimited, unless the config variable
`pack.packSizeLimit` is set.
diff --git a/builtin-pack-objects.c b/builtin-pack-objects.c
index 4a41547..33e11d7 100644
--- a/builtin-pack-objects.c
+++ b/builtin-pack-objects.c
@@ -2203,11 +2203,10 @@ int cmd_pack_objects(int argc, ...Please hold on. I think I have a better patch. Nicolas --
Ok, I dropped both fast-import.c mismerge fix and the one you are responding to. --
| Greg KH | Og dreams of kernels |
| Jens Axboe | [PATCH 31/33] Fusion: sg chaining support |
| Arnd Bergmann | Re: finding your own dead "CONFIG_" variables |
| Mark Brown | [PATCH 2/2] Subject: natsemi: Allow users to disable workaround for DspCfg reset |
| Tony Breeds | [LGUEST] Look in object dir for .config |
git: | |
| Brian Downing | Re: Git in a Nutshell guide |
| John Benes | Re: master has some toys |
| Matthias Lederhofer | [PATCH 4/7] introduce GIT_WORK_TREE to specify the work tree |
| Alexander Sulfrian | [RFC/PATCH] RE: git calls SSH_ASKPASS even if DISPLAY is not set |
| Junio C Hamano | Re: Rss produced by git is not valid xml? |
| Linux Kernel Mailing List | iSeries: fix section mismatch in iseries_veth |
| Linux Kernel Mailing List | ixbge: remove TX lock and redo TX accounting. |
| Linux Kernel Mailing List | ixgbe: fix several counter register errata |
| Linux Kernel Mailing List | b43: fix build with CONFIG_SSB_PCIHOST=n |
| Linux Kernel Mailing List | 9p: block-based virtio client |
