git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] git help -w should not create nohup.out
@ 2008-02-08  1:33 Dmitry Potapov
  2008-02-08  1:55 ` Johannes Schindelin
  0 siblings, 1 reply; 11+ messages in thread
From: Dmitry Potapov @ 2008-02-08  1:33 UTC (permalink / raw)
  To: Git Mailing List, Junio C Hamano; +Cc: Dmitry Potapov

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

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

* Re: [PATCH] git help -w should not create nohup.out
  2008-02-08  1:33 [PATCH] git help -w should not create nohup.out Dmitry Potapov
@ 2008-02-08  1:55 ` Johannes Schindelin
  2008-02-08  3:40   ` Junio C Hamano
  0 siblings, 1 reply; 11+ messages in thread
From: Johannes Schindelin @ 2008-02-08  1:55 UTC (permalink / raw)
  To: Dmitry Potapov; +Cc: Git Mailing List, Junio C Hamano

Hi,

On Fri, 8 Feb 2008, Dmitry Potapov wrote:

> git-help--browse uses 'nohup' to launch some browsers.

Why?

"nohup" should be used to start a program that should persist even after 
you logged out.  I fail to see how this should be sensible for "git help 
-w".  So "off with the head", uh, do away with the "nohup", I say!

Ciao,
Dscho

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

* Re: [PATCH] git help -w should not create nohup.out
  2008-02-08  1:55 ` Johannes Schindelin
@ 2008-02-08  3:40   ` Junio C Hamano
  2008-02-08  5:37     ` Christian Couder
                       ` (2 more replies)
  0 siblings, 3 replies; 11+ messages in thread
From: Junio C Hamano @ 2008-02-08  3:40 UTC (permalink / raw)
  To: Christian Couder; +Cc: Johannes Schindelin, Dmitry Potapov, Git Mailing List

Johannes Schindelin <Johannes.Schindelin@gmx.de> writes:

> Hi,
>
> On Fri, 8 Feb 2008, Dmitry Potapov wrote:
>
>> git-help--browse uses 'nohup' to launch some browsers.
>
> Why?
>
> "nohup" should be used to start a program that should persist even after 
> you logged out.  I fail to see how this should be sensible for "git help 
> -w".  So "off with the head", uh, do away with the "nohup", I say!

True.  Christian, what was the reason you added nohup?
I would imagine if you did this:

	(1) open a new xterm;

        (2) in that xterm, run the browser, perhaps from
            git-help--browse, but without nohup, in the
            background;

	(3) exit the terminal

then the browser might get upset, losing its controlling
terminal.

But I suspect that would be a really broken behaviour.

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

* Re: [PATCH] git help -w should not create nohup.out
  2008-02-08  3:40   ` Junio C Hamano
@ 2008-02-08  5:37     ` Christian Couder
  2008-02-08 11:25       ` Dmitry Potapov
  2008-02-08 10:33     ` Dmitry Potapov
  2008-02-08 20:36     ` [PATCH] remove "nohup" from git-help--browse Dmitry Potapov
  2 siblings, 1 reply; 11+ messages in thread
From: Christian Couder @ 2008-02-08  5:37 UTC (permalink / raw)
  To: Junio C Hamano; +Cc: Johannes Schindelin, Dmitry Potapov, Git Mailing List

Le vendredi 8 février 2008, Junio C Hamano a écrit :
> Johannes Schindelin <Johannes.Schindelin@gmx.de> writes:
> > Hi,
> >
> > On Fri, 8 Feb 2008, Dmitry Potapov wrote:
> >> git-help--browse uses 'nohup' to launch some browsers.
> >
> > Why?
> >
> > "nohup" should be used to start a program that should persist even
> > after you logged out.  I fail to see how this should be sensible for
> > "git help -w".  So "off with the head", uh, do away with the "nohup", I
> > say!
>
> True.  Christian, what was the reason you added nohup?

I think I was worried about something like this:

1) ssh -Y other_machine
2) git help -w, it opens my browser
3) open many other tabs in the browser
4) exit other_machine, oops my browser with all my tabs is gone

or

1) open my favorite browser and many tabs in it
2) ssh -Y other_machine
3) git help -w, cool it opens a tab in my already opened browser in 1)
4) exit other_machine, oops my browser with all my tabs is gone

I thought it would perhaps help, and it was better to be on the safe side. 
But I just tested a little and it seems it doesn't change anything.

Also there are some browser that are very verbose on the SDTOUT or STDERR 
(especially konqueror) and I thought the nohup would also help move the 
output out of the command line while not discarding it in case it's needed. 
But I agree that it's not very often usefull and anyway there are better 
ways to deal with it.

So no problem to do away with the "nohup".

Thanks,
Christian.

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

* Re: [PATCH] git help -w should not create nohup.out
  2008-02-08  3:40   ` Junio C Hamano
  2008-02-08  5:37     ` Christian Couder
