Comments (8)
@Shatur95 I would also like more of a buffer oriented style like in vscode intead of the common 3 split diff thing.
from neogit.
What about VSCode-like approach?
Very handy and easy to use.
There is already a plugin in Vimscript for it.
from neogit.
Supporting a view similiar to #57 for merge conflicts would also be good.
from neogit.
This might be enough info to attempt implementing a merge feature.
When trying to merge branches and there appears to be a conflict, there seems to at least 3 ways to detect this:
git merge <branch>
exit status will be 1. Some error text is also sent via stdin.git log --merge --oneline
will show the conflicting commits. It'll error out if it's not in the middle of a merge.git status --porcelain
will return items marked with "UU" indicating the file is unmerged.
After determining we're in the middle of a merge, we can use git diff
show a list of conflicting files & hunks.
For example:
diff --cc file1.txt
index f201d7f,2a46cea..0000000
--- a/file1.txt
+++ b/file1.txt
@@@ -1,7 -1,5 +1,12 @@@
++<<<<<<< HEAD
+Changes are
+an unavoidable
+part of
+life
++=======
+ Conflicts
+ Happens
++>>>>>>> develop
Hello
World!
This gives us a definitive list of files and hunks to visit to resolve the merge conflict. It shouldn't be too difficult to implement a "jump to next conflict" feature. Maybe this info can be presented somewhat like the status buffer to keep a consistent look & feel?
To bring up the diff interface, we need the contents of the two versions of the file where the conflict happened:
-
Ours/local version
Take the on-disk/working-tree version and cleanup to strip out the conflict markers & text. This should bring across any merged content that did not produce any conflict -
Theirs/remote version
The file diff headerindex f201d7f,2a46cea..0000000
contains enough info to grab the contents of the file that produced the conflict. In this case, we can rungit show 2a46cea file1.txt
.
from neogit.
@Odie nice work!
I guess now we really just have to think about the ui/ux stuff. What are you expectations for something like this?
Maybe this info can be presented somewhat like the status buffer to keep a consistent look & feel?
I think something like this would be cool! I don't know how we would support expanding the viewed code upwards/downwards though.
from neogit.
I think something like this would be cool! I don't know how we would support expanding the viewed code upwards/downwards though.
Maybe it can be a 3 pane operation. One pane can be like the status view, where the purpose is to:
- Get an overview of remaining conflicting hunks
- Select and navigate to the conflicted hunk/lines (especially useful for jumping to a specific file)
The other two panes would be to display the file diffs when the conflicted lines are navigated to. A hot key would be available to jump to the next conflict. It’d take the user to another file if there are no more conflicts in the current file.
from neogit.
That sounds good too. Just thought this merge feature initially came from someone asking for a 2 way diffing merge view. :)
from neogit.
Diffview now has support for merge conflicts similar to the VSCode approach, so from Neogit's side, all which remains to do is reporting of the merge failure rather than "Git command failed press $ ...", as well as showing then inline conflict diff like with modified files
from neogit.
Related Issues (20)
- Override palette in config HOT 1
- Status - Mapping of `o` is broken now HOT 1
- `use_default_keymaps = false` does not do anything HOT 1
- Setting a hotkey to `false` errors out at startup
- Neogit fails to start when an untracked file name is just a number
- Some neogit buffers break `statuscolumn` HOT 1
- Can't handle `typechange`
- Chevron rendering issues? HOT 1
- exception when initing a new repo (windows + wsl) HOT 1
- Unnamed buffers left in buffer list after closing Neogit
- Fails to parse diffs with submodule changes HOT 1
- "Go to file" is not working HOT 12
- Quitting a Neogit tab should focus previously focused tab HOT 2
- Cannot close last window HOT 1
- Cursor jumps to the top of the screen when saving a file when Neogit is open HOT 1
- Suggestion: Submit commit if .git/COMMIT_EDITMSG is saved and closed HOT 2
- Neogit not workign after update - neogit has not been setup HOT 2
- Errors around stash pop
- Properly Colored Unicode Graphs
- `:Neogit blame` HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from neogit.