Defer checking git version until it is needed

Review Request #7405 — Created June 11, 2015 and submitted

Information

RBTools
release-0.7.x
55426cb...

Reviewers

Previously, the git version was checked in the initialization of the
GitClient SCM Client. However, with systems that do not have git
installed, this would result in an error being printed that git could
not be found. We now defer determining the installed git version
until we need it, which occurs after we are sure that git is
installed.

Ran unit tests.

Removed git from my system and ran rbt status. Without this patch,
an error message was printed. With it applied, there was no error.

Description From Last Updated

If m is None, we end up going through all this logic every time we call this function. We should …

chipx86chipx86

We can probably just set _git_version to this, reducing the calculations needed when returning.

chipx86chipx86
reviewbot
  1. Tool: Pyflakes
    Processed Files:
        rbtools/clients/git.py
    
    
    
    Tool: PEP8 Style Checker
    Processed Files:
        rbtools/clients/git.py
    
    
  2. 
      
chipx86
  1. 
      
  2. rbtools/clients/git.py (Diff revision 1)
     
     
     
     
     
    Show all issues

    If m is None, we end up going through all this logic every time we call this function. We should just default _git_version to None, instead of in the else, and then we're good.

  3. rbtools/clients/git.py (Diff revision 1)
     
     
    Show all issues

    We can probably just set _git_version to this, reducing the calculations needed when returning.

  4. 
      
brennie
reviewbot
  1. Tool: Pyflakes
    Processed Files:
        rbtools/clients/git.py
    
    
    
    Tool: PEP8 Style Checker
    Processed Files:
        rbtools/clients/git.py
    
    
  2. 
      
brennie
chipx86
  1. Ship It!
  2. 
      
brennie
Review request changed
Status:
Completed
Change Summary:
Pushed to release-0.7.x (4f344a9)