{"thread":{"id":"3146","subject":"[PATCH] [GITK] use \"git <command>\" instead of \"git-<command>\"","startedAt":"2006-01-25T07:56:35Z","lastAt":"2006-01-26T14:26:15Z","messageCount":3,"participants":["Uwe Zeisberger","Junio C Hamano"],"isPatch":true,"patchVersion":1,"patchTotal":null},"messages":[{"id":"15108","messageId":"20060125075635.GB2768@informatik.uni-freiburg.de","threadId":"3146","inReplyTo":null,"subject":"[PATCH] [GITK] use \"git <command>\" instead of \"git-<command>\"","fromName":"Uwe Zeisberger","fromEmail":"zeisberg@informatik.uni-freiburg.de","sentAt":"2006-01-25T07:56:35Z","receivedAt":"2006-01-25T07:56:35Z","isPatch":true,"sender":{"key":"u.kleine-koenig@pengutronix.de","avatar":"https://gravatar.com/avatar/354b5e3ceb2806a2f1e1e382ac29ddbdad18288654da62b61eb13583a857eee7?d=mp&s=160"},"body":"Otherwise gitk is not able to work with installations using a gitexecdir\ndifferent from bindir.\n\nSigned-off-by: Uwe Zeisberger <zeisberg@informatik.uni-freiburg.de>\n\n---\n\n gitk |   32 ++++++++++++++++----------------\n 1 files changed, 16 insertions(+), 16 deletions(-)\n\n05f2a8c2fb8811bb78dd3c81c204e8635ca0fd83\ndiff --git a/gitk b/gitk\nindex f12b3ce..6aa340d 100755\n--- a/gitk\n+++ b/gitk\n@@ -21,7 +21,7 @@ proc parse_args {rargs} {\n \n     if [catch {\n \tset parse_args [concat --default HEAD $rargs]\n-\tset parsed_args [split [eval exec git-rev-parse $parse_args] \"\\n\"]\n+\tset parsed_args [split [eval exec git rev-parse $parse_args] \"\\n\"]\n     }] {\n \t# if git-rev-parse failed for some reason...\n \tif {$rargs == {}} {\n@@ -40,7 +40,7 @@ proc start_rev_list {rlargs} {\n     set nextupdate [expr {$startmsecs + 100}]\n     set ncmupdate 1\n     if [catch {\n-\tset commfd [open [concat | git-rev-list --header --topo-order \\\n+\tset commfd [open [concat | git rev-list --header --topo-order \\\n \t\t\t      --parents $rlargs] r]\n     } err] {\n \tputs stderr \"Error executing git-rev-list: $err\"\n@@ -181,7 +181,7 @@ proc doupdate {reading} {\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@@ -242,7 +242,7 @@ proc updatecommits {rargs} {\n     set phase updatecommits\n     set oldcommits $commits\n     set commits {}\n-    set removed_commits [split [eval exec git-rev-list $ignorenew] \"\\n\" ]\n+    set removed_commits [split [eval exec git rev-list $ignorenew] \"\\n\" ]\n     if {[llength $removed_commits] > 0} {\n \tallcanvs delete all\n \tforeach c $removed_commits {\n@@ -359,7 +359,7 @@ proc readrefs {} {\n     foreach v {tagids idtags headids idheads otherrefids idotherrefs} {\n \tcatch {unset $v}\n     }\n-    set refd [open [list | git-ls-remote [gitdir]] r]\n+    set refd [open [list | git ls-remote [gitdir]] r]\n     while {0 <= [set n [gets $refd line]]} {\n \tif {![regexp {^([0-9a-f]{40})\trefs/([^^]*)$} $line \\\n \t    match id path]} {\n@@ -376,14 +376,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@@ -1855,7 +1855,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@@ -1958,7 +1958,7 @@ proc findfiles {} {\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@@ -2382,7 +2382,7 @@ proc findgca {ids} {\n \t    set gca $id\n \t} else {\n \t    if {[catch {\n-\t\tset gca [exec git-merge-base $gca $id]\n+\t\tset gca [exec git merge-base $gca $id]\n \t    } err]} {\n \t\treturn {}\n \t    }\n@@ -2470,7 +2470,7 @@ proc showmergediff {} {\n     catch {unset grouphunks}\n     set groupfilelast -1\n     foreach p $parents($diffmergeid) {\n-\tset cmd [list | git-diff-tree -p $p $diffmergeid]\n+\tset cmd [list | git diff-tree -p $p $diffmergeid]\n \tset cmd [concat $cmd $mergefilelist($diffmergeid)]\n \tif {[catch {set f [open $cmd r]} err]} {\n \t    error_popup \"Error getting diffs: $err\"\n@@ -2912,7 +2912,7 @@ proc gettreediffs {ids} {\n     global treediff parents treepending\n     set treepending $ids\n     set treediff {}\n-    if [catch {set gdtf [open [concat | git-diff-tree --no-commit-id -r $ids] r]}] return\n+    if [catch {set gdtf [open [concat | git diff-tree --no-commit-id -r $ids] r]}] return\n     fconfigure $gdtf -blocking 0\n     fileevent $gdtf readable [list gettreediffline $gdtf $ids]\n }\n@@ -2946,7 +2946,7 @@ proc getblobdiffs {ids} {\n     global difffilestart 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@@ -3524,7 +3524,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@@ -4090,11 +4090,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-- \n1.1.4.g2eaa\n\n-- \nUwe Zeisberger\n\ndd if=/proc/self/exe bs=1 skip=1 count=3 2>/dev/null\n"},{"id":"15110","messageId":"7v3bjcws5o.fsf@assigned-by-dhcp.cox.net","threadId":"3146","inReplyTo":"20060125075635.GB2768@informatik.uni-freiburg.de","subject":"Re: [PATCH] [GITK] use \"git <command>\" instead of \"git-<command>\"","fromName":"Junio C Hamano","fromEmail":"junkio@cox.net","sentAt":"2006-01-25T09:52:51Z","receivedAt":"2006-01-25T09:52:51Z","isPatch":true,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"Uwe Zeisberger <zeisberg@informatik.uni-freiburg.de> writes:\n\n> Otherwise gitk is not able to work with installations using a gitexecdir\n> different from bindir.\n\nFor something like gitk that lives for some time and spawns git\nnumber of times, it is considered a good practice to:\n\n (1) Run \"git --exec-path\" at the beginning, to learn\n     GIT_EXEC_PATH;\n (2) Prepend that to PATH;\n (3) And invoke \"git-foo\" commands in the rest of the script.\n\nThis saves an extra fork/exec (gitk -> git -> git-foo).  I was\ntold qgit already does this.\n\nNote that we may end up leaving some git-* commands in /usr/bin\nwhile moving the rest to elsewhere (e.g. /usr/lib/git-core/exec/),\nso (2) and (3) cannot be safely substituted with \n\n (BAD) invoke \"$GIT_EXEC_PATH/git-foo\" instead.\n\nI usually prefer patches to gitk to come through paulus, so\nplease CC: when sending patches to gitk (\"git whatchanged gitk\"\nwould give you the e-mail address).\n"},{"id":"15151","messageId":"20060126142615.GA12631@informatik.uni-freiburg.de","threadId":"3146","inReplyTo":"7v3bjcws5o.fsf@assigned-by-dhcp.cox.net","subject":"Re: [PATCH] [GITK] use \"git <command>\" instead of \"git-<command>\"","fromName":"Uwe Zeisberger","fromEmail":"zeisberg@informatik.uni-freiburg.de","sentAt":"2006-01-26T14:26:15Z","receivedAt":"2006-01-26T14:26:15Z","isPatch":true,"sender":{"key":"u.kleine-koenig@pengutronix.de","avatar":"https://gravatar.com/avatar/354b5e3ceb2806a2f1e1e382ac29ddbdad18288654da62b61eb13583a857eee7?d=mp&s=160"},"body":"Junio C Hamano wrote:\n> Uwe Zeisberger <zeisberg@informatik.uni-freiburg.de> writes:\n> \n> > Otherwise gitk is not able to work with installations using a gitexecdir\n> > different from bindir.\n> \n> For something like gitk that lives for some time and spawns git\n> number of times, it is considered a good practice to:\n> \n>  (1) Run \"git --exec-path\" at the beginning, to learn\n>      GIT_EXEC_PATH;\n>  (2) Prepend that to PATH;\n>  (3) And invoke \"git-foo\" commands in the rest of the script.\n(I remember darkly that was already discussed, but I cannot find the\nthread ATM.)\n\nJust to get the patch right:\nIf\n - PATH=$(HOME)/bin:/usr/bin\n - GIT_EXEC_PATH=/usr/bin\n\nthen gitk should use\n\n\tPATH=/usr/bin:$(HOME)/bin:/usr/bin\n\nto call git-<command> and\n\n\tPATH=$(HOME)/bin:/usr/bin\n\nto call the rest, right?\n\nBest regards\nUwe\n\n-- \nUwe Zeisberger\n\nfib where fib = 0 : 1 : zipWith (+) fib (tail fib)\n"}]}