git@vger.kernel.org mailing list mirror (one of many)
 help / color / mirror / code / Atom feed
From: David Aguilar <davvid@gmail.com>
To: John Lee <jjl@pobox.com>
Cc: git@vger.kernel.org
Subject: Re: Staging commits with visual diff tools?
Date: Sun, 31 May 2015 19:25:17 -0700	[thread overview]
Message-ID: <20150601022515.GA66417@gmail.com> (raw)
In-Reply-To: <alpine.DEB.2.10.1505311029210.3664@alice>

On Sun, May 31, 2015 at 10:36:52AM +0100, John Lee wrote:
> On Sat, 30 May 2015, David Aguilar wrote:
> 
> >On Tue, May 26, 2015 at 09:50:49PM +0100, John Lee wrote:
> >>Hi
> >>
> >>Does anybody have code to stage commits using a the visual
> >>diff/merge tools supported by git-difftool?  Is there support in git
> ...
> >I'm a g/vim user, so git-cola is finely tuned for keyboard
> >usage.  If we implement these feature in Git, we should consider
> >providing the same workflows/hotkeys as cola.
> 
> Just to be clear I'm not planning on contributing my script back to
> git, it will just be a standalone script in a separate repo.
> 
> I'll give git-cola a try, thanks.  I just ran it and see it supports
> e.g. right click to stage and launching difftools -- does it also
> support launching a difftool to edit the index?

If you have stuff staged and use ctrl-d (or right-click->difftool),
git cola will run, "git difftool --staged -- <path>".

difftool will already point back to your worktree whenever
possible through the GIT_EXTERNAL_DIFF machinery that it uses.

After changes are made in the worktree you select files, lines,
or hunks and stage them.  Doing it in one step could be as
simple as having a script to automatically call "git add" after
difftool, or "ctrl-s" in cola to stage the whole file.

A not as simple (but potentially quite helpful) use case is a
tool that does a 3-way merge between HEAD, index, and worktree,
and writes the result back to the worktree (or index?).
The mergetool--lib backend could be leveraged for that feature.

Were you thinking of something like this, or something else?
Can you describe your use case a bit more?

It seems like we have most of the use cases covered with stock
git, but I'm not sure if I'm missing something.

cheers,
-- 
David

  reply	other threads:[~2015-06-01  2:25 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-05-26 20:50 Staging commits with visual diff tools? John Lee
2015-05-27  7:28 ` Jeff King
2015-05-27  7:34   ` John Lee
2015-05-29  9:57     ` Michael J Gruber
2015-05-31  1:59 ` David Aguilar
2015-05-31  9:36   ` John Lee
2015-06-01  2:25     ` David Aguilar [this message]
2015-06-01 19:36       ` John Lee
2015-06-27 23:23         ` John Lee
2015-06-28 17:56           ` John Lee

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: http://vger.kernel.org/majordomo-info.html

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20150601022515.GA66417@gmail.com \
    --to=davvid@gmail.com \
    --cc=git@vger.kernel.org \
    --cc=jjl@pobox.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://80x24.org/mirrors/git.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).