git@vger.kernel.org mailing list mirror (one of many)
 help / color / mirror / code / Atom feed
From: Lars Schneider <larsxschneider@gmail.com>
To: Stefan Beller <sbeller@google.com>
Cc: gitster@pobox.com, git@vger.kernel.org
Subject: Re: [PATCH] t7406: fix breakage on OSX
Date: Wed, 10 Aug 2016 21:03:54 +0200	[thread overview]
Message-ID: <42522DA5-C677-4B2B-88CA-918B33069F9F@gmail.com> (raw)
In-Reply-To: <20160810175607.30826-1-sbeller@google.com>


> 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


      parent reply	other threads:[~2016-08-10 19:04 UTC|newest]

Thread overview: 15+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-08-08 22:32 What's cooking in git.git (Aug 2016, #03; Mon, 8) Junio C Hamano
2016-08-08 23:02 ` Stefan Beller
2016-08-09 15:43   ` Junio C Hamano
2016-08-09 18:52 ` Elijah Newren
2016-08-09 19:03   ` Junio C Hamano
2016-08-10 12:13   ` Johannes Schindelin
2016-08-10 17:30 ` Lars Schneider
2016-08-10 17:36   ` Stefan Beller
2016-08-10 17:46     ` Lars Schneider
2016-08-10 17:49   ` Junio C Hamano
2016-08-10 17:56   ` [PATCH] t7406: fix breakage on OSX Stefan Beller
2016-08-10 18:27     ` Junio C Hamano
2016-08-10 19:03       ` Stefan Beller
2016-08-10 20:34         ` Junio C Hamano
2016-08-10 19:03     ` Lars Schneider [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: http://vger.kernel.org/majordomo-info.html

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=42522DA5-C677-4B2B-88CA-918B33069F9F@gmail.com \
    --to=larsxschneider@gmail.com \
    --cc=git@vger.kernel.org \
    --cc=gitster@pobox.com \
    --cc=sbeller@google.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://80x24.org/mirrors/git.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).