[PATCH] git help -w should not create nohup.out

!MAILaRCHIVE_VOTE_RePLACE
Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]
To: Git Mailing List <git@...>, Junio C Hamano <gitster@...>
Cc: Dmitry Potapov <dpotapov@...>
Date: Thursday, February 7, 2008 - 9:33 pm

git-help--browse uses 'nohup' to launch some browsers. If the output is not
redirected, 'nohup' creates 'nohup.out' and prints a warning about that. It
was mighty annoying to see this warning as well as to have empty nohup.out
files scattered everywhere you happened to use 'git help -w'.

This patch redirects the output to /dev/null when a GUI browser is launched
using the 'nohup' command; thus 'nohup.out' is not created.

Signed-off-by: Dmitry Potapov <dpotapov@gmail.com>
---

Initially I thought to redict the output to $HOME/.git-nohup.out instead of
/dev/null, so no output will be lost if an error happen. But the only error
that a GUI browser may want to report to the stderr or stdout is a problem
inside Xlib (like connection to X display or something like that), and when
it happens you cannot run your favorite browser from the command line anyway.
So, it is very noticeably and no problem to diagnose without any nohup.out
created by git help.

 git-help--browse.sh |    6 +++---
 1 files changed, 3 insertions(+), 3 deletions(-)

diff --git a/git-help--browse.sh b/git-help--browse.sh
index 10b0a36..320e836 100755
--- a/git-help--browse.sh
+++ b/git-help--browse.sh
@@ -122,7 +122,7 @@ case "$browser" in
 	vers=$(expr "$($browser_path -version)" : '.* \([0-9][0-9]*\)\..*')
 	NEWTAB='-new-tab'
 	test "$vers" -lt 2 && NEWTAB=''
-	nohup "$browser_path" $NEWTAB $pages &
+	nohup "$browser_path" $NEWTAB $pages > /dev/null &
 	;;
     konqueror)
 	case "$(basename "$browser_path")" in
@@ -136,7 +136,7 @@ case "$browser" in
 		eval "$browser_path" newTab $pages
 		;;
 	    *)
-	        nohup "$browser_path" $pages &
+	        nohup "$browser_path" $pages > /dev/null &
 		;;
 	esac
 	;;
@@ -144,6 +144,6 @@ case "$browser" in
 	eval "$browser_path" $pages
 	;;
     dillo)
-	nohup "$browser_path" $pages &
+	nohup "$browser_path" $pages > /dev/null &
 	;;
 esac
-- 
1.5.4

-
To unsubscribe from this list: send the line "unsubscribe git" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]

Messages in current thread:
[PATCH] git help -w should not create nohup.out, Dmitry Potapov, (Thu Feb 7, 9:33 pm)
Re: [PATCH] git help -w should not create nohup.out, Johannes Schindelin, (Thu Feb 7, 9:55 pm)
Re: [PATCH] git help -w should not create nohup.out, Junio C Hamano, (Thu Feb 7, 11:40 pm)
[PATCH] remove "nohup" from git-help--browse, Dmitry Potapov, (Fri Feb 8, 4:36 pm)
Re: [PATCH] remove "nohup" from git-help--browse, Christian Couder, (Sat Feb 9, 1:53 am)
Re: [PATCH] remove "nohup" from git-help--browse, Dmitry Potapov, (Sat Feb 9, 4:03 pm)
Re: [PATCH] remove "nohup" from git-help--browse, Junio C Hamano, (Sat Feb 9, 10:02 pm)
Re: [PATCH] remove "nohup" from git-help--browse, Johannes Schindelin, (Sat Feb 9, 10:06 pm)
Re: [PATCH] git help -w should not create nohup.out, Dmitry Potapov, (Fri Feb 8, 6:33 am)
Re: [PATCH] git help -w should not create nohup.out, Christian Couder, (Fri Feb 8, 1:37 am)
Re: [PATCH] git help -w should not create nohup.out, Dmitry Potapov, (Fri Feb 8, 7:25 am)