Skip to contentSkip to conversation

patman: force git log commands to not use color

PATCH Superseded Albert ARIBAUD 3 participants 6 messages Oct 15, 2012 – Oct 20, 2012

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 patman: force git log commands to not use color

Colored logs confuse patman when analyzing logs.
Add --no-color option in git log commands in case
the default config has color.

---
 tools/patman/gitutil.py     |    2 +-
 tools/patman/patchstream.py |    2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)
tools/patman/gitutil.py +1 -1
index 59eca99..72d37a0 100644
@@ -38,7 +38,7 @@ def CountCommitsToBranch():
     Return:
         Number of patches that exist on top of the branch
     """
-    pipe = [['git', 'log', '--oneline', '@{upstream}..'],
+    pipe = [['git', 'log', '--no-color', '--oneline', '@{upstream}..'],
             ['wc', '-l']]
     stdout = command.RunPipe(pipe, capture=True, oneline=True)
     patch_count = int(stdout)
tools/patman/patchstream.py +1 -1
index 0503bac..4314537 100644
@@ -344,7 +344,7 @@ def GetMetaData(start, count):
         start: Commit to start from: 0=HEAD, 1=next one, etc.
         count: Number of commits to list
     """
-    pipe = [['git', 'log', '--reverse', 'HEAD~%d' % start, '-n%d' % count]]
+    pipe = [['git', 'log', '--no-color', '--reverse', 'HEAD~%d' % start, '-n%d' % count]]
     stdout = command.RunPipe(pipe, capture=True)
     series = Series()
     ps = PatchStream(series, is_log=True)
Signature · 1 line
1.7.9.5
#1 lore raw

PATCH 1/1 patman: force git log commands to not use color

Hi Albert,

Quoted 9 lines · Albert ARIBAUD

Colored logs confuse patman when analyzing logs.
Add --no-color option in git log commands in case
the default config has color.

---
 tools/patman/gitutil.py     |    2 +-
 tools/patman/patchstream.py |    2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)

Thanks for the patch, it's good to find this problem.

Quoted 19 lines
tools/patman/gitutil.py +1 -1
index 59eca99..72d37a0 100644
@@ -38,7 +38,7 @@ def CountCommitsToBranch():
     Return:
         Number of patches that exist on top of the branch
     """
-    pipe = [['git', 'log', '--oneline', '@{upstream}..'],
+    pipe = [['git', 'log', '--no-color', '--oneline', '@{upstream}..'],
             ['wc', '-l']]
     stdout = command.RunPipe(pipe, capture=True, oneline=True)
     patch_count = int(stdout)
tools/patman/patchstream.py +0 -0
index 0503bac..4314537 100644

tools/patman/patchstream.py def GetMetaData(start, count): · line 347

Quoted 5 lines
tools/patman/patchstream.py +1 -1
@@ -344,7 +344,7 @@ def GetMetaData(start, count):
         start: Commit to start from: 0=HEAD, 1=next one, etc.
         count: Number of commits to list
     """
-    pipe = [['git', 'log', '--reverse', 'HEAD~%d' % start, '-n%d' % count]]
+    pipe = [['git', 'log', '--no-color', '--reverse', 'HEAD~%d' % start, '-n%d' % count]]

The functionality is good, but can I ask for 80 columns on this one please?

Quoted 6 lines
tools/patman/patchstream.py +0 -1
     stdout = command.RunPipe(pipe, capture=True)
     series = Series()
     ps = PatchStream(series, is_log=True)
--

1.7.9.5

Regards,
Simon

#2 lore raw

PATCH 1/1 patman: force git log commands to not use color

Hi Simon,

Quoted 34 lines · Simon Glass

Hi Albert,

Quoted 9 lines · Albert ARIBAUD

Colored logs confuse patman when analyzing logs.
Add --no-color option in git log commands in case
the default config has color.

---
 tools/patman/gitutil.py     |    2 +-
 tools/patman/patchstream.py |    2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)

Thanks for the patch, it's good to find this problem.

Quoted 18 lines
tools/patman/gitutil.py +1 -1
index 59eca99..72d37a0 100644
@@ -38,7 +38,7 @@ def CountCommitsToBranch():
     Return:
         Number of patches that exist on top of the branch
     """
-    pipe = [['git', 'log', '--oneline', '@{upstream}..'],
+    pipe = [['git', 'log', '--no-color', '--oneline', '@{upstream}..'],
             ['wc', '-l']]
     stdout = command.RunPipe(pipe, capture=True, oneline=True)
     patch_count = int(stdout)
tools/patman/patchstream.py +0 -0
index 0503bac..4314537 100644
Quoted 8 lines

tools/patman/patchstream.py def GetMetaData(start, count): · line 347

Quoted 6 lines
tools/patman/patchstream.py +1 -1
@@ -344,7 +344,7 @@ def GetMetaData(start, count):
         start: Commit to start from: 0=HEAD, 1=next one, etc.
         count: Number of commits to list
     """
