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