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.