git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] git-gui: check whether systems nice command works or disable it
@ 2010-02-07 21:47 Heiko Voigt
  2010-02-08  0:21 ` Junio C Hamano
  0 siblings, 1 reply; 3+ messages in thread
From: Heiko Voigt @ 2010-02-07 21:47 UTC (permalink / raw)
  To: Shawn O. Pearce; +Cc: Junio C Hamano, git

This fixes issue 394 from msysgit. It seems that the Gnuwin32 project
provides a nice command but it returns a "not implemented" error. To
help users we now try to execute once and disable it in case it fails.

Signed-off-by: Heiko Voigt <hvoigt@hvoigt.net>
---

see: http://code.google.com/p/msysgit/issues/detail?id=394
for more information.

cheers Heiko

 git-gui/git-gui.sh |    3 +++
 1 files changed, 3 insertions(+), 0 deletions(-)

diff --git a/git-gui/git-gui.sh b/git-gui/git-gui.sh
index 1fb3cbf..eec2dc9 100755
--- a/git-gui/git-gui.sh
+++ b/git-gui/git-gui.sh
@@ -388,6 +388,9 @@ proc _lappend_nice {cmd_var} {
 
 	if {![info exists _nice]} {
 		set _nice [_which nice]
+		if {[catch {exec $_nice git version}]} {
+			set _nice {}
+		}
 	}
 	if {$_nice ne {}} {
 		lappend cmd $_nice
-- 
1.7.0.rc1.7.gc0da5

^ permalink raw reply related	[flat|nested] 3+ messages in thread

* Re: [PATCH] git-gui: check whether systems nice command works or disable it
  2010-02-07 21:47 [PATCH] git-gui: check whether systems nice command works or disable it Heiko Voigt
@ 2010-02-08  0:21 ` Junio C Hamano
  2010-02-08 15:56   ` Shawn O. Pearce
  0 siblings, 1 reply; 3+ messages in thread
From: Junio C Hamano @ 2010-02-08  0:21 UTC (permalink / raw)
  To: Heiko Voigt; +Cc: Shawn O. Pearce, Junio C Hamano, git

Heiko Voigt <hvoigt@hvoigt.net> writes:

> This fixes issue 394 from msysgit. It seems that the Gnuwin32 project
> provides a nice command but it returns a "not implemented" error. To
> help users we now try to execute once and disable it in case it fails.
>
> Signed-off-by: Heiko Voigt <hvoigt@hvoigt.net>
> ---
>
> see: http://code.google.com/p/msysgit/issues/detail?id=394
> for more information.
>
> cheers Heiko
>
>  git-gui/git-gui.sh |    3 +++
>  1 files changed, 3 insertions(+), 0 deletions(-)
>
> diff --git a/git-gui/git-gui.sh b/git-gui/git-gui.sh
> index 1fb3cbf..eec2dc9 100755
> --- a/git-gui/git-gui.sh
> +++ b/git-gui/git-gui.sh
> @@ -388,6 +388,9 @@ proc _lappend_nice {cmd_var} {
>  
>  	if {![info exists _nice]} {
>  		set _nice [_which nice]
> +		if {[catch {exec $_nice git version}]} {
> +			set _nice {}
> +		}

Where does the output from this "git version" invocation go?

>  	}
>  	if {$_nice ne {}} {
>  		lappend cmd $_nice
> -- 
> 1.7.0.rc1.7.gc0da5

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [PATCH] git-gui: check whether systems nice command works or disable it
  2010-02-08  0:21 ` Junio C Hamano
@ 2010-02-08 15:56   ` Shawn O. Pearce
  0 siblings, 0 replies; 3+ messages in thread
From: Shawn O. Pearce @ 2010-02-08 15:56 UTC (permalink / raw)
  To: Junio C Hamano; +Cc: Heiko Voigt, git

Junio C Hamano <gitster@pobox.com> wrote:
> > diff --git a/git-gui/git-gui.sh b/git-gui/git-gui.sh
> > index 1fb3cbf..eec2dc9 100755
> > --- a/git-gui/git-gui.sh
> > +++ b/git-gui/git-gui.sh
> > @@ -388,6 +388,9 @@ proc _lappend_nice {cmd_var} {
> >  
> >  	if {![info exists _nice]} {
> >  		set _nice [_which nice]
> > +		if {[catch {exec $_nice git version}]} {
> > +			set _nice {}
> > +		}
> 
> Where does the output from this "git version" invocation go?

By default Tcl exec returns stdout's contents.  So in this case,
its passed to catch, which discards it, because catch returns true
if exec crashed, false if it ran without error.

Patch looks fine to me as-is.

-- 
Shawn.

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2010-02-08 15:57 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2010-02-07 21:47 [PATCH] git-gui: check whether systems nice command works or disable it Heiko Voigt
2010-02-08  0:21 ` Junio C Hamano
2010-02-08 15:56   ` Shawn O. Pearce

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).