diff mbox series

[kteam-tools] ktl: force default format for Git.log()

Message ID 1508267289-7230-1-git-send-email-marcelo.cerri@canonical.com
State New
Headers show
Series [kteam-tools] ktl: force default format for Git.log() | expand

Commit Message

Marcelo Henrique Cerri Oct. 17, 2017, 7:08 p.m. UTC
Force default git log format, so Git.log() return will be consistent
even if format.pretty is defined with a different value in .gitconfig.

Signed-off-by: Marcelo Henrique Cerri <marcelo.cerri@canonical.com>
---
 ktl/git.py | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

Comments

Kleber Sacilotto de Souza Oct. 18, 2017, 8:28 a.m. UTC | #1
On 10/17/17 21:08, Marcelo Henrique Cerri wrote:
> Force default git log format, so Git.log() return will be consistent
> even if format.pretty is defined with a different value in .gitconfig.
> 
> Signed-off-by: Marcelo Henrique Cerri <marcelo.cerri@canonical.com>

Good catch :-).

Acked-by: Kleber Sacilotto de Souza <kleber.souza@canonical.com>

> ---
>  ktl/git.py | 4 ++--
>  1 file changed, 2 insertions(+), 2 deletions(-)
> 
> diff --git a/ktl/git.py b/ktl/git.py
> index 5c4e270e72fa..67444e5ddb02 100644
> --- a/ktl/git.py
> +++ b/ktl/git.py
> @@ -204,9 +204,9 @@ class Git:
>          cls.log_results['commits']       = []
>          cls.log_results['buglink-index'] = {}
>          if num != -1:
> -            status, result = run_command("git log -%d" % (num), cls.debug)
> +            status, result = run_command("git log --pretty=medium -%d" % (num), cls.debug)
>          else:
> -            status, result = run_command("git log", cls.debug)
> +            status, result = run_command("git log --pretty=medium", cls.debug)
>          commit       = {}
>          commit_text  = []
>          current_sha1 = 'unknown'
>
Kleber Sacilotto de Souza Oct. 18, 2017, 3:28 p.m. UTC | #2
Applied to kteam-tools/master branch.

Kleber
diff mbox series

Patch

diff --git a/ktl/git.py b/ktl/git.py
index 5c4e270e72fa..67444e5ddb02 100644
--- a/ktl/git.py
+++ b/ktl/git.py
@@ -204,9 +204,9 @@  class Git:
         cls.log_results['commits']       = []
         cls.log_results['buglink-index'] = {}
         if num != -1:
-            status, result = run_command("git log -%d" % (num), cls.debug)
+            status, result = run_command("git log --pretty=medium -%d" % (num), cls.debug)
         else:
-            status, result = run_command("git log", cls.debug)
+            status, result = run_command("git log --pretty=medium", cls.debug)
         commit       = {}
         commit_text  = []
         current_sha1 = 'unknown'