@ 2008-02-08 10:33     ` Dmitry Potapov
  2008-02-08 20:36     ` [PATCH] remove "nohup" from git-help--browse Dmitry Potapov
  2 siblings, 0 replies; 11+ messages in thread
From: Dmitry Potapov @ 2008-02-08 10:33 UTC (permalink / raw)
  To: Junio C Hamano; +Cc: Christian Couder, Johannes Schindelin, Git Mailing List

On Thu, Feb 07, 2008 at 07:40:21PM -0800, Junio C Hamano wrote:
> Johannes Schindelin <Johannes.Schindelin@gmx.de> writes:
> 
> > Hi,
> >
> > On Fri, 8 Feb 2008, Dmitry Potapov wrote:
> >
> >> git-help--browse uses 'nohup' to launch some browsers.
> >
> > Why?
> >
> > "nohup" should be used to start a program that should persist even after 
> > you logged out.  I fail to see how this should be sensible for "git help 
> > -w".  So "off with the head", uh, do away with the "nohup", I say!
> 
> True.  Christian, what was the reason you added nohup?
> I would imagine if you did this:
> 
> 	(1) open a new xterm;
> 
>         (2) in that xterm, run the browser, perhaps from
>             git-help--browse, but without nohup, in the
>             background;
> 
> 	(3) exit the terminal
> 
> then the browser might get upset, losing its controlling
> terminal.

I also thought so, therefore, I suggested to redict the output to
/dev/null instead of removing "nohup", but now after some testing,
it seems there is no need for "nohup" here. So, unless Christian
has a good reason for "nohup", I agree with Johannes that "nohup"
should be removed.


Dmitry

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

* Re: [PATCH] git help -w should not create nohup.out
  2008-02-08  5:37     ` Christian Couder
@ 2008-02-08 11:25       ` Dmitry Potapov
  0 siblings, 0 replies; 11+ messages in thread
From: Dmitry Potapov @ 2008-02-08 11:25 UTC (permalink / raw)
  To: Christian Couder; +Cc: Junio C Hamano, Johannes Schindelin, Git Mailing List

On Fri, Feb 08, 2008 at 06:37:03AM +0100, Christian Couder wrote:
> 
> I think I was worried about something like this:
> 
> 1) ssh -Y other_machine
> 2) git help -w, it opens my browser
> 3) open many other tabs in the browser
> 4) exit other_machine, oops my browser with all my tabs is gone

It seems to me that the browser will be killed anyway if ssh connection
is closed. At least, that what happened when I used ssh -Y localhost. In
fact, "nohup" made only easier to kill the browser in this way:
ssh -Y localhost
git help -w
exit
CTRL-C

Without "nohup" CTRL-C had no effect, but when I started the browser
with nohup then the connection would be closed and the browser killed.


Dmitry

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

* [PATCH] remove "nohup" from git-help--browse
  2008-02-08  3:40   ` Junio C Hamano
  2008-02-08  5:37     ` Christian Couder
  2008-02-08 10:33     ` Dmitry Potapov
@ 2008-02-08 20:36     ` Dmitry Potapov
  2008-02-09  5:53       ` Christian Couder
  2 siblings, 1 reply; 11+ messages in thread
From: Dmitry Potapov @ 2008-02-08 20:36 UTC (permalink / raw)
  To: Git Mailing List, Junio C Hamano
  Cc: Christian Couder, Johannes Schindelin, Dmitry Potapov

There is no good reason to run GUI browsers using "nohup". It does not
solve any real problem but creates annoying "nohup.out" files in every
directory where git help -w is run.

This patch removes "nohup" from git-help--browse.sh

Signed-off-by: Dmitry Potapov <dpotapov@gmail.com>
---
It seems that everyone is agree that there is no good reason to
keep "nohup" in git-help--browse. So here is the patch.

 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..adc4d37 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 &
+	"$browser_path" $NEWTAB $pages &
 	;;
     konqueror)
 	case "$(basename "$browser_path")" in
@@ -136,7 +136,7 @@ case "$browser" in
 		eval "$browser_path" newTab $pages
 		;;
 	    *)
-	        nohup "$browser_path" $pages &
+	        "$browser_path" $pages &
 		;;
 	esac
 	;;
@@ -144,6 +144,6 @@ case "$browser" in
 	eval "$browser_path" $pages
 	;;
     dillo)
-	nohup "$browser_path" $pages &
+	"$browser_path" $pages &
 	;;
 esac
-- 
1.5.4

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

* Re: [PATCH] remove "nohup" from git-help--browse
  2008-02-08 20:36     ` [PATCH] remove "nohup" from git-help--browse Dmitry Potapov
@ 2008-02-09  5:53       ` Christian Couder
  2008-02-09 20:03         ` Dmitry Potapov
  0 siblings, 1 reply; 11+ messages in thread
From: Christian Couder @ 2008-02-09  5:53 UTC (permalink / raw)
  To: Dmitry Potapov; +Cc: Git Mailing List, Junio C Hamano, Johannes Schindelin

