git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Wincent Colaiuta <win@wincent.com>
To: Junio C Hamano <gitster@pobox.com>
Cc: git@vger.kernel.org, dzwell@gmail.com, peff@peff.net,
	Matthieu.Moy@imag.fr
Subject: Re: [PATCH] Highlight keyboard shortcuts in git-add--interactive
Date: Sat, 1 Dec 2007 14:58:30 +0100	[thread overview]
Message-ID: <71367167-E94C-4229-9A29-3B6C2DDC75DC@wincent.com> (raw)
In-Reply-To: <7vy7cf87jz.fsf@gitster.siamese.dyndns.org>


El 1/12/2007, a las 3:36, Junio C Hamano escribió:

> Wincent Colaiuta <win@wincent.com> writes:
>
>> A "hidden" feature is that any string can be entered, and an anchored
>> regex search is used to find the first matching option.
>
> I'd run s/the first/the uniquely/ here.
>
> When list_and_choose() function is letting you choose more than one
> items, its prompt becomes ">> ", instead of "> " that is used for a
> singleton choice.  To that prompt, you can say "3-7" (Add these 5  
> items
> to the choice), "*" (I want all of them), "-2-4" (exclude 2 and 3  
> and 4
> from the set I have chosen so far).  These are also "hidden", and need
> to be documented, but that would be a separate patch.

Agreed that it belongs in a separate patch.

But I'm glad you brought this up as it reminds me of the need to watch  
out for those characters which have special meaning for  
list_and_choose().

> I'd rewrite the last line to:
>
> 	return (defined $prefix) ? "[$prefix]$remainder" : $remainder;
>
> just in case the unique prefix is "0".  Otherwise you would lose the
> first letter from "00ReadMe" and show remainder "0ReadMe" alone.

Excellent catch. Crazy old perl; I didn't realize that "0" (the  
string, not the number) would evaluate to false.

Will send a separate mail with a revised, squashed patch with these  
changes:

- "s/the first/the uniquely/" in the commit message as you suggest

- filter out prefixes which contain characters with special meaning  
for list_and_choose()

- check "defined $prefix" rather than just "$prefix"

- also fixes a problem discovered while playing with this; it didn't  
play nicely with untracked files

Cheers,
Wincent

  reply	other threads:[~2007-12-01 14:02 UTC|newest]

Thread overview: 17+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2007-11-21 14:27 [PATCH] Highlight keyboard shortcuts in git-add--interactive Wincent Colaiuta
2007-11-21 14:32 ` Matthieu Moy
2007-11-21 15:28 ` Jeff King
2007-11-21 23:00   ` Dan Zwell
2007-11-28 23:56 ` Junio C Hamano
2007-11-29  1:08   ` Wincent Colaiuta
2007-11-29 12:00   ` Wincent Colaiuta
2007-11-29 14:51     ` Jeff King
2007-12-01  2:36     ` Junio C Hamano
2007-12-01 13:58       ` Wincent Colaiuta [this message]
2007-12-01 14:07       ` [PATCH 1/2] " Wincent Colaiuta
2007-12-01 14:07         ` [PATCH 2/2] Teach git-add--interactive to highlight untracked file prefixes Wincent Colaiuta
2007-12-01 14:15         ` [PATCH 1/2] Highlight keyboard shortcuts in git-add--interactive Wincent Colaiuta
2007-12-01 14:29           ` [REPLACEMENT PATCH] " Wincent Colaiuta
2007-12-02 14:11       ` [PATCH] " Wincent Colaiuta
2007-12-02 19:06         ` Junio C Hamano
2007-12-03  8:09           ` 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=71367167-E94C-4229-9A29-3B6C2DDC75DC@wincent.com \
    --to=win@wincent.com \
    --cc=Matthieu.Moy@imag.fr \
    --cc=dzwell@gmail.com \
    --cc=git@vger.kernel.org \
    --cc=gitster@pobox.com \
    --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.
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).