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

[FWP] Craft a conflict tag



I'm using the Aegis CASE tool which uses a utility called fhist to
perform merges.  fhist uses the following marker to flag merge
conflicts...

/-/-/-/-/-/-/-/-/-/-/-/-/  BEGIN CONFLICT   /-/-/-/-/-/-/-/-/-/-/-/-/-/-/-/-/
old conflicting code
/-/-/-/-/-/-/-/-/-/-/-/-/-/-/-/-/-/-/-/-/-/-/-/-/-/-/-/-/-/-/-/-/-/-/-/-/-/
new conflicting code
/-/-/-/-/-/-/-/-/-/-/-/-/  END CONFLICT   /-/-/-/-/-/-/-/-/-/-/-/-/-/-/-/-/

After cleaning up a bad merge I accidentally left one of these flags
in my code... and it compiled!  Turns out the flags are perfectly
valid Perl (they do throw a warning) provided they appear at the end
of a block or in some other way are terminated.

{
/-/-/-/-/-/-/-/-/-/-/-/-/  END CONFLICT   /-/-/-/-/-/-/-/-/-/-/-/-/-/-/-/-/
}

That's syntactically valid perl, even under strict.

You can imagine my surprise.


Even the CVS conflict marker...

<<<<<<< Foo.pm

is valid as long as there's three newlines after it (>>>>>>> and
======= are syntax errors), though it does throw lots of warnings.


So I suppose the challenge here is to come up with a conflict marker
that's most likely to cause a syntax error if it were to appear in
Perl code, as well as boldly standing out and being easy to grep for.
Don't forget about POD, strings and here-docs!


-- 

Michael G. Schwern   <schwern@pobox.com>    http://www.pobox.com/~schwern/
Perl6 Quality Assurance     <perl-qa@perl.org>	     Kwalitee Is Job One
Kids - don't try this at--oh, hell, go ahead, give it a whirl...

==== Want to unsubscribe from Fun With Perl?  Well, if you insist...
==== Send email to <fwp-request@technofile.org> with message _body_
====   unsubscribe