[lug] How do I get the merge I want?

Jeffrey S. Haemer jeffrey.haemer at gmail.com
Wed Mar 5 08:48:59 MST 2014


Dave,

Just what I was asking for. Thanks. A quick look reveals diff -C -1 is
useless, but diff -U -1 is perfect!  (The more elaborate, roll-your-own
gives me the same output as diff -U -1)

Kristina and I just dropped Chuck Hipschman off at Avista. On the ride
over, he was asking, "Why would anyone want to do a random merge?"

I'm doing it to experiment with git merge-drivers -- git lets you add new
merge strategies without hacking the source. Another use is genetic
algorithms: take two similar programs, do a random merge, and see if the
result performs better than the parents.

A third is simulating meiosis.


On Tue, Mar 4, 2014 at 10:24 PM, David L. Anselmi <anselmi at anselmi.us>wrote:

> Sorry, the link to the diff example is http://www.gnu.org/software/
> diffutils/manual/html_node/Line-Formats.html#Line-Formats.
>
> Just cut and paste the first command to see it in action.
>
>
> David L. Anselmi wrote:
>
>> Jeffrey S. Haemer wrote:
>>
>>> Dave,
>>>
>>>  Could you? What would be the common ancestor? I think git would just
>>>> show you a diff (granted in fancy git style, which might also be what
>>>> you
>>>> want).
>>>>
>>>
>>> Granted, but someone forgot to tell "git diff" that it wouldn't work. :-)
>>>
>>
>> Ah, ok. So again, maybe something that doesn't (generally) make sense but
>> happens to do what you
>> want. I'd guess that git uses an empty file as the common ancestor.
>>
>> So diff can do what you want. Here's an example of the roll your own
>> format. It doesn't quite
>> delimit things as-is but maybe that can be added with the group-format
>> options.
>>
>> If it were me I think I'd just learn how diff3 works (so as to be able to
>> remember what to use for
>> the arguments) and use that.
>>
>> Dave
>> _______________________________________________
>> Web Page: http://lug.boulder.co.us
>> Mailing List: http://lists.lug.boulder.co.us/mailman/listinfo/lug
>> Join us on IRC: irc.hackingsociety.org port=6667 channel=#hackingsociety
>>
>>
> _______________________________________________
> Web Page:  http://lug.boulder.co.us
> Mailing List: http://lists.lug.boulder.co.us/mailman/listinfo/lug
> Join us on IRC: irc.hackingsociety.org port=6667 channel=#hackingsociety
>



-- 
Jeffrey Haemer <jeffrey.haemer at gmail.com>
720-837-8908 [cell], http://seejeffrun.blogspot.com [blog],
http://www.youtube.com/user/goyishekop [vlog]
*פרייהייט? דאס איז יאַנג דינען וואָרט.*
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.lug.boulder.co.us/pipermail/lug/attachments/20140305/82f7acb8/attachment.html>


More information about the LUG mailing list