From mboxrd@z Thu Jan 1 00:00:00 1970 From: Albert ARIBAUD Date: Mon, 15 Oct 2012 21:56:30 +0200 Subject: [U-Boot] [PATCH] patman: force git log commands to not use color In-Reply-To: References: <1350280066-23320-1-git-send-email-albert.u.boot@aribaud.net> Message-ID: <20121015215630.4f4743a0@lilith> List-Id: MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit To: u-boot@lists.denx.de Hi Simon, On Mon, 15 Oct 2012 10:20:59 -0700, Simon Glass wrote: > Hi Albert, > > On Sun, Oct 14, 2012 at 10:47 PM, Albert ARIBAUD > wrote: > > Colored logs confuse patman when analyzing logs. > > Add --no-color option in git log commands in case > > the default config has color. > > > > Signed-off-by: Albert ARIBAUD > > --- > > 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. > > > > > diff --git a/tools/patman/gitutil.py b/tools/patman/gitutil.py > > index 59eca99..72d37a0 100644 > > --- a/tools/patman/gitutil.py > > +++ b/tools/patman/gitutil.py > > @@ -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) > > diff --git a/tools/patman/patchstream.py b/tools/patman/patchstream.py > > index 0503bac..4314537 100644 > > --- a/tools/patman/patchstream.py > > +++ b/tools/patman/patchstream.py > > @@ -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. :) > > stdout = command.RunPipe(pipe, capture=True) > > series = Series() > > ps = PatchStream(series, is_log=True) > > -- > > 1.7.9.5 > > > > Regards, > Simon Amicalement, -- Albert.