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

Re: [PATCH] gitk - restore operation of git-reset on Cygwin

From
Shawn O. Pearce <spearce@spearce.org>
Date
May 23, 2008, 23:17 UTC
Message-ID
<20080523231714.GY29038@spearce.org>
In-Reply-To
<48374F82.7050005@gmail.com>
Mark Levedahl <mlevedahl@gmail.com> wrote:
Show 11 quoted lines
> >Paul Mackerras wrote:
> >>Are you using Tk 8.4 or 8.5?  The man pages for 8.5 imply that the
> >>2>@1 form should work for all platforms, but maybe that wasn't true in
> >>8.4.  If that's the case it's worth mentioning in the patch
> >>description.
> 
> I just tried installation of ActiveState Tcl 8.4.16, put that on the 
> Cygwin path, and gitk operates correctly without the patch. So, the 
> issue seems to be entirely one of Cygwin's particular Tcl/Tk build, 
> though whether that is due to the version or the odd attributes of its 
> compilation I cannot say.

git-gui ran into this problem and uses the following procedure anytime it wants both stdout and stderr:

proc _open_stdout_stderr {cmd} {
    _trace_exec $cmd
    if {[catch {
            set fd [open [concat [list | ] $cmd] r]
        } err]} {
        if {   [lindex $cmd end] eq {2>@1}
            && $err eq {can not find channel named "1"}
            } {
            # Older versions of Tcl 8.4 don't have this 2>@1 IO
            # redirect operator.  Fallback to |& cat for those.
            # The command was not actually started, so its safe
            # to try to start it a second time.
            #
            set fd [open [concat \
                [list | ] \
                [lrange $cmd 0 end-1] \
                [list |& cat] \
                ] r]
        } else {
            error $err
        }
    }
    fconfigure $fd -eofchar {}
    return $fd
}
-- 
Shawn.
Previous: Mark Levedahl
Message 5 of 5 in “gitk - restore operation of git-reset on Cygwin”
  1. gitk - restore operation of git-reset on CygwinMark Levedahl, May 23, 2008
  2. Paul MackerrasMay 23, 2008
  3. Mark LevedahlMay 23, 2008
  4. Mark LevedahlMay 23, 2008
  5. Shawn O. PearceMay 23, 2008

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.