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

Re: [PATCH 1/2] refs_from_alternate: helper to use refs from alternates

From
Johannes Sixt <j6t@kdbg.org>
Date
Mar 11, 2011, 23:08 UTC
Message-ID
<201103120008.27973.j6t@kdbg.org>
In-Reply-To
<1299876671-12838-1-git-send-email-gitster@pobox.com>
On Freitag, 11. März 2011, Junio C Hamano wrote:
Show 9 quoted lines
> +count_objects () {
> +	(
> +		echo 0 &&
> +		git count-objects -v |
> +		sed -n -e 's/^count: \(.*\)/\1 +/p' \
> +		    -e 's/^in-pack: \(.*\)/\1 +/p' &&
> +		echo p
> +	) | dc
> +}
Can we have this without using dc? (We don't have it on Windows.)
diff --git a/t/t5501-fetch-push-alternates.sh 
b/t/t5501-fetch-push-alternates.sh
index 564ef7c..eb844cf 100755
--- a/t/t5501-fetch-push-alternates.sh
+++ b/t/t5501-fetch-push-alternates.sh
@@ -4,13 +4,11 @@ test_description='fetch/push involving alternates'
 . ./test-lib.sh
 
 count_objects () {
-	(
-		echo 0 &&
+	echo $(( $(
 		git count-objects -v |
 		sed -n -e 's/^count: \(.*\)/\1 +/p' \
-		    -e 's/^in-pack: \(.*\)/\1 +/p' &&
-		echo p
-	) | dc
+		    -e 's/^in-pack: \(.*\)/\1/p'
+		) ))
 }
 
 
Previous: Shawn PearceNext: Junio C Hamano
Message 4 of 6 in “refs_from_alternate: helper to use refs from alternates”
  1. 1/2 refs_from_alternate: helper to use refs from alternatesJunio C Hamano, Mar 11, 2011
  2. 2/2 fetch-pack: objects in our alternates are available to usJunio C Hamano, Mar 11, 2011
  3. Shawn PearceMar 15, 2011
  4. Johannes SixtMar 11, 2011
  5. Junio C HamanoMar 11, 2011
  6. Junio C HamanoMar 11, 2011

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.