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

Re: [PATCH v2] launch_editor(): indicate that Git waits for user input

From
Junio C Hamano <gitster@pobox.com>
Date
Nov 17, 2017, 18:40 UTC
Message-ID
<xmqqy3n4rbnr.fsf@gitster.mtv.corp.google.com>
In-Reply-To
<20171117135109.18071-1-lars.schneider@autodesk.com>
lars.schneider@autodesk.com writes:
Show 6 quoted lines
> Junio posted the original version of this patch [1] as response to my RFC [2].
> I took Junio's patch and slightly changed the commit message as well as the
> message printed to the user after GIT_EDITOR is invoked [3].
>
> Thanks,
> Lars
Thanks.
Show 11 quoted lines
> diff --git a/editor.c b/editor.c
> index 7519edecdc..23db92d8c6 100644
> --- a/editor.c
> +++ b/editor.c
> @@ -40,6 +40,32 @@ int launch_editor(const char *path, struct strbuf...
> ...
> +		if (close_notice) {
> +			fprintf(
> +				stderr,
> +				"Launched your editor ('%s'). Adjust, save, and close the "
> +				"file to continue. Waiting for your input... ", editor

How wide is your typical terminal window? With message this long, a sample standalone program I used while developing the prototype of this feature no longer can retract this "temporary" message.

Would something shorter like "Waiting for you to finish editing..." work well enough?

-- -- -- #include <stdio.h>

int main(void)
{
	const char *EL = "\033[K"; /* Erase in Line */
	const char *editor = "emacsclient";
	fprintf(
		stderr,
		"Launched your editor ('%s'). Adjust, save, and close the "
		"file to continue. Waiting for your input... ", editor);
	fflush(stderr);
	sleep(2);
	fprintf(stderr, "\r%s", EL);
	fflush(stderr);
	return 0;
}
-- -- --
Previous: lars.schneider@autodesk.comNext: Lars Schneider
Message 2 of 12 in “launch_editor(): indicate that Git waits for user input”
  1. launch_editor(): indicate that Git waits for user inputlars.schneider@autodesk.com, Nov 17, 2017
  2. Junio C HamanoNov 17, 2017
  3. Lars SchneiderNov 22, 2017
  4. Eric SunshineNov 17, 2017
  5. Junio C HamanoNov 18, 2017
  6. Kaartic SivaraamNov 19, 2017
  7. Junio C HamanoNov 20, 2017
  8. Lars SchneiderNov 22, 2017
  9. Kaartic SivaraamNov 22, 2017
  10. Junio C HamanoNov 24, 2017
  11. Lars SchneiderNov 22, 2017
  12. Eric SunshineNov 22, 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.