All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] Wait for git diff to finish in git difftool
@ 2009-04-22  7:27 Alex Riesen
  2009-04-22  8:26 ` David Aguilar
  0 siblings, 1 reply; 14+ messages in thread
From: Alex Riesen @ 2009-04-22  7:27 UTC (permalink / raw)
  To: David Aguilar; +Cc: gitster, git, charles, markus.heidelberg

In ActivetState Perl, exec does not wait for the started program. This
breaks difftool tests and may cause unexpected behaviour: git difftool
has returned, but the rest of code (diff and possibly the interactive
program are still running in the background.

---
 git-difftool.perl |    3 ++-
 1 files changed, 2 insertions(+), 1 deletions(-)

2009/4/6 David Aguilar <davvid@gmail.com>:
> +# Ensures that git-difftool ignores bogus --tool values
> +test_expect_success 'difftool ignores bad --tool values' '
> +       diff=$(git difftool --no-prompt --tool=bogus-tool branch)
> +       test "$?" = 1 &&
> +       test "$diff" = ""
> +'

This breaks in that piece of ActiveState Perl if git-difftool is to
continue to use exec: exec*(2) semantics are not available there
(as they are not possible in Windows at all).

In this case the script will spawn git-diff and immediately exit with 0.
git-diff will run the bogus-tool in "background" later.

I usually don't care for exit code in a pure UI tool, so the kill signal
is just ORed together with the real exit code just to provide indication
of error.

diff --git a/git-difftool.perl b/git-difftool.perl
index 948ff7f..bd828c2 100755
--- a/git-difftool.perl
+++ b/git-difftool.perl
@@ -82,4 +82,5 @@ sub generate_command
 }

 setup_environment();
-exec(generate_command());
+my $rc = system(generate_command());
+exit($rc | ($rc >> 8));
-- 
1.6.3.rc0.45.g63634

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

* Re: [PATCH] Wait for git diff to finish in git difftool
  2009-04-22  7:27 [PATCH] Wait for git diff to finish in git difftool Alex Riesen
@ 2009-04-22  8:26 ` David Aguilar
  2009-04-22 11:04   ` Alex Riesen
  0 siblings, 1 reply; 14+ messages in thread
From: David Aguilar @ 2009-04-22  8:26 UTC (permalink / raw)
  To: Alex Riesen, gitster; +Cc: git, charles, markus.heidelberg

On  0, Alex Riesen <raa.lkml@gmail.com> wrote:
> In ActivetState Perl, exec does not wait for the started program. This
> breaks difftool tests and may cause unexpected behaviour: git difftool
> has returned, but the rest of code (diff and possibly the interactive
> program are still running in the background.

Thanks for keeping an eye on portability.

There's a tiny typo in the commit message (Active't'State) that
maybe you can tweak before applying?  ('you' being Junio)

For whatever it's worth,

Acked-by: David Aguilar <davvid@gmail.com>


> I usually don't care for exit code in a pure UI tool, so the kill signal
> is just ORed together with the real exit code just to provide indication
> of error.

This seems reasonable.  The exit code isn't very important in
the common 'show-me-the-diff' read-only scenario, and I wouldn't
expect anyone to rely on difftool being exactly exit-code
equivalent to git-diff.


> diff --git a/git-difftool.perl b/git-difftool.perl
> index 948ff7f..bd828c2 100755
> --- a/git-difftool.perl
> +++ b/git-difftool.perl
> @@ -82,4 +82,5 @@ sub generate_command
>  }
> 
>  setup_environment();
> -exec(generate_command());
> +my $rc = system(generate_command());
> +exit($rc | ($rc >> 8));
> -- 
> 1.6.3.rc0.45.g63634

-- 
		David

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

* Re: [PATCH] Wait for git diff to finish in git difftool
  2009-04-22  8:26 ` David Aguilar
@ 2009-04-22 11:04   ` Alex Riesen
  2009-04-22 18:59     ` Junio C Hamano
  0 siblings, 1 reply; 14+ messages in thread
