bug-gnu-emacs
[Top][All Lists]
Advanced

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

bug#74509: Feature request - smerge-mode


From: Stefan Monnier
Subject: bug#74509: Feature request - smerge-mode
Date: Mon, 02 Dec 2024 22:26:45 -0500
User-agent: Gnus/5.13 (Gnus v5.13)

>> >> # keybinding
>> >> would be nice to provide default keybinding for smerge-swap: C-c ^ s
>> Interesting.  I've never found a use for that command, personally.
>> Could you give some hint for the situations where you found it handy?
> Example:
> I keep my functions alphabetically ordered.
> When I merge two changes which added function in same alphabetical place,
> I often need to change their order.

I see; makes sense!

>> >> # smerge-extend
>> >> Helpful when user intent to keep both.
>> Sorry: to keep both what?
>
> Both = lower + upper.
>
> Using above example:
> when I intent to keep both functions, end of block (eg: C, Java, Perl, ...)
> will currently not appear twice,

Really?  Here, when I merge two changes which both add a function at the
same place I get a conflict with the complete functions (with their
respective closing brace and trailing space if applicable).

>> Hmm... Why just one line and why only from the end?
> One line - one can use it multiple times to add more.
> And yes, you are right, it should accept numeric argument (negative for
> preceding line).
> Though I still believe common use case will be to extend with following.

I guess a numeric argument could be handy (e.g. to handle the case of
extending from the front rather than from the end).
I had in mind a different UI where you move point to the "end" of the
extension (i.e. to right after the one-or-two lines you want to add to
the ends), but I guess that would be more clunky than what you have.

>> [ Unless you specifically chose 2-way conflicts, I recommend you
>>   investigate how to get 3-way conflicts, because they give a lot more
>>   information and allow for example `smerge-resolve` to "just work" in
>>   more cases.  YMMV, but personally whenever I'm faced with a 2-way
>>   conflict, I'm frustrated.  ]
> Different experiences - I for example run mostly into 2-way conflicts

Maybe it's because of

    % grep -B1 diff3  ~/.gitconfig
    [merge]
            conflictstyle = diff3
    %

🙂


        Stefan






reply via email to

[Prev in Thread] Current Thread [Next in Thread]