Le vendredi 8 février 2008, Dmitry Potapov a écrit :
> There is no good reason to run GUI browsers using "nohup". It does not
> solve any real problem but creates annoying "nohup.out" files in every
> directory where git help -w is run.

That's right, but if you just remove "nohup", then there may be some 
annoying browser output on the terminal. Perhaps we should also redirect 
stderr and stdout to /dev/null.

> This patch removes "nohup" from git-help--browse.sh

"git-help--browse.sh" has been renamed "git-web--browse.sh" in next so we 
need a similar patch for next.

Thanks,
Christian. 

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

* Re: [PATCH] remove "nohup" from git-help--browse
  2008-02-09  5:53       ` Christian Couder
@ 2008-02-09 20:03         ` Dmitry Potapov
  2008-02-10  2:02           ` Junio C Hamano
  0 siblings, 1 reply; 11+ messages in thread
From: Dmitry Potapov @ 2008-02-09 20:03 UTC (permalink / raw)
  To: Christian Couder; +Cc: Git Mailing List, Junio C Hamano, Johannes Schindelin

On Sat, Feb 09, 2008 at 06:53:43AM +0100, Christian Couder wrote:
> Le vendredi 8 février 2008, Dmitry Potapov a écrit :
> > There is no good reason to run GUI browsers using "nohup". It does not
> > solve any real problem but creates annoying "nohup.out" files in every
> > directory where git help -w is run.
> 
> That's right, but if you just remove "nohup", then there may be some 
> annoying browser output on the terminal. Perhaps we should also redirect 
> stderr and stdout to /dev/null.

I don't mind this redirection, but I am not sure whether it is the right
thing to do, because it may hide relevant error information, and if your
browser tends to print irrelevant and annoying messages at start, then
perhaps the script to start this browser should be corrected to suppress
these output.

So, I want to hear what other people think. If there is no objection,
I will add this redirection.

> 
> > This patch removes "nohup" from git-help--browse.sh
> 
> "git-help--browse.sh" has been renamed "git-web--browse.sh" in next so we 
> need a similar patch for next.

Okay, I will base my patch on next.


Dmitry

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

* Re: [PATCH] remove "nohup" from git-help--browse
  2008-02-09 20:03         ` Dmitry Potapov
@ 2008-02-10  2:02           ` Junio C Hamano
  2008-02-10  2:06             ` Johannes Schindelin
  0 siblings, 1 reply; 11+ messages in thread
From: Junio C Hamano @ 2008-02-10  2:02 UTC (permalink / raw)
  To: Dmitry Potapov; +Cc: Christian Couder, Git Mailing List, Johannes Schindelin

Dmitry Potapov <dpotapov@gmail.com> writes:

> So, I want to hear what other people think. If there is no objection,
> I will add this redirection.

I personally feel that we should not hide output from the
backend browsers by redirection.  Some may be chattier than
others, but then we would know against which browser to file bug
reports.

Just my two yen.

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

* Re: [PATCH] remove "nohup" from git-help--browse
  2008-02-10  2:02           ` Junio C Hamano
@ 2008-02-10  2:06             ` Johannes Schindelin
  0 siblings, 0 replies; 11+ messages in thread
From: Johannes Schindelin @ 2008-02-10  2:06 UTC (permalink / raw)
  To: Junio C Hamano; +Cc: Dmitry Potapov, Christian Couder, Git Mailing List

Hi,

On Sat, 9 Feb 2008, Junio C Hamano wrote:

> Dmitry Potapov <dpotapov@gmail.com> writes:
> 
> > So, I want to hear what other people think. If there is no objection,
> > I will add this redirection.
> 
> I personally feel that we should not hide output from the
> backend browsers by redirection.  Some may be chattier than
> others, but then we would know against which browser to file bug
> reports.
> 
> Just my two yen.

Yeah.  If you do not like the chatty side, then there should be a way to 
configure a script which redirects stdout/stderr to be called in place of 
the browser binary.

Just my two (rapidly losing) pound.

Ciao,
Dscho

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

end of thread, other threads:[~2008-02-10  2:07 UTC | newest]

Thread overview: 11+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2008-02-08  1:33 [PATCH] git help -w should not create nohup.out Dmitry Potapov
2008-02-08  1:55 ` Johannes Schindelin
2008-02-08  3:40   ` Junio C Hamano
2008-02-08  5:37     ` Christian Couder
2008-02-08 11:25       ` Dmitry Potapov
2008-02-08 10:33     ` Dmitry Potapov
2008-02-08 20:36     ` [PATCH] remove "nohup" from git-help--browse Dmitry Potapov
2008-02-09  5:53       ` Christian Couder
2008-02-09 20:03         ` Dmitry Potapov
2008-02-10  2:02           ` Junio C Hamano
2008-02-10  2:06             ` Johannes Schindelin

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).