Git-meld-index: Run meld or any Git difftool to interactively stage changes(github.com)
github.com
Git-meld-index: Run meld or any Git difftool to interactively stage changes
https://github.com/jjlee/git-meld-index
14 comments
That looks great, I'll give it a try at work!
Basically, if I understand well, it's a GUI over `git add -p`. Instead of the CLI short diff, you get a `meld` instance that computes the diff between two (virtual) directories, one with the modified files of your git, one with the current index. And like `git -p`, you select what you want to add to the index.
That seems great to have a global vision of modifications, and to be able to navigate between the differents files to remember exactly what belongs to the commit!
I had such a tool in mind since I discovered `git add -p`, thanks for working on it!
Basically, if I understand well, it's a GUI over `git add -p`. Instead of the CLI short diff, you get a `meld` instance that computes the diff between two (virtual) directories, one with the modified files of your git, one with the current index. And like `git -p`, you select what you want to add to the index.
That seems great to have a global vision of modifications, and to be able to navigate between the differents files to remember exactly what belongs to the commit!
I had such a tool in mind since I discovered `git add -p`, thanks for working on it!
It's not just "selecting" exactly but editing (see the README). git gui etc. don't work quite this way I think:
Using the tool I'm finding I'm quite often clicking the right arrow to add a hunk to the index, then just editing the right hand side to delete a few lines or tweak what was edited somehow. This is a very "natural" way to stage just what you want.
Also once it supports git reset -p like functionality and also editing the working tree (see the README), I guess that visual editing workflow will get more powerful.
Using the tool I'm finding I'm quite often clicking the right arrow to add a hunk to the index, then just editing the right hand side to delete a few lines or tweak what was edited somehow. This is a very "natural" way to stage just what you want.
Also once it supports git reset -p like functionality and also editing the working tree (see the README), I guess that visual editing workflow will get more powerful.
You may be interested in `git gui`, which also provides a GUI over `git add -p`. (It's part of the main git distribution, but IIRC, several distros make it a separate package)
> I had such a tool in mind since I discovered `git add -p`, thanks for working on it!
Eclipse's egit plugin provides visual partial staging.
Eclipse's egit plugin provides visual partial staging.
> navigate to a change without saying 'n' to every change you want to skip
This tool sounds great, but in case you didn't know, 'git add -p' supports '/' to search for a matching hunk.
This tool sounds great, but in case you didn't know, 'git add -p' supports '/' to search for a matching hunk.
If you use emacs - make sure you're using magit!
SourceTree also has this functionality.
Why not just use 'git gui'?
Quoting from the README:
In some cases meld is easier / quicker to use than git add -p or the staging feature in tools like git gui. That's because meld allows you, for example, to:
Q. Why not just use <favourite staging tool>?
A. Different tools have different pros and cons. You should use what works best for you for a given task! However, I do find tools like meld have some advantages -- see the list at the top of this README for some of them. Try it and see what works for you.
In some cases meld is easier / quicker to use than git add -p or the staging feature in tools like git gui. That's because meld allows you, for example, to:
see more context
see intra-line diffs
edit by hand and see 'live' diff updates (updated after every keypress)
navigate to a change without saying 'n' to every change you want to skip
...Q. Why not just use <favourite staging tool>?
A. Different tools have different pros and cons. You should use what works best for you for a given task! However, I do find tools like meld have some advantages -- see the list at the top of this README for some of them. Try it and see what works for you.
Because this isn't the same thing. Did you really create an account just to ask such a question?
You can stage individual lines and hunks (and split up big hunks) in git gui. So it's a valid question.
I found it odd reference git cli commands as comparison when git gui seems to do precisely what this tool claims to do.
tig can also be used to stage changes.
[1] http://vimcasts.org/episodes/fugitive-vim-working-with-the-g...