git@vger.kernel.org mailing list mirror (one of many)
 help / color / mirror / code / Atom feed
From: Johannes Schindelin <Johannes.Schindelin@gmx.de>
To: Jeff King <peff@peff.net>
Cc: Cameron Steffen <cam.steffen94@gmail.com>, git@vger.kernel.org
Subject: Re: Stage or discard a hunk at a time?
Date: Tue, 30 Apr 2019 19:19:19 -0400 (DST)	[thread overview]
Message-ID: <nycvar.QRO.7.76.6.1904301918230.45@tvgsbejvaqbjf.bet> (raw)
In-Reply-To: <20190422192821.GA22798@sigill.intra.peff.net>

Hi,

On Mon, 22 Apr 2019, Jeff King wrote:

> On Wed, Jan 16, 2019 at 01:09:03PM -0600, Cameron Steffen wrote:
>
> > I have this feature idea for git. There should be a command that
> > effectively combines git add -p and git checkout -p so that I can
> > navigate changed hunks and either stage or discard them.
> >
> > There is already a SO question asking about this exactly...
> > https://stackoverflow.com/questions/11538650/simultaneously-git-add-p-and-git-checkout-p
> >
> > Has this been discussed before? Is this a reasonable request? If so, I
> > might look into contributing the change myself.
>
> This is something I've sometimes wanted, too. I don't think it would be
> _too_ hard to do by modifying the add-interactive code. Both of those
> operations are driven by the same code; see the %patch_modes hash in
> git-add--interactive.perl, which defines the various situations. You
> would need to modify the actual code to handle the tri-state (there is
> not just "yes, apply it" and "no, leave it alone", but now "apply /
> discard / skip"). But it seems do-able.
>
> If you do plan to work on it, be aware that the perl bits of
> add--interactive are being re-written in C. So it might make sense to
> target the new C implementation instead of modifying the perl.

The work on that is tracked in PRs 170-175 on
https://github.com/gitgitgadget/git, i.e.

- https://github.com/gitgitgadget/git/pull/170
- https://github.com/gitgitgadget/git/pull/171
- https://github.com/gitgitgadget/git/pull/172
- https://github.com/gitgitgadget/git/pull/173
- https://github.com/gitgitgadget/git/pull/174
- https://github.com/gitgitgadget/git/pull/175

Ciao,
Johannes

  reply	other threads:[~2019-04-30 23:19 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-01-16 19:09 Stage or discard a hunk at a time? Cameron Steffen
2019-04-22 19:28 ` Jeff King
2019-04-30 23:19   ` Johannes Schindelin [this message]
2019-04-28  8:47 ` David Aguilar

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=nycvar.QRO.7.76.6.1904301918230.45@tvgsbejvaqbjf.bet \
    --to=johannes.schindelin@gmx.de \
    --cc=cam.steffen94@gmail.com \
    --cc=git@vger.kernel.org \
    --cc=peff@peff.net \
    /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).