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

Re: [PATCH] t7406: fix breakage on OSX

From
Lars Schneider <larsxschneider@gmail.com>
Date
Aug 10, 2016, 19:03 UTC
Message-ID
<42522DA5-C677-4B2B-88CA-918B33069F9F@gmail.com>
In-Reply-To
<20160810175607.30826-1-sbeller@google.com>
Show 42 quoted lines
> On 10 Aug 2016, at 19:56, Stefan Beller <sbeller@google.com> wrote:
> 
> On OSX `wc` prefixes the output of numbers with whitespace, such that
> the `commit_count` would be "SP <NUMBER>". When using that in
> 
>    git submodule update --init --depth=$commit_count
> 
> the depth would be empty and the number is interpreted as the pathspec.
> Fix this by not using `wc` and rather instruct rev-list to count.
> 
> Another way to fix this is to remove the `=` sign after the `--depth`
> argument as then we are allowed to have more than just one whitespace
> between `--depth` and the actual number. Prefer the solution of rev-list
> counting as that is expected to be slightly faster and more self-sustained
> within Git.
> 
> Reported-by: Lars Schneider <larsxschneider@gmail.com>
> Helped-by: Junio C Hamano <gitster@pobox.com>,
> Signed-off-by: Stefan Beller <sbeller@google.com>
> ---
> 
>  origin/sb/submodule-update-dot-branch
> 
> t/t7406-submodule-update.sh | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/t/t7406-submodule-update.sh b/t/t7406-submodule-update.sh
> index d7983cf..64f322c 100755
> --- a/t/t7406-submodule-update.sh
> +++ b/t/t7406-submodule-update.sh
> @@ -877,7 +877,7 @@ test_expect_success 'submodule update clone shallow submodule' '
> 	test_when_finished "rm -rf super3" &&
> 	first=$(git -C cloned submodule status submodule |cut -c2-41) &&
> 	second=$(git -C submodule rev-parse HEAD) &&
> -	commit_count=$(git -C submodule rev-list $first^..$second | wc -l) &&
> +	commit_count=$(git -C submodule rev-list --count $first^..$second) &&
> 	git clone cloned super3 &&
> 	pwd=$(pwd) &&
> 	(
> -- 
> 2.9.2.665.gdb8bb2f
> 
Ack.
- Lars
Previous: Junio C Hamano
Message 15 of 15 in “What's cooking in git.git (Aug 2016, #03; Mon, 8)”
  1. Junio C HamanoAug 8, 2016
  2. Stefan BellerAug 8, 2016
  3. Junio C HamanoAug 9, 2016
  4. Elijah NewrenAug 9, 2016
  5. Junio C HamanoAug 9, 2016
  6. Johannes SchindelinAug 10, 2016
  7. Lars SchneiderAug 10, 2016
  8. Junio C HamanoAug 10, 2016
  9. Stefan BellerAug 10, 2016
  10. Lars SchneiderAug 10, 2016
  11. t7406: fix breakage on OSXStefan Beller, Aug 10, 2016
  12. Junio C HamanoAug 10, 2016
  13. Stefan BellerAug 10, 2016
  14. Junio C HamanoAug 10, 2016
  15. Lars SchneiderAug 10, 2016

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.