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

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

From
Dmitry Potapov <dpotapov@gmail.com>
Date
Feb 8, 2008, 01:33 UTC
Message-ID
<1202434421-8066-1-git-send-email-dpotapov@gmail.com>

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
Next: Johannes Schindelin
Message 1 of 11 in “git help -w should not create nohup.out”
  1. git help -w should not create nohup.outDmitry Potapov, Feb 8, 2008
  2. Johannes SchindelinFeb 8, 2008
  3. Junio C HamanoFeb 8, 2008
  4. Christian CouderFeb 8, 2008
  5. Dmitry PotapovFeb 8, 2008
  6. Dmitry PotapovFeb 8, 2008
  7. remove "nohup" from git-help--browseDmitry Potapov, Feb 8, 2008
  8. Christian CouderFeb 9, 2008
  9. Dmitry PotapovFeb 9, 2008
  10. Junio C HamanoFeb 10, 2008
  11. Johannes SchindelinFeb 10, 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.