{"thread":{"id":"4275","subject":"[PATCH] gitk: Replace \"git-\" commands with \"git \"","startedAt":"2006-05-24T07:57:40Z","lastAt":"2006-05-26T12:26:50Z","messageCount":5,"participants":["Timo Hirvonen","Paul Mackerras"],"isPatch":true,"patchVersion":1,"patchTotal":null},"messages":[{"id":"20614","messageId":"20060524105740.2cb97585.tihirvon@gmail.com","threadId":"4275","inReplyTo":null,"subject":"[PATCH] gitk: Replace \"git-\" commands with \"git \"","fromName":"Timo Hirvonen","fromEmail":"tihirvon@gmail.com","sentAt":"2006-05-24T07:57:40Z","receivedAt":"2006-05-24T07:57:40Z","isPatch":true,"sender":{"key":"tihirvon@gmail.com","avatar":null},"body":"git-* commands work only if gitexecdir is in PATH.\n\nSigned-off-by: Timo Hirvonen <tihirvon@gmail.com>\n\n---\n\nNOTE: This is for the gitk repository.\n\ncad90165494784f29aec40bca2c1e2bbc39e7a76\n gitk |   52 ++++++++++++++++++++++++++--------------------------\n 1 files changed, 26 insertions(+), 26 deletions(-)\n\ncad90165494784f29aec40bca2c1e2bbc39e7a76\ndiff --git a/gitk b/gitk\nindex bd8d4f1..7427856 100755\n--- a/gitk\n+++ b/gitk\n@@ -34,10 +34,10 @@ proc start_rev_list {view} {\n \tset order \"--date-order\"\n     }\n     if {[catch {\n-\tset fd [open [concat | git-rev-list --header $order \\\n+\tset fd [open [concat | git rev-list --header $order \\\n \t\t\t  --parents --boundary --default HEAD $args] r]\n     } err]} {\n-\tputs stderr \"Error executing git-rev-list: $err\"\n+\tputs stderr \"Error executing git rev-list: $err\"\n \texit 1\n     }\n     set commfd($view) $fd\n@@ -94,10 +94,10 @@ proc getcommitlines {fd view}  {\n \t    }\n \t    if {[string range $err 0 4] == \"usage\"} {\n \t\tset err \"Gitk: error reading commits$fv:\\\n-\t\t\tbad arguments to git-rev-list.\"\n+\t\t\tbad arguments to git rev-list.\"\n \t\tif {$viewname($view) eq \"Command line\"} {\n \t\t    append err \\\n-\t\t\t\"  (Note: arguments to gitk are passed to git-rev-list\\\n+\t\t\t\"  (Note: arguments to gitk are passed to git rev-list\\\n \t\t\t to allow selection of commits to be displayed.)\"\n \t\t}\n \t    } else {\n@@ -148,7 +148,7 @@ proc getcommitlines {fd view}  {\n \t    if {[string length $shortcmit] > 80} {\n \t\tset shortcmit \"[string range $shortcmit 0 80]...\"\n \t    }\n-\t    error_popup \"Can't parse git-rev-list output: {$shortcmit}\"\n+\t    error_popup \"Can't parse git rev-list output: {$shortcmit}\"\n \t    exit 1\n \t}\n \tset id [lindex $ids 0]\n@@ -217,7 +217,7 @@ proc doupdate {} {\n }\n \n proc readcommit {id} {\n-    if {[catch {set contents [exec git-cat-file commit $id]}]} return\n+    if {[catch {set contents [exec git cat-file commit $id]}]} return\n     parsecommit $id $contents 0\n }\n \n@@ -276,8 +276,8 @@ proc parsecommit {id contents listed} {\n \tset headline $comment\n     }\n     if {!$listed} {\n-\t# git-rev-list indents the comment by 4 spaces;\n-\t# if we got this via git-cat-file, add the indentation\n+\t# git rev-list indents the comment by 4 spaces;\n+\t# if we got this via git cat-file, add the indentation\n \tset newcomment {}\n \tforeach line [split $comment \"\\n\"] {\n \t    append newcomment \"    \"\n@@ -337,14 +337,14 @@ proc readrefs {} {\n \t    set type {}\n \t    set tag {}\n \t    catch {\n-\t\tset commit [exec git-rev-parse \"$id^0\"]\n+\t\tset commit [exec git rev-parse \"$id^0\"]\n \t\tif {\"$commit\" != \"$id\"} {\n \t\t    set tagids($name) $commit\n \t\t    lappend idtags($commit) $name\n \t\t}\n \t    }\t\t\n \t    catch {\n-\t        set tagcontents($name) [exec git-cat-file tag \"$id\"]\n+\t        set tagcontents($name) [exec git cat-file tag \"$id\"]\n \t    }\n \t} elseif { $type == \"heads\" } {\n \t    set headids($name) $id\n@@ -1287,7 +1287,7 @@ proc vieweditor {top n title} {\n     checkbutton $top.perm -text \"Remember this view\" -variable newviewperm($n)\n     grid $top.perm - -pady 5 -sticky w\n     message $top.al -aspect 1000 -font $uifont \\\n-\t-text \"Commits to include (arguments to git-rev-list):\"\n+\t-text \"Commits to include (arguments to git rev-list):\"\n     grid $top.al - -sticky w -pady 5\n     entry $top.args -width 50 -textvariable newviewargs($n) \\\n \t-background white\n@@ -2941,7 +2941,7 @@ proc findpatches {} {\n     }\n \n     if {[catch {\n-\tset f [open [list | git-diff-tree --stdin -s -r -S$findstring \\\n+\tset f [open [list | git diff-tree --stdin -s -r -S$findstring \\\n \t\t\t << $inputids] r]\n     } err]} {\n \terror_popup \"Error starting search process: $err\"\n@@ -2973,7 +2973,7 @@ proc readfindproc {} {\n \treturn\n     }\n     if {![regexp {^[0-9a-f]{40}} $line id]} {\n-\terror_popup \"Can't parse git-diff-tree output: $line\"\n+\terror_popup \"Can't parse git diff-tree output: $line\"\n \tstopfindproc\n \treturn\n     }\n@@ -3038,10 +3038,10 @@ proc findfiles {} {\n \tif {$l == $findstartline} break\n     }\n \n-    # start off a git-diff-tree process if needed\n+    # start off a git diff-tree process if needed\n     if {$diffsneeded ne {}} {\n \tif {[catch {\n-\t    set df [open [list | git-diff-tree -r --stdin << $diffsneeded] r]\n+\t    set df [open [list | git diff-tree -r --stdin << $diffsneeded] r]\n \t} err ]} {\n \t    error_popup \"Error starting search process: $err\"\n \t    return\n@@ -3071,7 +3071,7 @@ proc readfilediffs {df} {\n \t    if {[catch {close $df} err]} {\n \t\tstopfindproc\n \t\tbell\n-\t\terror_popup \"Error in git-diff-tree: $err\"\n+\t\terror_popup \"Error in git diff-tree: $err\"\n \t    } elseif {[info exists findid]} {\n \t\tset id $findid\n \t\tstopfindproc\n@@ -3098,7 +3098,7 @@ proc donefilediff {} {\n     if {[info exists fdiffid]} {\n \twhile {[lindex $fdiffsneeded $fdiffpos] ne $fdiffid\n \t       && $fdiffpos < [llength $fdiffsneeded]} {\n-\t    # git-diff-tree doesn't output anything for a commit\n+\t    # git diff-tree doesn't output anything for a commit\n \t    # which doesn't change anything\n \t    set nullid [lindex $fdiffsneeded $fdiffpos]\n \t    set treediffs($nullid) {}\n@@ -3526,7 +3526,7 @@ proc gettree {id} {\n     catch {unset diffmergeid}\n     if {![info exists treefilelist($id)]} {\n \tif {![info exists treepending]} {\n-\t    if {[catch {set gtf [open [concat | git-ls-tree -r $id] r]}]} {\n+\t    if {[catch {set gtf [open [concat | git ls-tree -r $id] r]}]} {\n \t\treturn\n \t    }\n \t    set treepending $id\n@@ -3574,7 +3574,7 @@ proc showfile {f} {\n \treturn\n     }\n     set blob [lindex $treeidlist($diffids) $i]\n-    if {[catch {set bf [open [concat | git-cat-file blob $blob] r]} err]} {\n+    if {[catch {set bf [open [concat | git cat-file blob $blob] r]} err]} {\n \tputs \"oops, error reading blob $blob: $err\"\n \treturn\n     }\n@@ -3616,7 +3616,7 @@ proc mergediff {id l} {\n     set diffids $id\n     # this doesn't seem to actually affect anything...\n     set env(GIT_DIFF_OPTS) $diffopts\n-    set cmd [concat | git-diff-tree --no-commit-id --cc $id]\n+    set cmd [concat | git diff-tree --no-commit-id --cc $id]\n     if {[catch {set mdf [open $cmd r]} err]} {\n \terror_popup \"Error getting merge diffs: $err\"\n \treturn\n@@ -3728,7 +3728,7 @@ proc gettreediffs {ids} {\n     set treepending $ids\n     set treediff {}\n     if {[catch \\\n-\t {set gdtf [open [concat | git-diff-tree --no-commit-id -r $ids] r]} \\\n+\t {set gdtf [open [concat | git diff-tree --no-commit-id -r $ids] r]} \\\n \t]} return\n     fconfigure $gdtf -blocking 0\n     fileevent $gdtf readable [list gettreediffline $gdtf $ids]\n@@ -3764,7 +3764,7 @@ proc getblobdiffs {ids} {\n     global nextupdate diffinhdr treediffs\n \n     set env(GIT_DIFF_OPTS) $diffopts\n-    set cmd [concat | git-diff-tree --no-commit-id -r -p -C $ids]\n+    set cmd [concat | git diff-tree --no-commit-id -r -p -C $ids]\n     if {[catch {set bdf [open $cmd r]} err]} {\n \tputs \"error getting diffs: $err\"\n \treturn\n@@ -4301,7 +4301,7 @@ proc mkpatchgo {} {\n     set oldid [$patchtop.fromsha1 get]\n     set newid [$patchtop.tosha1 get]\n     set fname [$patchtop.fname get]\n-    if {[catch {exec git-diff-tree -p $oldid $newid >$fname &} err]} {\n+    if {[catch {exec git diff-tree -p $oldid $newid >$fname &} err]} {\n \terror_popup \"Error creating patch: $err\"\n     }\n     catch {destroy $patchtop}\n@@ -4868,11 +4868,11 @@ proc tcl_encoding {enc} {\n # defaults...\n set datemode 0\n set diffopts \"-U 5 -p\"\n-set wrcomcmd \"git-diff-tree --stdin -p --pretty\"\n+set wrcomcmd \"git diff-tree --stdin -p --pretty\"\n \n set gitencoding {}\n catch {\n-    set gitencoding [exec git-repo-config --get i18n.commitencoding]\n+    set gitencoding [exec git repo-config --get i18n.commitencoding]\n }\n if {$gitencoding == \"\"} {\n     set gitencoding \"utf-8\"\n@@ -4928,7 +4928,7 @@ if {$i >= 0} {\n     set revtreeargs [lrange $revtreeargs 0 [expr {$i - 1}]]\n } elseif {$revtreeargs ne {}} {\n     if {[catch {\n-\tset f [eval exec git-rev-parse --no-revs --no-flags $revtreeargs]\n+\tset f [eval exec git rev-parse --no-revs --no-flags $revtreeargs]\n \tset cmdline_files [split $f \"\\n\"]\n \tset n [llength $cmdline_files]\n \tset revtreeargs [lrange $revtreeargs 0 end-$n]\n-- \n1.3.3.g40505-dirty\n"},{"id":"20620","messageId":"20060524133455.f78b11a4.tihirvon@gmail.com","threadId":"4275","inReplyTo":"81b0412b0605240323q29b64949s80d4738cb54c22c8@mail.gmail.com","subject":"Re: [PATCH] gitk: Replace \"git-\" commands with \"git \"","fromName":"Timo Hirvonen","fromEmail":"tihirvon@gmail.com","sentAt":"2006-05-24T10:34:55Z","receivedAt":"2006-05-24T10:34:55Z","isPatch":true,"sender":{"key":"tihirvon@gmail.com","avatar":null},"body":"\"Alex Riesen\" <raa.lkml@gmail.com> wrote:\n\n> On 5/24/06, Timo Hirvonen <tihirvon@gmail.com> wrote:\n> > git-* commands work only if gitexecdir is in PATH.\n> >\n> \n> How about getting exec-path (git --exec-path) and prepend it\n> to every git-<call> instead? You'll save a fork+exec a call in this case.\n\nMany commands are already built-in so I don't think it's a problem\nanymore.\n\n-- \nhttp://onion.dynserv.net/~timo/\n"},{"id":"20748","messageId":"17526.59159.484712.500414@cargo.ozlabs.ibm.com","threadId":"4275","inReplyTo":"20060524133455.f78b11a4.tihirvon@gmail.com","subject":"Re: [PATCH] gitk: Replace \"git-\" commands with \"git \"","fromName":"Paul Mackerras","fromEmail":"paulus@samba.org","sentAt":"2006-05-26T11:31:35Z","receivedAt":"2006-05-26T11:31:35Z","isPatch":true,"sender":{"key":"paulus@samba.org","avatar":"https://avatars.githubusercontent.com/u/1606439?v=4"},"body":"Timo Hirvonen writes:\n\n> Many commands are already built-in so I don't think it's a problem\n> anymore.\n\nWhich ones are built in now?\n\nPaul.\n"},{"id":"20749","messageId":"20060526145954.cea5613c.tihirvon@gmail.com","threadId":"4275","inReplyTo":"17526.59159.484712.500414@cargo.ozlabs.ibm.com","subject":"Re: [PATCH] gitk: Replace \"git-\" commands with \"git \"","fromName":"Timo Hirvonen","fromEmail":"tihirvon@gmail.com","sentAt":"2006-05-26T11:59:54Z","receivedAt":"2006-05-26T11:59:54Z","isPatch":true,"sender":{"key":"tihirvon@gmail.com","avatar":null},"body":"Paul Mackerras <paulus@samba.org> wrote:\n\n> Timo Hirvonen writes:\n> \n> > Many commands are already built-in so I don't think it's a problem\n> > anymore.\n> \n> Which ones are built in now?\n\ngit-log$X git-whatchanged$X git-show$X \\\ngit-count-objects$X git-diff$X git-push$X \\\ngit-grep$X git-add$X git-rm$X git-rev-list$X \\\ngit-check-ref-format$X \\\ngit-init-db$X git-tar-tree$X git-upload-tar$X git-format-patch$X \\\ngit-ls-files$X git-ls-tree$X \\\ngit-read-tree$X git-commit-tree$X \\\ngit-apply$X git-show-branch$X git-diff-files$X \\\ngit-diff-index$X git-diff-stages$X git-diff-tree$X git-cat-file$X\n\n-- \nhttp://onion.dynserv.net/~timo/\n"},{"id":"20751","messageId":"17526.62474.530421.79594@cargo.ozlabs.ibm.com","threadId":"4275","inReplyTo":"20060526145954.cea5613c.tihirvon@gmail.com","subject":"Re: [PATCH] gitk: Replace \"git-\" commands with \"git \"","fromName":"Paul Mackerras","fromEmail":"paulus@samba.org","sentAt":"2006-05-26T12:26:50Z","receivedAt":"2006-05-26T12:26:50Z","isPatch":true,"sender":{"key":"paulus@samba.org","avatar":"https://avatars.githubusercontent.com/u/1606439?v=4"},"body":"OK, thanks.  I have applied your patch.  The ones that gitk uses that\naren't built-in now are git-rev-parse and git-repo-config, which\naren't performance-critical.\n\nPaul.\n"}]}