Re: [PATCH v2 2/3] transport.c: introduce core.alternateRefsCommand
- From
brian m. carlson <sandals@crustytoothpaste.net>
- Date
- Sep 22, 2018, 18:02 UTC
- Message-ID
- <20180922180231.GD432229@genre.crustytoothpaste.net>
- In-Reply-To
- <9797f525517142b3494cfbd17a10dfeb3bf586e2.1537555544.git.me@ttaylorr.com>
On Fri, Sep 21, 2018 at 02:47:43PM -0400, Taylor Blau wrote:
Show 6 quoted lines
> +expect_haves () {
> + printf "%s .have\n" $(git rev-parse $@) >expect
> +}
> +
> +extract_haves () {
> + depacketize - | grep '\.have' | sed -e 's/\\0.*$//g'It looks like you're trying to match a NUL here in the sed expression, but from my reading of it, POSIX doesn't permit BREs to match NUL.
Perhaps someone can come up with a better solution, but I'd write this as the following:
depacketize - | perl -ne 'next unless /\.have/; s/\0.*$//g; print'
-- brian m. carlson: Houston, Texas, US OpenPGP: https://keybase.io/bk2204