

def get_log_entries(self, from_tag, to_tag, skip_merges=False):
    cmd = [self._executable, 'log']
    if (from_tag or to_tag):
        cmd.append(('%s%s' % ((('%s..' % to_tag) if to_tag else ''), (from_tag if from_tag else ''))))
    cmd.append('--format=format:%H')
    if skip_merges:
        cmd.append('--no-merges')
    result = self._run_command(cmd)
    if result['returncode']:
        raise RuntimeError(('Could not fetch commit hashes:\n%s' % result['output']))
    log_entries = []
    if result['output']:
        hashes = result['output'].splitlines()
        for hash_ in hashes:
            cmd = [self._executable, 'log', hash_, '-n', '1', '--format=format:%B']
            result = self._run_command(cmd)
            if result['returncode']:
                raise RuntimeError(('Could not fetch commit message:\n%s' % result['output']))
            if (result['output'] == from_tag):
                continue
            msg = result['output']
            cmd = [self._executable, 'show', hash_, '--name-only', '--format=format:""']
            result = self._run_command(cmd)
            if result['returncode']:
                raise RuntimeError(('Could not fetch affected paths:\n%s' % result['output']))
            affected_paths = result['output'].splitlines()
            log_entries.append(LogEntry(msg, affected_paths, self._get_author(hash_)))
    return log_entries

dataset/ETHPy150Open ros-infrastructure/catkin_pkg/src/catkin_pkg/changelog_generator_vcs.py GitClient.get_log_entries/original