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 7, 2008, 19:19 UTC
Message-ID
<20081107191910.GA15218@coredump.intra.peff.net>
In-Reply-To
<200811060815.16797.sunaku@gmail.com>
On Thu, Nov 06, 2008 at 08:15:16AM -0800, Suraj N. Kurapati wrote:
> v1 and v2 make the mistake of setting raw mode, which prevent the user from 
> pressing Control-C to exit the program.  v3 fixes this by using cbreak mode.
OK, makes sense.
> The git-svn.perl script also uses Term::ReadKey.  Since it is already in the 
> git source repository, I thought it was okay to use Term::ReadKey.

We are not always consistent with such things, and git-add--interactive is a little "more core" than git-svn, I think. Still, maybe I am being overly cautious. We can always try it and see who complains. ;)

I think considering this improvement:
Show 5 quoted lines
> >  - 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).
> 
> Understood.

it makes sense to factor the ReadKey procedure into a separate function anyway. At which point it should be easy enough to substitute in the original behavior if there is no ReadKey.

Side note: I don't know if such people exist, but I suppose it is possible that somebody would _prefer_ the old behavior. In which case factoring it out will also make it easier to predicate the behavior on a config variable, if people want that.

-Peff
Previous: Jeff King
Message 8 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.