[TxMt] [PATCH] Re: Git bundle: sh: line 2: git: command not found /tmp/temp_textmate.j2NZhz:4

Michael Melanson michael at codeshack.ca
Fri Jan 18 21:49:09 UTC 2008


Alain Ravet wrote:
>    On Dec 12, 2007 9:45 PM, Michael Sheets <mummer at whitefalls.org> wrote:
>    > See: http://macromates.com/textmate/manual/shell_commands#search_path
>    > Especially the part past "Important".
> 
> It worked fine. Thanks Michael.
> 
> Alain
> 

I ran into this problem too, because I have git in a non-standard location.

I found that while it can be overridden in SCM::Git with the TM_GIT 
variable, the "Commit...", "Show Log" and "Revert" commands don't use 
this value.

Below is a patch that makes these commands use the value of @git in 
SCM::Git. If it seems good, please let me know what I should do to get 
this applied to the tree.

Thanks,

Michael


Index: Git.tmbundle/Commands/Show Log.tmCommand
===================================================================
--- Git.tmbundle/Commands/Show Log.tmCommand    (revision 8798)
+++ Git.tmbundle/Commands/Show Log.tmCommand    (working copy)
@@ -22,7 +22,7 @@
    colors = %w[ white lightsteelblue ]

    file = if path == base then '.' else git.shorten(path, base) end
-  open("|git log #{e_sh file}") do |io|
+  open("|#{git.git} log #{e_sh file}") do |io|
      io.read.scan(/^commit (.+)$\n((?:\w+: 
.*\n)*)((?m:.*?))(?=^commit|\z)/) do |e|
        commit, msg = $1, $3
        headers = $2.scan(/(\w+):\s+(.+)/)
Index: Git.tmbundle/Commands/Revert….tmCommand
===================================================================
--- Git.tmbundle/Commands/Revert….tmCommand     (revision 8798)
+++ Git.tmbundle/Commands/Revert….tmCommand     (working copy)
@@ -23,7 +23,7 @@
    Dir.chdir(base)

    paths.each do |e|
-    puts %x{git checkout #{e_sh git.shorten(e, base)}}
+    puts %x{#{git.git} checkout #{e_sh git.shorten(e, base)}}
    end

    git.rescan_project
Index: Git.tmbundle/Commands/Commit….tmCommand
===================================================================
--- Git.tmbundle/Commands/Commit….tmCommand     (revision 8798)
+++ Git.tmbundle/Commands/Commit….tmCommand     (working copy)
@@ -54,7 +54,7 @@

  unless files.empty?
    puts "<h2>Result:</h2>"
-  res = %x{git commit -m #{e_sh msg} #{files.map { |e| e_sh e }.join(' ')}}
+  res = %x{#{git.git} commit -m #{e_sh msg} #{files.map { |e| e_sh e 
}.join(' ')}}
    puts "<pre>#{htmlize(res)}</pre>"
  end
  </string>




More information about the textmate mailing list