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

Re: [PATCH] do not open editor in dumb terminal

From
Junio C Hamano <junkio@cox.net>
Date
Feb 6, 2006, 00:56 UTC
Message-ID
<7vek2hcnjs.fsf@assigned-by-dhcp.cox.net>
In-Reply-To
<20060205174422.GG31278@pasky.or.cz>
Petr Baudis <pasky@suse.cz> writes:
Show 7 quoted lines
> Cogito solves this by [ -t ] and just doing cat instead of $EDITOR if
> the input is not a terminal. Couldn't Junio just do
>
> 	emacsclient | cg^H^Hgit commit
>
> in that case? (Note that I'm totally clueless about what emacsclient's
> usage actually is.)

It works just like other editors you can sanely use as EDITOR or VISUAL. Takes list of files to edit on the command line, lets the user interact with it and modify the files, writes out the results to the files and exits.

So you could have suggested something like this:
	$ ( $EDITOR tmpfile && cat tmpfile ) | cg commit

I think "git commit -F -" reads from stdin so an equilvalent can be done with "git commit", but I suspect a sane user would rather do this instead if he uses a temporary file:

	$ $EDITOR tmpfile
        $ git commit -F tmpfile
Previous: Petr Baudis
Message 9 of 9 in “do not open editor in dumb terminal”
  1. do not open editor in dumb terminalAmos Waterland, Feb 3, 2006
  2. Junio C HamanoFeb 3, 2006
  3. Amos WaterlandFeb 5, 2006
  4. H. Peter AnvinFeb 5, 2006
  5. Junio C HamanoFeb 5, 2006
  6. Daniel BarkalowFeb 5, 2006
  7. Junio C HamanoFeb 5, 2006
  8. Petr BaudisFeb 5, 2006
  9. Junio C HamanoFeb 6, 2006

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.