From: Alex Riesen @ 2009-04-22 11:04 UTC (permalink / raw)
  To: David Aguilar; +Cc: gitster, git, charles, markus.heidelberg

2009/4/22 David Aguilar <davvid@gmail.com>:
> On  0, Alex Riesen <raa.lkml@gmail.com> wrote:

I wasn't born on 0th.

>
> For whatever it's worth,
>
> Acked-by: David Aguilar <davvid@gmail.com>

Yes, FWIW. I intentionally stopped signing off patches for
Windows, ActiveState Perl and Cygwin: they usually harm the
rest of the world, while just allowing Windows users limp along.

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

* Re: [PATCH] Wait for git diff to finish in git difftool
  2009-04-22 11:04   ` Alex Riesen
@ 2009-04-22 18:59     ` Junio C Hamano
  2009-04-22 20:40       ` Alex Riesen
  0 siblings, 1 reply; 14+ messages in thread
From: Junio C Hamano @ 2009-04-22 18:59 UTC (permalink / raw)
  To: Alex Riesen; +Cc: David Aguilar, git, charles, markus.heidelberg

Alex Riesen <raa.lkml@gmail.com> writes:

> 2009/4/22 David Aguilar <davvid@gmail.com>:
>> On  0, Alex Riesen <raa.lkml@gmail.com> wrote:
>
> I wasn't born on 0th.
>
>>
>> For whatever it's worth,
>>
>> Acked-by: David Aguilar <davvid@gmail.com>
>
> Yes, FWIW. I intentionally stopped signing off patches for
> Windows, ActiveState Perl and Cygwin: they usually harm the
> rest of the world, while just allowing Windows users limp along.

I have to wonder if you are doing that with the full understanding of what
Signed-off-by means.  I do not think the provenance of your patch is
affected by your distaste towards the system it has effects in any way.

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

* Re: [PATCH] Wait for git diff to finish in git difftool
  2009-04-22 18:59     ` Junio C Hamano
@ 2009-04-22 20:40       ` Alex Riesen
  2009-04-23  4:21         ` Junio C Hamano
  0 siblings, 1 reply; 14+ messages in thread
From: Alex Riesen @ 2009-04-22 20:40 UTC (permalink / raw)
  To: Junio C Hamano; +Cc: David Aguilar, git, charles, markus.heidelberg

2009/4/22 Junio C Hamano <gitster@pobox.com>:
>> Yes, FWIW. I intentionally stopped signing off patches for
>> Windows, ActiveState Perl and Cygwin: they usually harm the
>> rest of the world, while just allowing Windows users limp along.
>
> I have to wonder if you are doing that with the full understanding of what
> Signed-off-by means.  I do not think the provenance of your patch is
> affected by your distaste towards the system it has effects in any way.

I'm trying to avoid being associated with development for the platform :)

Frankly, I just always forget about it. The patches to my windows
repository are mostly just hacks to either make it pass test suite or
workaround another, the platforms specific, stupidity. Not sure anyone
is actually interested in them (because, I repeat, they mostly hurt
everyone else, while making the platforms port "a little working").

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

