All of lore.kernel.org
 help / color / mirror / Atom feed
From: Charles Bailey <charles@hashpling.org>
To: Brian Gernhardt <brian@gernhardtsoftware.com>
Cc: Git Mailing List <git@vger.kernel.org>, Theodore Ts'o <tytso@mit.edu>
Subject: Re: Why does git-mergetool use /dev/tty?
Date: Tue, 24 Aug 2010 07:43:06 +0100	[thread overview]
Message-ID: <20100824064306.GA18308@hashpling.org> (raw)
In-Reply-To: <3D6C7B12-FA06-4EAD-9781-5CA74FE23057@gernhardtsoftware.com>

On Mon, Aug 23, 2010 at 09:49:57PM -0400, Brian Gernhardt wrote:
> git-mergetool.sh, lines 298-302:
> >     if test $last_status -ne 0; then
> >         prompt_after_failed_merge < /dev/tty || exit 1
> >     fi
> >     printf "\n"
> >     merge_file "$i" < /dev/tty > /dev/tty
> 
> Why does git-mergetool ignore the provided STDIN and STDOUT when not given a path to merge?

It doesn't deliberately ignore them, it merely loses them because what
you've quoted is in the middle of a redirect, you snipped:

    files_to_merge |
    while IFS= read i
    do  

mergetool is designed to be an interactive tool and didn't originally
have any tests so this was a reasonable (if ugly) way to restore
access to the user for the merge_file function.

This is also why all the previous test provided an explict list of
files to merge, because this was the only testable way to invoke
mergetool.

There's a proposed patch to save and restore the original stdin
instead of assuming that there is a tty in pu: af314714.

If the current behaviour is causing an issue for you then testing this
fix would be appreciated.

Thanks,

Charles.

  parent reply	other threads:[~2010-08-24  6:43 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-08-24  1:49 Why does git-mergetool use /dev/tty? Brian Gernhardt
2010-08-24  1:53 ` Jonathan Nieder
2010-08-24  1:58   ` Brian Gernhardt
2010-08-24  6:43 ` Charles Bailey [this message]
2010-08-24  7:04   ` Brian Gernhardt

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20100824064306.GA18308@hashpling.org \
    --to=charles@hashpling.org \
    --cc=brian@gernhardtsoftware.com \
    --cc=git@vger.kernel.org \
    --cc=tytso@mit.edu \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.