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)
- Readme missing info about fuzzy finders
- Making the popup windows' names easily legible
- Expanding the "Recent commits" section sometimes doesn't work HOT 8
- Run git command with certain environment variables
- Neogit causes a black loading screen when starting neovim on v0.10 nightly
- ERROR while toggling diff: Blocking on future timed out or was interrupted.
- Renamed file cannot be shown properly HOT 9
- Revert changes to DiffAtFile action HOT 1
- Multitude of keymap issues during user customization HOT 6
- Neogit tab fails to load HOT 12
- Logo for Neogit HOT 14
- Status bufer not focused nor is status updated on new cwd
- Failing to open popups for more than one repositories
- Option to open status with the current file selected
- Status buffer broken during rebase with unmerged paths HOT 4
- Compose commit messages while pre-commit hooks are running HOT 4
- Cannot checkout worktree HOT 2
- `w` opens up worktree instead of jumping a word HOT 4
- Telescope integration not working HOT 4
- Ask the user if to force push a branch
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.