* Re: [PATCH] Wait for git diff to finish in git difftool
  2009-04-22 20:40       ` Alex Riesen
@ 2009-04-23  4:21         ` Junio C Hamano
  2009-04-23  7:33           ` Alex Riesen
  0 siblings, 1 reply; 14+ messages in thread
From: Junio C Hamano @ 2009-04-23  4:21 UTC (permalink / raw)
  To: Alex Riesen; +Cc: David Aguilar, git, charles, markus.heidelberg

Alex Riesen <raa.lkml@gmail.com> writes:

> 2009/4/22 Junio C Hamano <gitster@pobox.com>:
>>> Yes, FWIW. I intentionally stopped signing off patches for
>>> Windows, ActiveState Perl and Cygwin: they usually harm the
>>> rest of the world, while just allowing Windows users limp along.
>>
>> I have to wonder if you are doing that with the full understanding of what
>> Signed-off-by means.  I do not think the provenance of your patch is
>> affected by your distaste towards the system it has effects in any way.
>
> I'm trying to avoid being associated with development for the platform :)
>
> Frankly, I just always forget about it. The patches to my windows
> repository are mostly just hacks to either make it pass test suite or
> workaround another, the platforms specific, stupidity. Not sure anyone
> is actually interested in them (because, I repeat, they mostly hurt
> everyone else, while making the platforms port "a little working").

What do you really mean?  These patches add maintenance burden but its
benefit nobody would care about, and should not be applied?

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

* Re: [PATCH] Wait for git diff to finish in git difftool
  2009-04-23  4:21         ` Junio C Hamano
@ 2009-04-23  7:33           ` Alex Riesen
  2009-04-23  8:26             ` Junio C Hamano
  0 siblings, 1 reply; 14+ messages in thread
From: Alex Riesen @ 2009-04-23  7:33 UTC (permalink / raw)
  To: Junio C Hamano; +Cc: David Aguilar, git, charles, markus.heidelberg

2009/4/23 Junio C Hamano <gitster@pobox.com>:
> Alex Riesen <raa.lkml@gmail.com> writes:
>> Frankly, I just always forget about it. The patches to my windows
>> repository are mostly just hacks to either make it pass test suite or
>> workaround another, the platforms specific, stupidity. Not sure anyone
>> is actually interested in them (because, I repeat, they mostly hurt
>> everyone else, while making the platforms port "a little working").
>
> What do you really mean?  These patches add maintenance burden but its
> benefit nobody would care about, and should not be applied?

Maintenance _and_ run-time. It is your decision, but yes, I kind of hate
the idea of them being applied.

In plain words: please don't apply MY patches with words "Windows"
or "Cygwin" in message body, unless I beg you to (and even then,
consider me heavily drugged).

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

* Re: [PATCH] Wait for git diff to finish in git difftool
  2009-04-23  7:33           ` Alex Riesen
@ 2009-04-23  8:26             ` Junio C Hamano
  2009-04-23  9:52               ` Alex Riesen
  0 siblings, 1 reply; 14+ messages in thread
From: Junio C Hamano @ 2009-04-23  8:26 UTC (permalink / raw)
  To: Alex Riesen; +Cc: David Aguilar, git, charles, markus.heidelberg

Alex Riesen <raa.lkml@gmail.com> writes:

> 2009/4/23 Junio C Hamano <gitster@pobox.com>:
>> Alex Riesen <raa.lkml@gmail.com> writes:
>>> Frankly, I just always forget about it. The patches to my windows
>>> repository are mostly just hacks to either make it pass test suite or
>>> workaround another, the platforms specific, stupidity. Not sure anyone
>>> is actually interested in them (because, I repeat, they mostly hurt
>>> everyone else, while making the platforms port "a little working").
>>
>> What do you really mean?  These patches add maintenance burden but its
>> benefit nobody would care about, and should not be applied?
>
> Maintenance _and_ run-time. It is your decision, but yes, I kind of hate
> the idea of them being applied.
>
> In plain words: please don't apply MY patches with words "Windows"
> or "Cygwin" in message body, unless I beg you to (and even then,
> consider me heavily drugged).

Hmm, what's the point then for me to spend time looking at them posted on
the list?

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

* Re: [PATCH] Wait for git diff to finish in git difftool
  2009-04-23  8:26             ` Junio C Hamano
