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

[PATCH] Explain seemingly pointless use of system in difftool

From
Alex Riesen <raa.lkml@gmail.com>
Date
Apr 23, 2009, 19:18 UTC
Message-ID
<20090423191809.GC8433@blimp.localdomain>
In-Reply-To
<20090423190835.GB8433@blimp.localdomain>
Portability reasons.
Signed-off-by: Alex Riesen <raa.lkml@gmail.com>
---
Alex Riesen, Thu, Apr 23, 2009 21:08:35 +0200:
Show 12 quoted lines
> 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
Previous: Alex Riesen
Message 14 of 14 in “Wait for git diff to finish in git difftool”
  1. Wait for git diff to finish in git difftoolAlex Riesen, Apr 22, 2009
  2. David AguilarApr 22, 2009
  3. Alex RiesenApr 22, 2009
  4. Junio C HamanoApr 22, 2009
  5. Alex RiesenApr 22, 2009
  6. Junio C HamanoApr 23, 2009
  7. Alex RiesenApr 23, 2009
  8. Junio C HamanoApr 23, 2009
  9. Alex RiesenApr 23, 2009
  10. Sverre RabbelierApr 23, 2009
  11. Junio C HamanoApr 23, 2009
  12. Alex RiesenApr 23, 2009
  13. Alex RiesenApr 23, 2009
  14. Explain seemingly pointless use of system in difftoolAlex Riesen, Apr 23, 2009

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.