Giter VIP home page Giter VIP logo

vim-mergetool's People

Contributors

dougpagani avatar jonasw234 avatar samoshkin avatar sqve avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar

vim-mergetool's Issues

Keep both

How would one handle a merge conflict like the following, where I would want to keep both changes?

<<<<<<< ours
  /** An extensive
   * comment. */
  bool some_boolean;

||||||| base
=======
  /** Some other
   * multiline
   * comment. */
  bool another_variable;

>>>>>>> theirs

Opening that file and running :MergetoolStart gives me the following:

CleanShot 2022-06-22 at 11 55 45

My vim-mergetool configuration:

let g:mergetool_layout = 'mr'
let g:mergetool_prefer_revision = 'local'

MergetoolDiffExchange has undesired behavior

The current implementation of MergetoolDiffExchange for example, does not work for a situation where both sides of the working window are other valid windows.
For example, when one has BMR layout and is in the BASE window can normally put the diff in the MERGE window by MergetoolDiffExchangeRight. However, in the MERGE window, the diff from the BASE windo (left side) is not got with MergetoolDiffExchangeLeft, instead MergetoolDiffExchangeRight does the job (which is the opposite of what we intend).
3 way diff vertical split layout

Tracking the issue, I realized the DiffExchange function here is problematic. On MergetoolDiffExchangeLeft in MERGE window (BMR layout), it reverses the direction (which was a good thing in putting the diff from B to M with MergetoolDiffExchangeRight) and gets the diff from the REMOTE.
I believe we should not determine the direction by reversing it as it may consider another window which does not have to do anything with what we want (R in the BMR for example). We already know both exchange parties.
I have solved this issue locally and will send a pull request.

`git mergetool` [error]

I get this when I run the command git mergetool I don't know if this is because it tries to run the command MergetoolStart is available or other thing. ๐Ÿ˜ž

image

Do you have an Idea if it is something wrong I have configured or some of the package. o.0

Support mergetool of any scm by loading necessary files at startup

vim-mergetool only supports scms that name their temp files BASE, REMOTE, LOCAL.

Svn names the files something like this:

file.cs.r404563
file.cs.r404217
file.cs
file.cs.mine

You should be able to start vim with something like this:

gvim -f -c "MergetoolStart" "%MERGED%" "%BASE%" "%LOCAL%" "%REMOTE%"

Requiring a specific order would make elements 0:3 of argv() those arguments in that order.

I think it's better to provide an scm-agnostic way to map the files, so maybe a variable g:mergetool_arg_order = 'mblr' that sets up those files could work.

`set nomodifiable` precludes use of `:diffput`

When loading a revision into a new buffer, this plugin will do set nomodifiable on said buffer, which means you can't use :diffput to resolve conflicts. There are obviously ways of working around it, but being able to use :diffput would be preferable since the folding behavior is dependent on the diffs.

REMOTE and LOCAL buffers fail to load

Trying to merge loader.lua and show L or R in a diff and I get errors in those buffers.

:edit loader.lua
:MergetoolStart
:MergetoolToggleLayout LmR

LOCAL:

fatal: Not a valid object name :2:loader.lua

REMOTE:

fatal: Not a valid object name :3:loader.lua

Looks like the issue is that mergetool is assuming merging is started at the root of the repository, but when starting mergetool while editing, it is not.

Probably s:mergedfile_name needs to be relative to the .git.

Tested on 0275a85

Using g:MergetoolSetLayoutCallback for equal sized windows doesn't work on initial MergetoolStart

I want equal sized windows whenever mergetool lays out the windows.

function s:on_mergetool_set_layout(split)
    wincmd =
endfunction
let g:MergetoolSetLayoutCallback = function('s:on_mergetool_set_layout')

This works for MergetoolToggleLayout (switching between lmr and lm), but not the initial layout from MergetoolStart.

Using gvim started like this (see #17) :

gvim --nofork -c "simalt ~x" -c "let g:mergetool_args_order = 'MBLR'" -c "Merge" "%MERGED%" "%BASE%" "%LOCAL%" "%REMOTE%"

Confusion about remote vs local

Hi,

Thanks for the amazing tool.

I am a touch confused about how branches are labeled. Here is the following scenario

git checkout my_stuff
git rebase her_stuff
# ... conflict happened
vi readme.md 

I have noticed that if I run git rebase her_stuff instead of git merge her_stuff, the former marks the windows very differently. For example remote window ends up having my stuff whereas local shows her_stuff.

What is the optimal setup in this scenario? Or is this not the right tool for rebase type workflow?

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.