def sort(self):
        users = []
        for _, group in itertools.groupby(sorted(self.commits),
                                          operator.attrgetter('author_mail')):
            if group:
                users.append(self.merge_user_commits(group))
        self.sorted_commits = sorted(users,
                                     key=operator.attrgetter('line_count'),
                                     reverse=True)
        return self.sorted_commits