git@vger.kernel.org mailing list mirror (one of many)
 help / color / mirror / code / Atom feed
From: John Keeping <john@keeping.me.uk>
To: git@vger.kernel.org
Subject: Different diff strategies in add --interactive
Date: Mon, 10 Jun 2013 15:28:25 +0100	[thread overview]
Message-ID: <20130610142825.GI22905@serenity.lan> (raw)

I've just been trying to use "add -p" to stage some changes which happen
to be textually entangled with other changes that I do not want to
stage.

It turns out that "git diff --patience" does a really good job
splitting this into exactly the hunks I want, but "add --interactive"
doesn't let me change the diff algorithm it uses.  I tried setting
"diff.algorithm" to "patience", but of course add--interactive uses
plumbing diff commands that ignore configuration settings.

As a one off, I locally modified add--interactive to unconditionally use
patience diff and it has worked perfectly in this case, but I don't want
to have to apply a patch if I ever want this behaviour in the future.

I think the first thing to do is read the "diff.algorithm" setting in
git-add--interactive and pass its value to the underlying diff-index and
diff-files commands, but should we also have a command line parameter to
git-add to specify the diff algorithm in interactive mode?  And if so,
can we simply add "--diff-algorithm" to git-add, or is that too
confusing?

             reply	other threads:[~2013-06-10 14:29 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-06-10 14:28 John Keeping [this message]
2013-06-10 19:28 ` Different diff strategies in add --interactive Junio C Hamano
2013-06-10 21:11   ` Jeff King
2013-06-10 21:46     ` John Keeping
2013-06-10 21:56       ` Jeff King
2013-06-12 18:44         ` [PATCH] add--interactive: respect diff.algorithm John Keeping
2013-06-12 19:18           ` Jeff King
2013-06-23 19:19           ` Junio C Hamano
2013-06-23 19:50             ` John Keeping
2013-06-23 20:37               ` Junio C Hamano

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=20130610142825.GI22905@serenity.lan \
    --to=john@keeping.me.uk \
    --cc=git@vger.kernel.org \
    /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).