def rev_list(ref, count=None, repo_dir=None):
 assert (not ref.startswith('-'))
 opts = []
 if count:
  opts += ['-n', str(atoi(count))]
 argv = ((['git', 'rev-list', '--pretty=format:%at'] + opts) + [ref, '--'])
 p = subprocess.Popen(argv, preexec_fn=_gitenv(repo_dir), stdout=subprocess.PIPE)
 commit = None
 for row in p.stdout:
  s = row.strip()
  if s.startswith('commit '):
   commit = s[7:].decode('hex')
  else:
   date = int(s)
   (yield (date, commit))
 rv = p.wait()
 if rv:
  raise GitError, ('git rev-list returned error %d' % rv)

def rev_list ( ref , count = None , repo_dir = None ) : assert ( not ref . startswith ( '-' ) ) opts = [ ] if count : opts += [ '-n' , str ( atoi ( count ) ) ] argv = ( ( [ 'git' , 'rev-list' , '--pretty=format:%at' ] + opts ) + [ ref , '--' ] ) p = subprocess . Popen ( argv , preexec_fn = _gitenv ( repo_dir ) , stdout = subprocess . PIPE ) commit = None for row in p . stdout : s = row . strip ( ) if s . startswith ( 'commit ' ) : commit = s [ 7 : ] . decode ( 'hex' ) else : date = int ( s ) ( yield ( date , commit ) ) rv = p . wait ( ) if rv : raise GitError , ( 'git rev-list returned error %d' % rv )
generate a list of reachable commits in reverse chronological order .