@ 2009-04-23  9:52               ` Alex Riesen
  2009-04-23 14:00                 ` Sverre Rabbelier
  2009-04-23 14:51                 ` Junio C Hamano
  0 siblings, 2 replies; 14+ messages in thread
From: Alex Riesen @ 2009-04-23  9:52 UTC (permalink / raw)
  To: Junio C Hamano; +Cc: David Aguilar, git, charles, markus.heidelberg

2009/4/23 Junio C Hamano <gitster@pobox.com>:
> Alex Riesen <raa.lkml@gmail.com> writes:
>
>> 2009/4/23 Junio C Hamano <gitster@pobox.com>:
>>> Alex Riesen <raa.lkml@gmail.com> writes:
>>>> Frankly, I just always forget about it. The patches to my windows
>>>> repository are mostly just hacks to either make it pass test suite or
>>>> workaround another, the platforms specific, stupidity. Not sure anyone
>>>> is actually interested in them (because, I repeat, they mostly hurt
>>>> everyone else, while making the platforms port "a little working").
>>>
>>> What do you really mean?  These patches add maintenance burden but its
>>> benefit nobody would care about, and should not be applied?
>>
>> Maintenance _and_ run-time. It is your decision, but yes, I kind of hate
>> the idea of them being applied.
>>
>> In plain words: please don't apply MY patches with words "Windows"
>> or "Cygwin" in message body, unless I beg you to (and even then,
>> consider me heavily drugged).
>
> Hmm, what's the point then for me to spend time looking at them posted on
> the list?
>

None. But it still would be nice if you look at them when you're addressed
directly. Please understand, maybe I'm abusing the list a little, but it looks
like the best place to _archive_ the workarounds for this obscure platform.
The code is of little use to general public, but in case one finds himself
in the same situation as I am in, at least Google can help out. I think it
happens too rare to justify your looking at them, and especially including
them in the mainline, but hiding the code on my laptop isn't of any use
to anyone (including me: I don't always have that laptop).

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

* Re: [PATCH] Wait for git diff to finish in git difftool
  2009-04-23  9:52               ` Alex Riesen
@ 2009-04-23 14:00                 ` Sverre Rabbelier
  2009-04-23 14:51                 ` Junio C Hamano
  1 sibling, 0 replies; 14+ messages in thread
From: Sverre Rabbelier @ 2009-04-23 14:00 UTC (permalink / raw)
  To: Alex Riesen
  Cc: Junio C Hamano, David Aguilar, git, charles, markus.heidelberg

Heya,

On Thu, Apr 23, 2009 at 11:52, Alex Riesen <raa.lkml@gmail.com> wrote:
> None. But it still would be nice if you look at them when you're addressed
> directly. Please understand, maybe I'm abusing the list a little, but it looks
> like the best place to _archive_ the workarounds for this obscure platform.

In that case you should note in your patch (preferrably in the
subject) that they are not meant for inclusion and merely for the that
purpose so that those who are not interested in them need not waste
their time reviewing the patch with the assumption that it _is_ meant
for inclusion.

-- 
Cheers,

Sverre Rabbelier

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

* Re: [PATCH] Wait for git diff to finish in git difftool
  2009-04-23  9:52               ` Alex Riesen
  2009-04-23 14:00                 ` Sverre Rabbelier
@ 2009-04-23 14:51                 ` Junio C Hamano
  2009-04-23 18:57                   ` Alex Riesen
  1 sibling, 1 reply; 14+ messages in thread
From: Junio C Hamano @ 2009-04-23 14:51 UTC (permalink / raw)
  To: Alex Riesen; +Cc: David Aguilar, git, charles, markus.heidelberg

Alex Riesen <raa.lkml@gmail.com> writes:

