Skip to content
This repository was archived by the owner on Sep 21, 2019. It is now read-only.

Conversation

@kota65535
Copy link

Summary (required)

In 2-way diff, Working tree can be reverted partially to Index by do or dp. It is useful to clean unneeded code.
But in 3-way diff, there is no keymap to make Worktree diffget from Index. This PR add do keymap to realize it.

@lambdalisue
Copy link
Owner

I wonder if you have considered about HEAD -> Worktree?

I'm not sure if I should care about HEAD -> Worktree as well but in that case, the mapping should be doi (diff obtain from index) for Index -> Worktree and dol (diff obtain from left/local) for HEAD -> Worktree. It's OK if you have consider about HEAD -> Worktree and decided to ignore it while I could not find any use case for HEAD -> Worktree but in case.

@kota65535
Copy link
Author

kota65535 commented Jan 8, 2017

I wonder if you have considered about HEAD -> Worktree?

In fact, I tried it at first but I think it can be confusing.
If there are changes in Working tree only, there is no problem because HEAD and Index are equal.
But in the situation that I'm going to revert staged changes partially, there are 2 ways to be considered.

  1. First HEAD -> Index, next Index -> Worktree
  2. First HEAD -> Worktree, next HEAD -> Index

I preferred the first approach because it is more similar to the usual workflow for me.
Second approach temporarily comes into the state that Index is not equal to both HEAD and Worktree, which does not occur in a usual workflow by git command, I think.

It may be better to do HEAD -> Index and Index -> Worktree at once.

@lambdalisue
Copy link
Owner

lambdalisue commented Jan 8, 2017

I preferred the first approach because it is more similar to the usual workflow for me.
Second approach temporarily comes into the state that Index is not equal to both HEAD and Worktree, which does not occur in a usual workflow by git command, I think.

I see. I agree with you approach.

It may be better to do HEAD -> Index and Index -> Worktree at once.

Sounds interesting but I'm feeling that is a bit too much.

The code looks good so please add documentation about this new mapping around https://github.com/lambdalisue/vim-gita/blob/master/doc/gita.txt#L245-L263

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants