changeset 2325:18d34a56a736 beta

fix for issue #417, git execution was broken on windows for certain commands. Added git as requirement into readme.
author Marcin Kuzminski <marcin@python-works.com>
date Tue, 22 May 2012 20:12:58 +0200
parents 1dbf07735af4
children 405b1170f577
files docs/usage/git_support.rst rhodecode/lib/vcs/backends/git/repository.py
diffstat 2 files changed, 19 insertions(+), 7 deletions(-) [+]
line wrap: on
line diff
--- a/docs/usage/git_support.rst	Tue May 22 00:16:07 2012 +0200
+++ b/docs/usage/git_support.rst	Tue May 22 20:12:58 2012 +0200
@@ -5,11 +5,13 @@
 ===========
 
 
-Git support in RhodeCode 1.3 was enabled by default. 
+Git support in RhodeCode 1.3 was enabled by default. You need to have a git
+client installed on the machine to make git fully work.
+
 Although There are some limitations on git usage.
 
-- No hooks are runned for git push/pull actions.
-- logs in action journals don't have git operations
+- hooks that are executed on pull/push are not *real* hooks, they are 
+  just emulating the behavior, and are executed **BEFORE** action takes place.
 - large pushes needs http server with chunked encoding support.
  
 if you plan to use git you need to run RhodeCode with some
@@ -17,14 +19,19 @@
 i recommend using waitress_ or gunicorn_ (linux only) for `paste` wsgi app 
 replacement.
 
-To use waitress simply change change the following in the .ini file::
+To use, simply change change the following in the .ini file::
 
     use = egg:Paste#http
 
-To::
+to::
     
     use = egg:waitress#main
 
+or::
+
+    use = egg:gunicorn#main
+    
+    
 And comment out bellow options::
 
     threadpool_workers = 
--- a/rhodecode/lib/vcs/backends/git/repository.py	Tue May 22 00:16:07 2012 +0200
+++ b/rhodecode/lib/vcs/backends/git/repository.py	Tue May 22 20:12:58 2012 +0200
@@ -94,15 +94,20 @@
         if isinstance(cmd, basestring):
             cmd = [cmd]
             _str_cmd = True
+ 
+        gitenv = os.environ
+        gitenv['GIT_CONFIG_NOGLOBAL'] = '1'
 
-        cmd = ['GIT_CONFIG_NOGLOBAL=1', 'git'] + _copts + cmd
+        cmd = ['git'] + _copts + cmd
         if _str_cmd:
             cmd = ' '.join(cmd)
         try:
             opts = dict(
                 shell=isinstance(cmd, basestring),
                 stdout=PIPE,
-                stderr=PIPE)
+                stderr=PIPE,
+                env=gitenv,
+            )
             if os.path.isdir(self.path):
                 opts['cwd'] = self.path
             p = Popen(cmd, **opts)