Re: [PATCH] Fix sed syntax in t7502-commit for OSX

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Marcel Koeppen <git-dev@xxxxxxxxxxxx> writes:

> The OSX version of sed interprets the command as argument to the -i option.
>
> Signed-off-by: Marcel Koeppen <git-dev@xxxxxxxxxxxx>
> ---
>  t/t7502-commit.sh |    2 +-
>  1 files changed, 1 insertions(+), 1 deletions(-)
>
> diff --git a/t/t7502-commit.sh b/t/t7502-commit.sh
> index 018060c..9a43104 100755
> --- a/t/t7502-commit.sh
> +++ b/t/t7502-commit.sh
> @@ -166,7 +166,7 @@ test_expect_success 'author different from committer' '
>  	test_cmp expect actual
>  '
>  
> -sed -i '$d' expect
> +sed -i -e '$d' expect
>  echo "# Committer:
>  #" >> expect
>  unset GIT_COMMITTER_EMAIL

Two comments and a half.

This patch does not make things worse, so I do not have much against it.

However, "sed -i $cmd" is also used in templates/hooks--prepare-commit-msg
and you would want to fix it as well.

But more importantly, as we are serious about portability, we should not
be using "sed -i" which is not even in POSIX to begin with.  Can we
rewrite these places without using the in-place extension?

--
To unsubscribe from this list: send the line "unsubscribe git" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html

[Index of Archives]     [Linux Kernel Development]     [Gcc Help]     [IETF Annouce]     [DCCP]     [Netdev]     [Networking]     [Security]     [V4L]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux SCSI]     [Fedora Users]

  Powered by Linux