git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Jeff King <peff@peff.net>
To: Junio C Hamano <gitster@pobox.com>
Cc: Evan Driscoll <driscoll@cs.wisc.edu>, git@vger.kernel.org
Subject: Re: Feature suggestion: new 'git add -i' command to discard working copy changes
Date: Tue, 18 Dec 2012 16:59:14 -0500	[thread overview]
Message-ID: <20121218215914.GB1806@sigill.intra.peff.net> (raw)
In-Reply-To: <7vvcbzdoy9.fsf@alter.siamese.dyndns.org>

On Tue, Dec 18, 2012 at 01:34:38PM -0800, Junio C Hamano wrote:

> Evan Driscoll <driscoll@cs.wisc.edu> writes:
> 
> > It's not infrequent that I want to discard changes I've made locally to
> > files ('git checkout file.txt') and find myself wishing that this was an
> > action available from the 'git add --interactive' UI; it feels like it
> > would fit in.
> 
> Hrm, not really.  "git add" is about manipulating the index and its
> promise is that it won't touch working tree files.  And people rely
> on that promise.
> 
> I can see how it would be useful to have a UI that is more
> interactive than CLI that shows you a list of paths and lets you
> pick from the list to run "git checkout" on, but I think "git add"
> is a bad match to it.

Yeah. We already generalized "git add -p" to "git checkout -p" (and
"reset -p", etc) to do hunk selection. Nobody bothered to generalize
the rest of "git add --interactive", but logically having "git checkout
--interactive" (and "git reset --interactive") would make sense.

I always assumed nobody really used the full "add -i", but maybe it is
because I am such a command-line snob. Evan, are you after hunk
selection (like choosing "patch" from the interactive UI), or full path
selection?

-Peff

  reply	other threads:[~2012-12-18 21:59 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-12-18 21:03 Feature suggestion: new 'git add -i' command to discard working copy changes Evan Driscoll
2012-12-18 21:34 ` Junio C Hamano
2012-12-18 21:59   ` Jeff King [this message]
2012-12-18 22:10     ` Evan Driscoll
2012-12-18 22:20       ` Jeff King

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

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

  git send-email \
    --in-reply-to=20121218215914.GB1806@sigill.intra.peff.net \
    --to=peff@peff.net \
    --cc=driscoll@cs.wisc.edu \
    --cc=git@vger.kernel.org \
    --cc=gitster@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.
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 NNTP newsgroup(s).