git@vger.kernel.org mailing list mirror (one of many)
 help / color / mirror / code / Atom feed
* [PATCH] Makefile: tweak sed invocation
@ 2018-06-25 19:13 Alejandro R. Sedeño
  2018-06-25 20:15 ` Eric Sunshine
  0 siblings, 1 reply; 4+ messages in thread
From: Alejandro R. Sedeño @ 2018-06-25 19:13 UTC (permalink / raw)
  To: git; +Cc: Dan Jacques, Alejandro R. Sedeño

With GNU sed, the r command doesn't care if a space separates it and
the filename it reads from.

With SunOS sed, the space is required.

Signed-off-by: Alejandro R. Sedeño <asedeno@mit.edu>
---
 Makefile | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/Makefile b/Makefile
index e4b503d..5bac181 100644
--- a/Makefile
+++ b/Makefile
@@ -2109,7 +2109,7 @@ $(SCRIPT_PERL_GEN): % : %.perl GIT-PERL-DEFINES GIT-PERL-HEADER GIT-VERSION-FILE
 	$(QUIET_GEN)$(RM) $@ $@+ && \
 	sed -e '1{' \
 	    -e '	s|#!.*perl|#!$(PERL_PATH_SQ)|' \
-	    -e '	rGIT-PERL-HEADER' \
+	    -e '	r GIT-PERL-HEADER' \
 	    -e '	G' \
 	    -e '}' \
 	    -e 's/@@GIT_VERSION@@/$(GIT_VERSION)/g' \
-- 
2.1.4


^ permalink raw reply related	[flat|nested] 4+ messages in thread

* Re: [PATCH] Makefile: tweak sed invocation
  2018-06-25 19:13 [PATCH] Makefile: tweak sed invocation Alejandro R. Sedeño
@ 2018-06-25 20:15 ` Eric Sunshine
  2018-06-25 20:27   ` Alejandro R. Sedeño
       [not found]   ` <xmqqefgtl7kq.fsf@gitster-ct.c.googlers.com>
  0 siblings, 2 replies; 4+ messages in thread
From: Eric Sunshine @ 2018-06-25 20:15 UTC (permalink / raw)
  To: Alejandro R. Sedeño; +Cc: Git List, Dan Jacques

On Mon, Jun 25, 2018 at 3:18 PM Alejandro R. Sedeño <asedeno@mit.edu> wrote:
> With GNU sed, the r command doesn't care if a space separates it and
> the filename it reads from.
>
> With SunOS sed, the space is required.

MacOS and the various BSD's ship with BSD 'sed', not GNU 'sed', so it
seemed prudent to check this change against them as well, which I did,
and can report that it does not cause any regression on those
platforms.

Therefore, the patch looks good. Thanks.

> Signed-off-by: Alejandro R. Sedeño <asedeno@mit.edu>
> ---
> diff --git a/Makefile b/Makefile
> @@ -2109,7 +2109,7 @@ $(SCRIPT_PERL_GEN): % : %.perl GIT-PERL-DEFINES GIT-PERL-HEADER GIT-VERSION-FILE
>         $(QUIET_GEN)$(RM) $@ $@+ && \
>         sed -e '1{' \
>             -e '        s|#!.*perl|#!$(PERL_PATH_SQ)|' \
> -           -e '        rGIT-PERL-HEADER' \
> +           -e '        r GIT-PERL-HEADER' \
>             -e '        G' \
>             -e '}' \
>             -e 's/@@GIT_VERSION@@/$(GIT_VERSION)/g' \

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [PATCH] Makefile: tweak sed invocation
  2018-06-25 20:15 ` Eric Sunshine
@ 2018-06-25 20:27   ` Alejandro R. Sedeño
       [not found]   ` <xmqqefgtl7kq.fsf@gitster-ct.c.googlers.com>
  1 sibling, 0 replies; 4+ messages in thread
From: Alejandro R. Sedeño @ 2018-06-25 20:27 UTC (permalink / raw)
  To: Eric Sunshine; +Cc: Git List, Dan Jacques

On 2018-06-25 16:15, Eric Sunshine wrote:
> On Mon, Jun 25, 2018 at 3:18 PM Alejandro R. Sedeño <asedeno@mit.edu> wrote:
>> With GNU sed, the r command doesn't care if a space separates it and
>> the filename it reads from.
>>
>> With SunOS sed, the space is required.
> 
> MacOS and the various BSD's ship with BSD 'sed', not GNU 'sed', so it
> seemed prudent to check this change against them as well, which I did,
> and can report that it does not cause any regression on those
> platforms.
> 
> Therefore, the patch looks good. Thanks.

Thanks for checking on that, Eric. I tested MacOS locally before 
submitting as well. From a quick skim of the POSIX sed page, the space 
is expected, so this should be portable.

http://pubs.opengroup.org/onlinepubs/9699919799/utilities/sed.html

-Alejandro

> 
>> Signed-off-by: Alejandro R. Sedeño <asedeno@mit.edu>
>> ---
>> diff --git a/Makefile b/Makefile
>> @@ -2109,7 +2109,7 @@ $(SCRIPT_PERL_GEN): % : %.perl GIT-PERL-DEFINES GIT-PERL-HEADER GIT-VERSION-FILE
>>          $(QUIET_GEN)$(RM) $@ $@+ && \
>>          sed -e '1{' \
>>              -e '        s|#!.*perl|#!$(PERL_PATH_SQ)|' \
>> -           -e '        rGIT-PERL-HEADER' \
>> +           -e '        r GIT-PERL-HEADER' \
>>              -e '        G' \
>>              -e '}' \
>>              -e 's/@@GIT_VERSION@@/$(GIT_VERSION)/g' \


^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [PATCH] Makefile: tweak sed invocation
       [not found]   ` <xmqqefgtl7kq.fsf@gitster-ct.c.googlers.com>
@ 2018-07-02 23:12     ` Alejandro R. Sedeño
  0 siblings, 0 replies; 4+ messages in thread
From: Alejandro R. Sedeño @ 2018-07-02 23:12 UTC (permalink / raw)
  To: Junio C Hamano, Eric Sunshine; +Cc: Git List, Dan Jacques

On 2018-06-26 14:35, Junio C Hamano wrote:
> Having said that, I'm a bit surprised that our build infrastructure
> and shell scripts still work on tools on SunOS.  I used to have
> access to SunOS/Solaris boxes and tried to be careful not to break
> them unnecessarily, but these days I don't, so I expected to hear
> quite a huge bit-rotting.

I end up building new releases on SunOS all the time; when things break 
there is usually when you hear from me. I'm hoping this patch makes it 
into 2.18.1 so I don't have to apply it during my build process.

-Alejandro

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2018-07-02 23:12 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-06-25 19:13 [PATCH] Makefile: tweak sed invocation Alejandro R. Sedeño
2018-06-25 20:15 ` Eric Sunshine
2018-06-25 20:27   ` Alejandro R. Sedeño
     [not found]   ` <xmqqefgtl7kq.fsf@gitster-ct.c.googlers.com>
2018-07-02 23:12     ` Alejandro R. Sedeño

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).