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

Re: [PATCH v4 2/2] launch_editor(): indicate that Git waits for user input

From
Jeff King <peff@peff.net>
Date
Dec 4, 2017, 17:30 UTC
Message-ID
<20171204173024.GE13332@sigill.intra.peff.net>
In-Reply-To
<xmqqvahojssu.fsf@gitster.mtv.corp.google.com>
On Sat, Dec 02, 2017 at 09:15:29PM -0800, Junio C Hamano wrote:
Show 17 quoted lines
> Jeff King <peff@peff.net> writes:
> 
> > I tried to think of ways this "show a message and then delete it" could
> > go wrong. It should work OK with editors that just do curses-like
> > things, taking over the terminal and then restoring it at the end.
> > ...
> 
> I think that it is not worth to special-case "dumb" terminals like
> this round of the patches do.  If it so much disturbs reviewers that
> "\e[K" may not work everywhere, we can do without the "then delete
> it" part.  It was merely trying to be extra nice, and the more
> important part of the "feature" is to be noticeable, and I do think
> that not showing anything on "dumb", only because the message cannot
> be retracted, is putting the cart before the horse.  
> 
> Since especially now people are hiding this behind an advise.*
> thing, I think it is OK to show a message and waste a line, even.

Yeah, I was tempted to suggest just dropping this terminal magic completely. But it probably _does_ work and is helpful in the majority of cases (i.e., where people have in-terminal editors). I dunno.

I am a little wary of hiding behind "but you can disable it with a config option", because that's still a thing that users have to actually do to get the previous behavior. And I expect to get some "ugh, git is too chatty and annoying" backlash once this is in a released version.

But maybe that is just being paranoid. It's not like we don't have a lot of other advice flags. I really could go either way on this whole thing (but I'll be setting the advice flag myself ;) ).

Show 12 quoted lines
> > An even worse case (and yes, this is really reaching) is:
> >
> >   $ GIT_EDITOR='echo one; printf "two\\r"; vim' git commit
> >   hint: Waiting for your editor input...one
> >   Aborting commit due to empty commit message.
> >
> > There we ate the "two" line.
> 
> Yes, I would have to agree that this one is reaching, as there isn't
> any valid reason other than "the editor then wanted to do \e[K
> later" for it to end its last line with CR.  So our eating that line
> is not a problem.

Yeah, this was just me trying to come up with all possible implications. I agree it's probably not worth worrying about.

-Peff
Previous: Junio C HamanoNext: Thomas Adam
Message 24 of 31 in “launch_editor(): indicate that Git waits for user input”
  1. 0/2 launch_editor(): indicate that Git waits for user inputlars.schneider@autodesk.com, Nov 29, 2017
  2. 1/2 refactor "dumb" terminal determinationlars.schneider@autodesk.com, Nov 29, 2017
  3. Jeff KingNov 30, 2017
  4. Kaartic SivaraamDec 1, 2017
  5. 2/2 launch_editor(): indicate that Git waits for user inputlars.schneider@autodesk.com, Nov 29, 2017
  6. Jeff KingNov 30, 2017
  7. Kaartic SivaraamDec 1, 2017
  8. Lars SchneiderDec 1, 2017
  9. Jeff KingDec 1, 2017
  10. Kaartic SivaraamDec 2, 2017
  11. Lars SchneiderDec 3, 2017
  12. Kaartic SivaraamDec 4, 2017
  13. Jeff KingDec 4, 2017
  14. Lars SchneiderDec 4, 2017
  15. Jeff KingDec 4, 2017
  16. Lars SchneiderDec 4, 2017
  17. Jeff KingDec 4, 2017
  18. Jeff KingDec 4, 2017
  19. Junio C HamanoDec 3, 2017
  20. Lars SchneiderDec 3, 2017
  21. Jeff KingDec 4, 2017
  22. Lars SchneiderDec 4, 2017
  23. Junio C HamanoDec 4, 2017
  24. Jeff KingDec 4, 2017
  25. Thomas AdamNov 29, 2017
  26. Lars SchneiderNov 30, 2017
  27. Thomas AdamNov 30, 2017
  28. Andreas SchwabNov 30, 2017
  29. Kaartic SivaraamDec 1, 2017
  30. Jeff KingNov 30, 2017
  31. Thomas AdamNov 30, 2017

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.