git/list[1] front-page[2] threads[3] people[4] search[5] about
 

Re: [PATCH/RFC v3] git add -i: Answer questions with a single keypress

From
Jeff King <peff@peff.net>
Date
Nov 6, 2008, 08:42 UTC
Message-ID
<20081106084230.GA4407@sigill.intra.peff.net>
In-Reply-To
<200811050959.25824.sunaku@gmail.com>
On Wed, Nov 05, 2008 at 09:59:25AM -0800, Suraj N. Kurapati wrote:
> Allows the user to answer 'Stage this hunk' questions with a
> single keypress, just like in Darcs.  Previously, the user was
> forced to press the Return key after every choice they made.
> This quickly becomes tiring, burdensome work for the fingers.
I think this is a reasonable goal, but I have a few questions/concerns.
 - There are three versions of your patch, but nobody has commented.
   Clearly we can see what changed, but it is not clear what advantage
   one patch has over the other. Care to elaborate?
 - Term::ReadKey, while common, is not part of base perl. So I think
   using it needs to be conditional, and on systems without it we can
   degrade to the current behavior.
 - There's no facility in your patch for restoring the terminal if we
   break out of the loop in an unexpected way (e.g., via the user
   hitting ^C).
 - This only enhances one particular input, the patch loop. It is
   probably worth being consistent and allowing these behavior for other
   menus (though the numeric inputs are a bit trickier).
-Peff
Previous: Suraj N. KurapatiNext: Suraj N. Kurapati
Message 4 of 8 in “git-add--interactive.perl: Answer questions with a single keypress”
  1. git-add--interactive.perl: Answer questions with a single keypressSuraj N. Kurapati, Nov 5, 2008
  2. Suraj N. KurapatiNov 5, 2008
  3. Suraj N. KurapatiNov 5, 2008
  4. Jeff KingNov 6, 2008
  5. Suraj N. KurapatiNov 6, 2008
  6. Junio C HamanoNov 6, 2008
  7. Jeff KingNov 7, 2008
  8. Jeff KingNov 7, 2008

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.