-    pipe = [['git', 'log', '--reverse', 'HEAD~%d' % start, '-n%d' % count]]
+    pipe = [['git', 'log', '--no-color', '--reverse', 'HEAD~%d' % start, '-n%d' % count]]

The functionality is good, but can I ask for 80 columns on this one please?

Done. :)

Quoted 9 lines
Quoted 6 lines
tools/patman/patchstream.py +0 -1
     stdout = command.RunPipe(pipe, capture=True)
     series = Series()
     ps = PatchStream(series, is_log=True)
--

1.7.9.5

Regards,
Simon

Amicalement,

Signature · 1 line
Albert.
#3 lore raw

PATCH v2 1/1 patman: force git log commands to not use color

In reply to Albert ARIBAUD

Colored logs confuse patman when analyzing logs.
Add --no-color option in git log commands in case
the default config has color.

---
Changes in v2:
- fixed line longer than 80 characters

 tools/patman/gitutil.py     |    2 +-
 tools/patman/patchstream.py |    3 ++-
 2 files changed, 3 insertions(+), 2 deletions(-)
tools/patman/gitutil.py +1 -1
index 59eca99..72d37a0 100644
@@ -38,7 +38,7 @@ def CountCommitsToBranch():
     Return:
         Number of patches that exist on top of the branch
     """
-    pipe = [['git', 'log', '--oneline', '@{upstream}..'],
+    pipe = [['git', 'log', '--no-color', '--oneline', '@{upstream}..'],
             ['wc', '-l']]
     stdout = command.RunPipe(pipe, capture=True, oneline=True)
     patch_count = int(stdout)
tools/patman/patchstream.py +2 -1
index 0503bac..ad280cc 100644
@@ -344,7 +344,8 @@ def GetMetaData(start, count):
         start: Commit to start from: 0=HEAD, 1=next one, etc.
         count: Number of commits to list
     """
-    pipe = [['git', 'log', '--reverse', 'HEAD~%d' % start, '-n%d' % count]]
+    pipe = [['git', 'log', '--no-color', '--reverse', 'HEAD~%d' % start,
+	'-n%d' % count]]
     stdout = command.RunPipe(pipe, capture=True)
     series = Series()
     ps = PatchStream(series, is_log=True)
Signature · 1 line
1.7.9.5
#4 lore raw

PATCH v2 1/1 patman: force git log commands to not use color

Quoted 5 lines · Albert ARIBAUD

Colored logs confuse patman when analyzing logs.
Add --no-color option in git log commands in case
the default config has color.

Thanks for the fix.

Quoted 38 lines

---
Changes in v2:
- fixed line longer than 80 characters

 tools/patman/gitutil.py     |    2 +-
 tools/patman/patchstream.py |    3 ++-
 2 files changed, 3 insertions(+), 2 deletions(-)
tools/patman/gitutil.py +1 -1
index 59eca99..72d37a0 100644
@@ -38,7 +38,7 @@ def CountCommitsToBranch():
     Return:
         Number of patches that exist on top of the branch
     """
-    pipe = [['git', 'log', '--oneline', '@{upstream}..'],
+    pipe = [['git', 'log', '--no-color', '--oneline', '@{upstream}..'],
             ['wc', '-l']]
     stdout = command.RunPipe(pipe, capture=True, oneline=True)
     patch_count = int(stdout)
tools/patman/patchstream.py +2 -2
index 0503bac..ad280cc 100644
@@ -344,7 +344,8 @@ def GetMetaData(start, count):
         start: Commit to start from: 0=HEAD, 1=next one, etc.
         count: Number of commits to list
     """
-    pipe = [['git', 'log', '--reverse', 'HEAD~%d' % start, '-n%d' % count]]
+    pipe = [['git', 'log', '--no-color', '--reverse', 'HEAD~%d' % start,
+       '-n%d' % count]]
     stdout = command.RunPipe(pipe, capture=True)
     series = Series()
     ps = PatchStream(series, is_log=True)
--

1.7.9.5

#5 lore raw

PATCH v2 1/1 patman: force git log commands to not use color

In reply to Albert ARIBAUD
Quoted 6 lines · Albert ARIBAUD

Colored logs confuse patman when analyzing logs. Add --no-color option in git log commands in case the default config has color.

Applied to u-boot/master, thanks!

Signature · 8 lines
Tom
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 836 bytes
Desc: Digital signature
URL: <http://lists.denx.de/pipermail/u-boot/attachments/20121020/807e675d/attachment.pgp>