<commit_before>%%inherit(file="/_main.haml")/
-!
    import itertools
    import pygit2 as git

%ol.breadcrumb
    %li
        %a(href='/') %img(src="/img/git-logo.png")
    %li
        %a(href=url_for('group', group=group)) &= group.name
    %li
        &= repo.name

.media
    %a.pull-left(href='#')
        %img.thumbnail.media-object(src='//robohash.org/%s--%s.png' % (group.name, repo.name), width=48, height=48)
    .media-body
        %h4.media-heading&= repo.name
        %p&= 'No description.'


%h2 Recent Commits

-
    head = repo.git.head.get_object()
    commit_iter = repo.git.walk(head.oid, git.GIT_SORT_TOPOLOGICAL)
    commits = itertools.islice(commit_iter, 10)

%ol - for commit in commits:
    %li
        %code= commit.hex[:8]
        &= commit.message

-
    next_ = next(commit_iter, None)
- if next_:
    There are more, starting with
    %code &= next_.hex[:8]

<commit_msg>Show the current tree and readme<commit_after>%%inherit(file="/_main.haml")/
-!
    import itertools
    import pygit2 as git
-
    head = repo.git.head.get_object()

%ol.breadcrumb
    %li
        %a(href='/') %img(src="/img/git-logo.png")
    %li
        %a(href=url_for('group', group=group)) &= group.name
    %li
        &= repo.name

.media
    %a.pull-left(href='#')
        %img.thumbnail.media-object(src='//robohash.org/%s--%s.png' % (group.name, repo.name), width=48, height=48)
    .media-body
        %h4.media-heading&= repo.name
        %p&= 'No description.'


%h2 Current Tree

%table.table
    - for entry in head.tree:
        %tr
            %td = oct(entry.filemode & 0o777)
            %td %a(href='#') &= entry.name
            %td %a(href='#') %code &= entry.hex[:8]


- if 'README.md' in head.tree:
    -
        entry = head.tree['README.md']
        blob = repo.git[entry.oid]

    %h2 README
    %pre &= blob.data


%h2 Recent Commits

-
    commit_iter = repo.git.walk(head.oid, git.GIT_SORT_TOPOLOGICAL)
    commits = itertools.islice(commit_iter, 10)

%ol - for commit in commits:
    %li
        %code= commit.hex[:8]
        &= commit.message

-
    next_ = next(commit_iter, None)
- if next_:
    There are more, starting with
    %code &= next_.hex[:8]


{'fraction_non_alphanumeric': 0.16986301369863013, 'fraction_numerical': 0.013242009132420091, 'mean_word_length': 2.370769230769231, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '1833574', 'n_tokens_mistral': 845, 'n_tokens_neox': 825, 'n_words': 160}