Beispiel #1
0
def diff_info(sha1, git=git):
    log = git.log('-1',
                  '--pretty=format:Author:\t%aN <%aE>%n'
                  'Date:\t%aD%n%n'
                  '%s%n%n%b',
                  sha1)
    return log + '\n\n' + sha1_diff(sha1)
Beispiel #2
0
def log_helper(all=False, extra_args=None):
    """Return parallel arrays containing the SHA-1s and summaries."""
    revs = []
    summaries = []
    args = []
    if extra_args:
        args = extra_args
    output = git.log(pretty='oneline', no_color=True, all=all, *args)
    for line in map(core.decode, output.splitlines()):
        match = REV_LIST_REGEX.match(line)
        if match:
            revs.append(match.group(1))
            summaries.append(match.group(2))
    return (revs, summaries)
Beispiel #3
0
def diff_info(sha1, git=git, merge=True):

    if merge:
        mergefmt = 'Merge: %P%n'
    else:
        mergefmt = ''

    log = git.log('-1',
            '--pretty=format:'
            'commit %H%n' +
            mergefmt +
            'Author: %aN <%aE>%n'
            'Date:   %aD%n'
            '%n%s%n%n%b',
            sha1)
    return core.decode(log) + '\n\n' + sha1_diff(sha1)