git-interactive-rebase-tool icon indicating copy to clipboard operation
git-interactive-rebase-tool copied to clipboard

Linting for possible merge conflicts

Open da-x opened this issue 4 years ago • 3 comments

Maybe git-interactive-rebase-tool can show errors in case there would be merge errors, even before the user has exited and saved the editor to continue the rebase.

See example in da-x/depree: Vim ALE checker for Git rebase interactive. Initially I wrote this tool for commit dependency detection, but then I fitted it to perform rebase script linting in my editor.

It is written in Rust and also uses libgit2. It's quite fast, does the conflict checking in memory and it does not affect Git state at all. so should be easy to integrate in. Maybe I can turn depree into a library for git-interactive-rebase-tool to use.

da-x avatar Jul 22 '20 10:07 da-x

This would be a killer feature! It could simply highlight the commits where conflicts arise. A status line could also show which files conflict.

koreno avatar Jul 22 '20 10:07 koreno

@da-x I think this is a great idea and @koreno 's idea of showing the conflicting files in the diff view is also great!

I am also working on a "diff" view and this could even be expanded to show the conflicting hunks in the diff as well.

MitMaro avatar Jul 22 '20 11:07 MitMaro

I took a stab as this recently, but the https://github.com/rust-lang/git2-rs library doesn't have a nice way to do this in memory. I am reluctant to make changes to the working directory, or even within .git.

I'm still investigating options, but I am going to put this on the backlog for now, as I add some easier features. I really want this, though!

MitMaro avatar Mar 26 '22 15:03 MitMaro