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

Re: [PATCH] Abort mergetool on read error from stdinput

From
Jonathan Nieder <jrnieder@gmail.com>
Date
Dec 2, 2010, 06:38 UTC
Message-ID
<20101202063851.GA1407@burratino>
In-Reply-To
<1291271301-12511-1-git-send-email-robin.rosenberg@dewire.com>
Hi Robin,
Robin Rosenberg wrote:
> infinite loop that is somewhat tricky to stop. Abort the script
> if bash read fails.
>
> Signed-off-by: Robin Rosenberg <robin.rosenberg@dewire.com>
That motivates half the change.
Show 8 quoted lines
> --- a/git-mergetool--lib.sh
> +++ b/git-mergetool--lib.sh
> @@ -35,7 +35,7 @@ check_unchanged () {
>  		while true; do
>  			echo "$MERGED seems unchanged."
>  			printf "Was the merge successful? [y/n] "
> -			read answer
> +			read answer < /dev/tty || exit 1
Why not
			read answer || exit 1

so tests can still run without blocking? Aside from that, this looks like a good change; thanks.

What platform are you on?  ^C kills the entire process group here.
Previous: Robin RosenbergNext: Robin Rosenberg
Message 2 of 5 in “Abort mergetool on read error from stdinput”
  1. Abort mergetool on read error from stdinputRobin Rosenberg, Dec 2, 2010
  2. Jonathan NiederDec 2, 2010
  3. Robin RosenbergDec 3, 2010
  4. Jonathan NiederDec 3, 2010
  5. Junio C HamanoDec 3, 2010

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.