Code

gitk: Fix bug in generating patches
authorPaul Mackerras <paulus@samba.org>
Sat, 15 Sep 2007 02:08:38 +0000 (12:08 +1000)
committerPaul Mackerras <paulus@samba.org>
Sat, 15 Sep 2007 02:08:38 +0000 (12:08 +1000)
Commit 8f4893639129acfc866c71583317090aa2a46eab changed mkpatchgo
to use diffcmd rather than constructing the diff command itself.
Unfortunately diffcmd returns the command with a "|" as the first
element (ready for use with open), but exec won't accept the "|".
Thus we need to remove the "|".

Signed-off-by: Paul Mackerras <paulus@samba.org>
gitk

diff --git a/gitk b/gitk
index 85d33abf4abc26276b9af06a9e89851f5f159592..d5db836528df4e89b09844953b7fb920fe0ee073 100755 (executable)
--- a/gitk
+++ b/gitk
@@ -5920,6 +5920,8 @@ proc mkpatchgo {} {
     set newid [$patchtop.tosha1 get]
     set fname [$patchtop.fname get]
     set cmd [diffcmd [list $oldid $newid] -p]
+    # trim off the initial "|"
+    set cmd [lrange $cmd 1 end]
     lappend cmd >$fname &
     if {[catch {eval exec $cmd} err]} {
        error_popup "Error creating patch: $err"