Package gbp :: Package git :: Module commit :: Class GitCommit
[hide private]
[frames] | no frames]

Class GitCommit

object --+
         |
        GitCommit

A git commit

Instance Methods [hide private]

Inherited from object: __delattr__, __format__, __getattribute__, __hash__, __init__, __new__, __reduce__, __reduce_ex__, __repr__, __setattr__, __sizeof__, __str__, __subclasshook__

Static Methods [hide private]
bool
is_sha1(value)
Is value a valid 40 digit SHA1?
Class Variables [hide private]
  sha1_re = re.compile(r'[0-9a-f]{40}$')
Properties [hide private]

Inherited from object: __class__

Method Details [hide private]

is_sha1(value)
Static Method

 

Is value a valid 40 digit SHA1?

>>> GitCommit.is_sha1('asdf')
False
>>> GitCommit.is_sha1('deadbeef')
False
>>> GitCommit.is_sha1('17975594b2d42f2a3d144a9678fdf2c2c1dd96a0')
True
>>> GitCommit.is_sha1('17975594b2d42f2a3d144a9678fdf2c2c1dd96a0toolong')
False
Parameters:
  • value (str) - the value to check
Returns: bool
True if value is a 40 digit SHA1, False otherwise.