Applied: [kteam-tools][PATCH] ktl: Git.config() allows 'git config' queries

Brad Figg brad.figg at canonical.com
Tue May 28 15:52:56 UTC 2013


On 05/24/2013 03:06 PM, Kamal Mostafa wrote:
> API interface to 'git config'.
> 
> Examples:
> 
>     print Git.config("user.email")
>     kamal at canonical.com
> 
>     print Git.config("remote.origin.url")
>     git://kernel.ubuntu.com/ubuntu/kteam-tools.git
> 
> Signed-off-by: Kamal Mostafa <kamal at canonical.com>
> ---
>  ktl/git.py | 11 +++++++++++
>  1 file changed, 11 insertions(+)
> 
> diff --git a/ktl/git.py b/ktl/git.py
> index 48abc99..9483ad4 100644
> --- a/ktl/git.py
> +++ b/ktl/git.py
> @@ -39,6 +39,17 @@ class Git:
>  
>          return retval
>  
> +    # config
> +    #
> +    # Return the requested git config value. E.g. config("user.email")
> +    #
> +    @classmethod
> +    def config(cls, key):
> +        status, result = run_command("git config %s" % key, cls.debug)
> +        if status != 0:
> +            raise GitError(result)
> +        return result[0]
> +
>      # branches
>      #
>      # Return a list of all the git branches known to this git repository.
> 

New functionality, no chance of regressions.

-- 
Brad Figg brad.figg at canonical.com http://www.canonical.com




More information about the kernel-team mailing list