[svn.haxx.se] · SVN Dev · SVN Users · SVN Org · TSVN Dev · TSVN Users · Subclipse Dev · Subclipse Users · this month's index

Re: Re: [bug] detect-merge-conflicts.sh reports false positive merge conflict markers

From: Matthias Buecher / Germany <mail_at_maddes.net>
Date: Thu, 21 Feb 2013 18:49:24 +0100

Alan, thanks for the info.

I have re-tested on NetBSD 5.0, Debian 6.0, Redhat on Sourceforge, FreeBSD 9 and also on OpenWrt/Busybox 1.19.4.
All sed versions support semicolon.
NetBSD needs newlines after closing brackets.
Busybox needs nested brackets for "p" and "q" to work correctly (also makes the logic more visible).

Result is the following test script:
#!/bin/sh
printf 'abc\nfoo\nbar1\nbaz\nklj\nfoo\nbar2\nbaz\nxyz\n' | sed -ne '/foo/,/baz/ { /bar/ { p ; q ;
}
}'

Therefore the corrected line for detect-merge-conflicts.sh is:
SUSPICIOUS=$($SVNLOOK diff -t "$TXN" "$REPOS" | sed -n -e '/^+<<<<<<< \..*$/,/^+>>>>>>> \..*$/ { /^+=======$/ { p ; q ;
}
}' | wc -l)

I hope that is the final portable answer :)
Maddes

P.S.:
I'm not subscribed and would appreciate being explicitly Cc:ed in any responses. Thanks.

On 21.02.2013 08:34, Alan Barrett wrote:
> On Wed, 20 Feb 2013, Matthias Buecher / Germany wrote:
>> I tested on Debian 6.0 Squeeze and on Sourceforge Redhat server. Just
>> installed FreeBSD 9.0 in a VM and sed on FreeBSD needs a semicolon to
>> separate last command and closing bracket.
>
> Semicolon might often work, but the portable syntax requires a newline.
>
> See
> <http://pubs.opengroup.org/onlinepubs/9699919799/utilities/sed.html>,
> which includes:
>
> The <right-brace> shall be preceded by a <newline> and can be
> preceded or followed by <blank> characters.
>
> and:
>
> Historically, the sed ! and } editing commands did not permit
> multiple commands on a single line using a <semicolon> as a
> command delimiter. Implementations are permitted, but not
> required, to support this extension.
>
> --apb (Alan Barrett)
Received on 2013-02-21 18:50:01 CET

This is an archived mail posted to the Subversion Dev mailing list.

This site is subject to the Apache Privacy Policy and the Apache Public Forum Archive Policy.