How do I combine the two variants of a conflict in emacs' emerge?

前端 未结 2 1778
旧时难觅i
旧时难觅i 2021-02-09 23:39

Using emerge in Emacs, I have a session like this:

<<<<<<< variant A
            522ADC9C14B2FD9D00F56BAD /* close_test_button.png          


        
2条回答
  •  死守一世寂寞
    2021-02-09 23:56

    Use the shortcut:

    x-c   (combine the two versions of the difference)
    

    This will insert the two conflicting regions sequentially, yielding an output something like:

    vvvvvvvvvvvvvvvvvvvv
    #ifdef NEW
    522ADC9C14B2FD9D00F56BAD /* close_test_button.png in Resources */,
    522ADC9D14B2FD9D00F56BAD /* close_test_button@2x.png in Resources */,
    522ADCA014B2FDB100F56BAD /* test_failed.png in Resources */,
    522ADCA114B2FDB100F56BAD /* test_failed@2x.png in Resources */,
    #else /* not NEW */
    EC1633C014B2F3E3004B52E7 /* arrow.png in Resources */,
    EC1633C114B2F3E3004B52E7 /* arrow@2x.png in Resources */,
    EC1633C214B2F3E3004B52E7 /* groups.png in Resources */,
    EC1633C314B2F3E3004B52E7 /* groups@2x.png in Resources */,
    #endif /* not NEW */
    ^^^^^^^^^^^^^^^^^^^^
    

    From there, you can go into edit mode (shortcut: 'e') remove the #ifdef macros as necessary to create the final merge that you desire.

提交回复
热议问题