Thread (11 messages) flat view 11 messages, 3 authors, 2016-09-10

Re: [PATCH 1/2] pack-objects: Teach --use-bitmap-index codepath to respect --local, --honor-pack-keep and --incremental

From: Junio C Hamano <hidden>
Date: 2016-08-09 16:52:26

Possibly related (same subject, not in this thread)

Kirill Smelkov [off-list ref] writes:
Would you please explain why we should not use touch if we do not care
about timestamps? Simply style?
To help readers.

"touch A" forcess the readers wonder "does the timestamp of A
matter, and if so in what way?" and "does any later test care what
is _in_ A, and if so in what way?"  Both of them is wasting their
time when there is no reason why "touch" should have been used. 
quoted hunk
diff --git a/t/t5310-pack-bitmaps.sh b/t/t5310-pack-bitmaps.sh
index cce95d8..44914ac 100755
--- a/t/t5310-pack-bitmaps.sh
+++ b/t/t5310-pack-bitmaps.sh
@@ -8,16 +8,15 @@ objpath () {
 }
 
 # show objects present in pack ($1 should be associated *.idx)
-packobjects () {
-	git show-index <$1 | cut -d' ' -f2
+pack_list_objects () {
+	git show-index <"$1" | cut -d' ' -f2
 }
pack-list-objects still sounds as if you are packing "list objects",
though.  If you are listing packed objects (or objects in a pack),
list-packed-objects (or list-objects-in-pack) reads clearer and more
to the point, at least to me.
-# hasany pattern-file content-file
+# has_any pattern-file content-file
 # tests whether content-file has any entry from pattern-file with entries being
 # whole lines.
-hasany () {
-	# NOTE `grep -f` is not portable
-	git grep --no-index -qFf $1 $2
+has_any () {
+	grep -qFf "$1" "$2"
Omitting "-q" would help those who have to debug breakage in this
test or the code that this test checks.  What test_expect_success
outputs is not shown by default, and running the test script with
"-v" would show them as a debugging aid.

Thanks.
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help