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

Jeffrey S. Haemer jeffrey.haemer at gmail.com
Tue Mar 4 21:01:19 MST 2014


I would, of course, love to see your version, but I'm looking for something
much more mundane and pre-git -- indeed, even pre-Linux.

This feels like a completely generic task for which there's some lovely,
completely generic, Unix sol'n. I'm betting I even know it, and keep
thinking I'll wake in the middle of the night and exclaim to myself, "You
moron!"

FWIW, my real goal is to perform a random merge, so I may not even need to
solve the problem above. Here's what I mean:

For git merge (or, really, merges of any kind), the first step is the
merge. The second is picking which alternative I want.for each marked
section. The git command lets me use git-mergetool to pick which
alternative I want for each conflicting hunk. Other built-ingstrategies
include ones that pick either "always mine" or "always theirs."

There isn't, however, a strategy that says "oh, just flip a coin for each
chunk."

I can implement that, but first I'm thinking I need a merge. If there's an
easier approach, please let me know.


On Tue, Mar 4, 2014 at 7:36 PM, Davide Del Vento <davide.del.vento at gmail.com
> wrote:

> I've succeeded convincing "git diff" to provide the git-fancy-colored
> output for two regular, unknown-to-git files. So I guess if you can
> convince git diff to provide what you want, you can use my trick and see if
> you can combine the two. Would that help?
>
> If so, tomorrow I will post mine (I don't remember what I did, I scripted
> it somewhere)
>
>
> On Tue, Mar 4, 2014 at 7:17 PM, Jeffrey S. Haemer <
> jeffrey.haemer at gmail.com> wrote:
>
>> Dave,
>>
>>
>>> And yes, I could put the two versions into git in different branches and
>>>> then call "git merge." :-)
>>>>
>>>
>>> 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. :-)
>>
>> Try this:
>>
>> mkdir hello
>> cd hello
>> git flow init -d
>> git checkout -b 1
>> for i in a{1..5} {6..10} b{11..15}; do echo $i; done > myfile
>> git add .; git commit -am"branch 1"
>> git checkout develop
>> git checkout -b 2
>> for i in x{1..5} {6..10} y{11..15}; do echo $i; done > myfile
>> git add .; git commit -am"branch 2"
>> git diff 1 2
>>
>>
>> --
>> Jeffrey Haemer <jeffrey.haemer at gmail.com>
>> 720-837-8908 [cell], http://seejeffrun.blogspot.com [blog],
>> http://www.youtube.com/user/goyishekop [vlog]
>> *פרייהייט? דאס איז יאַנג דינען וואָרט.*
>>
>> _______________________________________________
>> 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/20140304/737018f4/attachment.html>


More information about the LUG mailing list