>>> In plain words: please don't apply MY patches with words "Windows"
>>> or "Cygwin" in message body, unless I beg you to (and even then,
>>> consider me heavily drugged).
>>
>> Hmm, what's the point then for me to spend time looking at them posted on
>> the list?
>
> None. But it still would be nice if you look at them when you're addressed
> directly. Please understand, maybe I'm abusing the list a little, but it looks
> like the best place to _archive_ the workarounds for this obscure platform.
> The code is of little use to general public, but in case one finds himself
> in the same situation as I am in, at least Google can help out. I think it
> happens too rare to justify your looking at them, and especially including
> them in the mainline, but hiding the code on my laptop isn't of any use
> to anyone (including me: I don't always have that laptop).

Actually, I think I probably should have phrased it more positively.

Do you think you are in a so minority situation that your "workarounds"
are valuable for nobody else?  Apparently you see value in letting them
finding your patches in the archive, so you do not expect them to be
"nobody else" but rather "a small minority".

People on minority platforms have smaller number of people in similar
situation to ask help from than people on mainstream platforms, and they
suffer from the minority status of their platforms not only with git but
about many other things.  Worse, their chance of finding solution by
digging the archive is smaller, and they would need to spend a lot more
time, than the people on other platforms.  And you know this a lot better
than I do ;-).

Even though the suffering of these people as a whole may not be much, only
because there are small number of them, as individuals they may suffer a
lot.  If we can help them without having to bend over backwards too much,
it would be a good thing.  I think we should at least try.

For example, I do not think conversion from Perl exec() to Perl system()
is worsening the code in any way in difftool.  Sure, it won't *improve*
things for general majority of people, but as long as it does not hurt
people (that includes me and others who pay maintenance cost), I do not
think we should just bury the patch in archive or in your laptop.

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

* Re: [PATCH] Wait for git diff to finish in git difftool
  2009-04-23 14:51                 ` Junio C Hamano
@ 2009-04-23 18:57                   ` Alex Riesen
  2009-04-23 19:08                     ` Alex Riesen
  0 siblings, 1 reply; 14+ messages in thread
From: Alex Riesen @ 2009-04-23 18:57 UTC (permalink / raw)
  To: Junio C Hamano; +Cc: David Aguilar, git, charles, markus.heidelberg

Junio C Hamano, Thu, Apr 23, 2009 16:51:28 +0200:
> Do you think you are in a so minority situation that your "workarounds"
> are valuable for nobody else?  Apparently you see value in letting them
> finding your patches in the archive, so you do not expect them to be
> "nobody else" but rather "a small minority".

Correct, "small minority".

> People on minority platforms have smaller number of people in similar
> situation to ask help from than people on mainstream platforms, and they
> suffer from the minority status of their platforms not only with git but
> about many other things.  Worse, their chance of finding solution by
> digging the archive is smaller, and they would need to spend a lot more
> time, than the people on other platforms.  And you know this a lot better
> than I do ;-).

Well, this particular minority is used to have marginal levels of
technical support and .

> For example, I do not think conversion from Perl exec() to Perl system()
> is worsening the code in any way in difftool.  Sure, it won't *improve*
> things for general majority of people, but as long as it does not hurt
> people (that includes me and others who pay maintenance cost), I do not
> think we should just bury the patch in archive or in your laptop.

Isn't it clearly marked in the archives with the keywords most often
associated with the platform? (they may seem a little... unprintable)

Still, you are, as usual, right. Especially regarding this particular case.

I'll add this comment regarding use of system in the case where exec
is right choice on all accounts and resend the patch:

    # ActiveState Perl for Win32 does not implement POSIX semantics of
    # exec* system call. It just spawns the given executable and finishes
    # the starting program, exiting with code 0.
    # system will at least catch the errors in returned by git diff,
    # allowing the caller of git difftool better handling of failures.

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

* Re: [PATCH] Wait for git diff to finish in git difftool
  2009-04-23 18:57                   ` Alex Riesen
@ 2009-04-23 19:08                     ` Alex Riesen
  2009-04-23 19:18                       ` [PATCH] Explain seemingly pointless use of system in difftool Alex Riesen
  0 siblings, 1 reply; 14+ messages in thread
From: Alex Riesen @ 2009-04-23 19:08 UTC (permalink / raw)
  To: Junio C Hamano; +Cc: David Aguilar, git, charles, markus.heidelberg

