John Admanski [2010-09-13, 16:44 +0200]:

Hi,

> Looks nice, especially with all the cleanup. I can't comment much on the
Yep, Lucas did a good job there. Also, for me it was a good example on how
the Autotest code should look like.

> I do note that this code uses lstrip with '* ', which I do worry about a
Git marks the branch you are on with '^* '. To find the branch the
repository is on thats what is looked for.
Do you have a better approach?

> > +        cmd = 'branch --no-color'
> > +        if all:
> > +            cmd = " ".join([cmd, "-a"])
> > +        if remote_tracking:
> > +            cmd = " ".join([cmd, "-r"])
> > +
> > +        gitlog = self.gitcmd(cmd, True)
> > +        if gitlog.exit_status != 0:
> > +            print gitlog.stderr
> > +            raise error.CmdError('Failed to get git branch', gitlog)
> > +        elif all or remote_tracking:
> > +            return gitlog.stdout.strip('\n')
> > +        else:
> > +            branch = [b.lstrip('* ') for b in gitlog.stdout.split('\n') \
> > +                      if b.startswith('*')][0]
> > +            return branch
That's the line we talk about. I'd like to strip off the two 1st characters
'* '. b[2:] would be equivalent.

Bye,

Frank

-- 
Frank Becker <[email protected]> (jabber|mail) | http://twitter.com/41i3n8
GnuPG: 0xADC29ECD | F01B 5E9C 1D09 981B 5B40 50D3 C80F 7459 ADC2 9ECD
SILC-Net: a8 | Home: http://www.alien8.de | <<</>> http://www.c3d2.de
"> Freedom is just chaos, with better lighting. <"  Alan Dean  Foster

Attachment: signature.asc
Description: Digital signature

_______________________________________________
Autotest mailing list
[email protected]
http://test.kernel.org/cgi-bin/mailman/listinfo/autotest

Reply via email to