On Mon, Aug 08, 2016 at 01:53:20PM -0700, Junio C Hamano wrote: > Kirill Smelkov <k...@nexedi.com> writes: > > > diff --git a/Documentation/config.txt b/Documentation/config.txt > > index bc1c433..4ba0c4a 100644 > > --- a/Documentation/config.txt > > +++ b/Documentation/config.txt > > @@ -2244,6 +2244,9 @@ pack.useBitmaps:: > > to stdout (e.g., during the server side of a fetch). Defaults to > > true. You should not generally need to turn this off unless > > you are debugging pack bitmaps. > > ++ > > +*NOTE*: when packing to file (e.g., on repack) the default is always not > > to use > > + pack bitmaps. > > This is a bit hard to read and understand. > > The patched result starts with "When true, git will use bitmap when > packing to stdout", i.e. when packing to file, git will not. So > this *NOTE* is repeating the same thing. The reader is made to > wonder "Why does it need to repeat the same thing? Does this mean > when the variable is set, a pack sent to a disk uses the bitmap?" > > I think what you actually do in the code is to make the variable > affect _only_ the standard-output case, and users need a command > line option if they want to use bitmap when writing to a file (the > code to do so looks correctly done).
Yes it is this way how it is programmed. But I've added the note because it is very implicit to me that "When true, git will use bitmap when packing to stdout" means 1) the default for packing-to-file is different and 2) there is no way to set the default for packing-to-file. That's why I added the explicit info. And especially since the config name "pack.useBitmaps" does not contain "stdout" at all it can be very confusing to people looking at this the first time (at least it was so this way for me). Also please recall you wondering why 6b8fda2d added bitmap support only for to-stdout case not even mentioning about why it is done only for that case and not for to-file case). I do not insist on the note however - I only thought it is better to have it - so if you prefer we go without it - let us drop this note. Will send v6 as reply to this mail with below interdiff. Thanks, Kirill ---- 8< ---- (interdiff) --- b/Documentation/config.txt +++ a/Documentation/config.txt @@ -2246,9 +2246,6 @@ to stdout (e.g., during the server side of a fetch). Defaults to true. You should not generally need to turn this off unless you are debugging pack bitmaps. -+ -*NOTE*: when packing to file (e.g., on repack) the default is always not to use - pack bitmaps. pack.writeBitmaps (deprecated):: This is a deprecated synonym for `repack.writeBitmaps`. diff -u b/t/t5310-pack-bitmaps.sh b/t/t5310-pack-bitmaps.sh --- b/t/t5310-pack-bitmaps.sh +++ b/t/t5310-pack-bitmaps.sh @@ -219,8 +219,8 @@ # verify equivalent packs are generated with/without using bitmap index packasha1=$(git pack-objects --no-use-bitmap-index --all packa </dev/null) && packbsha1=$(git pack-objects --use-bitmap-index --all packb </dev/null) && - git show-index <packa-$packasha1.idx | cut -d" " -f2 >packa.objects && - git show-index <packb-$packbsha1.idx | cut -d" " -f2 >packb.objects && + pack_list_objects <packa-$packasha1.idx >packa.objects && + pack_list_objects <packb-$packbsha1.idx >packb.objects && test_cmp packa.objects packb.objects ' -- To unsubscribe from this list: send the line "unsubscribe git" in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html