On Tue, May 26, 2015 at 09:50:49PM +0100, John Lee wrote: > Does anybody have code to stage commits using a the visual diff/merge tools > supported by git-difftool? Is there support in git itself somewhere, even? > > I'm looking for something functionally similar to git add -p > > Looking at the git-difftool source I can see how to write a command to do > it, but wanted to check if it had already been implemented. > > Did I miss a way that already exists? git-gui has a visual staging tool, and I think some other git interfaces do, too (e.g., tig). But I don't think there is a way to interact with an arbitrary 3rd-party diff tool. I would think doing so would depend on the diff tool itself; what facility does it provide for picking lines or a hunk out of a diff and communicating it back to git to stage? If you are interested in looking further, see how the %patch_mode hash is defined in git-add--interactive.perl. Specifically, note that "add -p" is just one case: diff against the index and apply with "apply --cached". But once you have a separate tool for picking hunks, you should be able to drop in the different DIFF/APPLY pairs to implement "checkout -p", etc. -Peff -- To unsubscribe from this list: send the line "unsubscribe git" in the body of a message to majordomo@xxxxxxxxxxxxxxx More majordomo info at http://vger.kernel.org/majordomo-info.html