git/list[1] front-page[2] threads[3] people[4] search[5] about
 

Re: [PATCH] pack-objects: disable pack reuse for object-selection options

From
Jeff King <peff@peff.net>
Date
May 9, 2017, 02:59 UTC
Message-ID
<20170509025946.7lozhjwblra7i6sp@sigill.intra.peff.net>
In-Reply-To
<20170509025412.6fkrlnbsdk6qmoia@sigill.intra.peff.net>
On Mon, May 08, 2017 at 10:54:12PM -0400, Jeff King wrote:
> Contents are the same. I decided to leave the "; do" as it
> matches the rest of the script. If we're going to fix it, we
> should do them all.
Like this, perhaps.

I didn't go on a crusade against "; do" in the other scripts, but perhaps that is low-hanging fruit that somebody else might want to pick.

-- >8 --
Subject: [PATCH] t5310: fix "; do" style

Our usual shell style is to put the "do" of a loop on its own line, like:

  while $cond
  do
          something
  done
instead of:
  while $cond; do
          something
  done

We have a bit of both in our code base, but the former is what's in CodingGuidelines (and outnumbers the latter in t/ by about 6:1).

Signed-off-by: Jeff King <peff@peff.net>
---
 t/t5310-pack-bitmaps.sh | 12 ++++++++----
 1 file changed, 8 insertions(+), 4 deletions(-)
diff --git a/t/t5310-pack-bitmaps.sh b/t/t5310-pack-bitmaps.sh
index c3ddfa217..20e2473a0 100755
--- a/t/t5310-pack-bitmaps.sh
+++ b/t/t5310-pack-bitmaps.sh
@@ -20,11 +20,13 @@ has_any () {
 }
 
 test_expect_success 'setup repo with moderate-sized history' '
-	for i in $(test_seq 1 10); do
+	for i in $(test_seq 1 10)
+	do
 		test_commit $i
 	done &&
 	git checkout -b other HEAD~5 &&
-	for i in $(test_seq 1 10); do
+	for i in $(test_seq 1 10)
+	do
 		test_commit side-$i
 	done &&
 	git checkout master &&
@@ -104,7 +106,8 @@ test_expect_success 'clone from bitmapped repository' '
 '
 
 test_expect_success 'setup further non-bitmapped commits' '
-	for i in $(test_seq 1 10); do
+	for i in $(test_seq 1 10)
+	do
 		test_commit further-$i
 	done
 '
@@ -300,7 +303,8 @@ test_expect_success 'set up reusable pack' '
 
 test_expect_success 'pack reuse respects --honor-pack-keep' '
 	test_when_finished "rm -f .git/objects/pack/*.keep" &&
-	for i in .git/objects/pack/*.pack; do
+	for i in .git/objects/pack/*.pack
+	do
 		>${i%.pack}.keep
 	done &&
 	reusable_pack --honor-pack-keep >empty.pack &&
-- 
2.13.0.rc2.436.g524cea07c
Previous: Jeff KingNext: Junio C Hamano
Message 10 of 11 in “pack-objects: disable pack reuse for object-selection options”
  1. pack-objects: disable pack reuse for object-selection optionsJeff King, May 2, 2017
  2. Junio C HamanoMay 8, 2017
  3. Jeff KingMay 8, 2017
  4. Junio C HamanoMay 9, 2017
  5. Jeff KingMay 9, 2017
  6. Junio C HamanoMay 9, 2017
  7. Jeff KingMay 9, 2017
  8. Junio C HamanoMay 9, 2017
  9. Jeff KingMay 9, 2017
  10. Jeff KingMay 9, 2017
  11. Junio C HamanoMay 9, 2017

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.