Alex Riesen, Thu, Apr 23, 2009 20:57:32 +0200:
> Junio C Hamano, Thu, Apr 23, 2009 16:51:28 +0200:
> > For example, I do not think conversion from Perl exec() to Perl system()
> > is worsening the code in any way in difftool.  Sure, it won't *improve*
> > things for general majority of people, but as long as it does not hurt
> > people (that includes me and others who pay maintenance cost), I do not
> > think we should just bury the patch in archive or in your laptop.
> 
> Isn't it clearly marked in the archives with the keywords most often
> associated with the platform? (they may seem a little... unprintable)
> 
> Still, you are, as usual, right. Especially regarding this particular case.
> 
> I'll add this comment regarding use of system in the case where exec
> is right choice on all accounts and resend the patch:
> 
>     # ActiveState Perl for Win32 does not implement POSIX semantics of
>     # exec* system call. It just spawns the given executable and finishes
>     # the starting program, exiting with code 0.
>     # system will at least catch the errors in returned by git diff,
>     # allowing the caller of git difftool better handling of failures.

Oh... I'm too late...

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

* [PATCH] Explain seemingly pointless use of system in difftool
  2009-04-23 19:08                     ` Alex Riesen
@ 2009-04-23 19:18                       ` Alex Riesen
  0 siblings, 0 replies; 14+ messages in thread
From: Alex Riesen @ 2009-04-23 19:18 UTC (permalink / raw)
  To: Junio C Hamano; +Cc: David Aguilar, git, charles, markus.heidelberg

Portability reasons.

Signed-off-by: Alex Riesen <raa.lkml@gmail.com>
---

Alex Riesen, Thu, Apr 23, 2009 21:08:35 +0200:
> Alex Riesen, Thu, Apr 23, 2009 20:57:32 +0200:
> > I'll add this comment regarding use of system in the case where exec
> > is right choice on all accounts and resend the patch:
> > 
> >     # ActiveState Perl for Win32 does not implement POSIX semantics of
> >     # exec* system call. It just spawns the given executable and finishes
> >     # the starting program, exiting with code 0.
> >     # system will at least catch the errors in returned by git diff,
> >     # allowing the caller of git difftool better handling of failures.
> 
> Oh... I'm too late...
> 

There.

 git-difftool.perl |    6 ++++++
 1 files changed, 6 insertions(+), 0 deletions(-)

diff --git a/git-difftool.perl b/git-difftool.perl
index bd828c2..9255d23 100755
--- a/git-difftool.perl
+++ b/git-difftool.perl
@@ -82,5 +82,11 @@ sub generate_command
 }
 
 setup_environment();
+
+# ActiveState Perl for Win32 does not implement POSIX semantics of
+# exec* system call. It just spawns the given executable and finishes
+# the starting program, exiting with code 0.
+# system will at least catch the errors returned by git diff,
+# allowing the caller of git difftool better handling of failures.
 my $rc = system(generate_command());
 exit($rc | ($rc >> 8));
-- 
1.6.3.rc1.74.g42ff

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

end of thread, other threads:[~2009-04-23 19:19 UTC | newest]

Thread overview: 14+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2009-04-22  7:27 [PATCH] Wait for git diff to finish in git difftool Alex Riesen
2009-04-22  8:26 ` David Aguilar
2009-04-22 11:04   ` Alex Riesen
2009-04-22 18:59     ` Junio C Hamano
2009-04-22 20:40       ` Alex Riesen
2009-04-23  4:21         ` Junio C Hamano
2009-04-23  7:33           ` Alex Riesen
2009-04-23  8:26             ` Junio C Hamano
2009-04-23  9:52               ` Alex Riesen
2009-04-23 14:00                 ` Sverre Rabbelier
2009-04-23 14:51                 ` Junio C Hamano
2009-04-23 18:57                   ` Alex Riesen
2009-04-23 19:08                     ` Alex Riesen
2009-04-23 19:18                       ` [PATCH] Explain seemingly pointless use of system in difftool Alex Riesen

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.