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: Wincent Colaiuta <win@wincent.com>, git@vger.kernel.org
Subject: Re: [PATCH 2/4] Teach git-add--interactive to accept a file path to patch
Date: Thu, 22 Nov 2007 04:13:57 -0500	[thread overview]
Message-ID: <20071122091356.GD7153@sigill.intra.peff.net> (raw)
In-Reply-To: <7vk5obb09a.fsf@gitster.siamese.dyndns.org>

On Wed, Nov 21, 2007 at 04:18:57PM -0800, Junio C Hamano wrote:

> What I meant was that if "git add -i" (unrestricted) shows paths
> from a set A, "git add -i paths..." should show paths from a
> subset of the set A and that subset should be defined with the
> existing ls-files pathspec semantics.

Ah, I think that is definitely the right behavior. But it does raise one
more question: is going right into the 'add hunk' interface the correct
behavior, or is that an orthogonal issue?

IOW, do we actually want to support:

  # go to patch menu for each file
  git-add -i -p file1 file2 ...
  # add untracked for each file
  git-add -i -a file1 file2 ...

Which is of course tricky because the '-p' is contextually dependent on
the presence of '-i'.

But perhaps there is no need, since for just these two operations you
can do something like:

  foreach my $file (@ARGV) {
    if(tracked($file)) {
      patch_update_file($file);
    }
    else {
      add_tracked($file);
    }
  }

Are there any other per-file operations that would make sense to start
with? Or might somebody just want to path-limit _without_ starting the
hunk selector?

-Peff

  parent reply	other threads:[~2007-11-22  9:14 UTC|newest]

Thread overview: 39+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2007-11-21 12:36 [PATCH] teaching git-add--interactive to accept a file param Wincent Colaiuta
2007-11-21 12:36 ` [PATCH 1/4] Refactor patch_update_cmd Wincent Colaiuta
2007-11-21 12:36   ` [PATCH 2/4] Teach git-add--interactive to accept a file path to patch Wincent Colaiuta
2007-11-21 12:36     ` [PATCH 3/4] Teach builtin-add to pass a path argument to git-add--interactive Wincent Colaiuta
2007-11-21 12:36       ` [PATCH 4/4] Document optional file parameter " Wincent Colaiuta
2007-11-21 15:21     ` [PATCH 2/4] Teach git-add--interactive to accept a file path to patch Jeff King
2007-11-21 16:15       ` Wincent Colaiuta
2007-11-21 20:40       ` Junio C Hamano
2007-11-21 22:44         ` Wincent Colaiuta
2007-11-22  0:02           ` Updates: teaching git-add--interactive to accept a file param Wincent Colaiuta
2007-11-22  0:02             ` [PATCH 1/4] Suppress spurious linefeeds in git-add--interactive Wincent Colaiuta
2007-11-22  0:02               ` [PATCH 2/4] Teach git-add--interactive to accept multiple file params Wincent Colaiuta
2007-11-22  0:02                 ` [PATCH 3/4] Teach builtin-add to pass multiple paths to git-add--interactive Wincent Colaiuta
2007-11-22  0:02                   ` [PATCH 4/4] Update git-add documentation for multiple interactive paths Wincent Colaiuta
2007-11-22  9:08                   ` [PATCH 3/4] Teach builtin-add to pass multiple paths to git-add--interactive Jeff King
2007-11-22 10:28                     ` Wincent Colaiuta
2007-11-22 10:33                       ` Jeff King
2007-11-22 11:02                         ` Wincent Colaiuta
2007-11-22 11:37                           ` Jeff King
2007-11-22  8:59               ` [PATCH 1/4] Suppress spurious linefeeds in git-add--interactive Jeff King
2007-11-22 10:18                 ` Wincent Colaiuta
2007-11-22 10:38                   ` Junio C Hamano
2007-11-22  0:18           ` [PATCH 2/4] Teach git-add--interactive to accept a file path to patch Junio C Hamano
2007-11-22  1:36             ` [PATCH] Add path-limiting to git-add--interactive Wincent Colaiuta
2007-11-22  9:13               ` Junio C Hamano
2007-11-22  9:45                 ` Junio C Hamano
2007-11-22 11:35                   ` Wincent Colaiuta
2007-11-22 11:14                 ` Wincent Colaiuta
2007-11-22  1:41             ` [PATCH 2/4] Teach git-add--interactive to accept a file path to patch Wincent Colaiuta
2007-11-22  9:13             ` Jeff King [this message]
2007-11-22  9:50               ` Junio C Hamano
2007-11-22  9:57                 ` Jeff King
2007-11-22 10:44                 ` Wincent Colaiuta
2007-11-22 11:24                   ` Jeff King
2007-11-22 11:29                   ` Junio C Hamano
2007-11-22 11:36                     ` Jeff King
2007-11-22 13:34                     ` Wincent Colaiuta
2007-11-22 19:29                       ` Junio C Hamano
2007-11-22 21:55                         ` Wincent Colaiuta

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=20071122091356.GD7153@sigill.intra.peff.net \
    --to=peff@peff.net \
    --cc=git@vger.kernel.org \
    --cc=gitster@pobox.com \
    --cc=win@wincent.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).