~sircmpwn/sr.ht-dev

This thread contains a patchset. You're looking at the original emails, but you may wish to use the patch review UI. Review patch
1

[PATCH git.sr.ht] Use next commit in log continuation

Details
Message ID
<20210611022229.88397-1-greg@gpanders.com>
DKIM signature
pass
Download raw message
Patch: +10 -6
Fixes a bug where the first commit in the log after clicking the Next 
button would match the last commit on the previous page.

---
 gitsrht/blueprints/repo.py | 12 ++++++++----
 gitsrht/templates/log.html |  4 ++--
 2 files changed, 10 insertions(+), 6 deletions(-)

diff --git a/gitsrht/blueprints/repo.py b/gitsrht/blueprints/repo.py
index 49e4f58..5cf1d0b 100644
--- a/gitsrht/blueprints/repo.py
+++ b/gitsrht/blueprints/repo.py
@@ -418,17 +418,21 @@ def log(owner, repo, ref, path):
        if not commit:
            abort(404)

        commits = get_log(git_repo, commit, path, 21)
        num_commits = 20
        commits = get_log(git_repo, commit, path, num_commits + 1)

        entry = None
        if path and commit.tree and path in commit.tree:
            entry = commit.tree[path]

        has_more = commits and len(commits) == 21
        next_commit = None
        if commits and len(commits) == num_commits + 1:
            next_commit = commits[-1]

        return render_template("log.html", view="log",
                owner=owner, repo=repo, ref=ref, path=path.split("/"),
                commits=commits[:20], refs=refs, entry=entry, pygit2=pygit2,
                has_more=has_more)
                commits=commits[:num_commits], refs=refs, entry=entry, pygit2=pygit2,
                next_commit=next_commit)


@repo.route("/<owner>/<repo>/log/rss.xml", defaults={"ref": None})
diff --git a/gitsrht/templates/log.html b/gitsrht/templates/log.html
index 4f94073..6f2c105 100644
--- a/gitsrht/templates/log.html
+++ b/gitsrht/templates/log.html
@@ -47,7 +47,7 @@
        </div>
        {% endfor %}
      </div>
      {% if commits and has_more %}
      {% if next_commit %}
      <a
        class="pull-right btn btn-primary"
        href="{{url_for("repo.log",
@@ -55,7 +55,7 @@
          repo=repo.name,
          ref=ref,
          path=full_path,
        )}}?from={{commits[-1].id}}"
        )}}?from={{next_commit.id}}"
      >Next {{icon("caret-right")}}</a>
      {% endif %}
    </div>
-- 
2.32.0

[git.sr.ht/patches] build failed

builds.sr.ht
Details
Message ID
<CC0FLS05U8E6.PLXB373ZVDLM@cirno2>
In-Reply-To
<20210611022229.88397-1-greg@gpanders.com> (view parent)
DKIM signature
missing
Download raw message
git.sr.ht/patches: FAILED in 3m32s

[Use next commit in log continuation][0] from [Gregory Anders][1]

[0]: https://lists.sr.ht/~sircmpwn/sr.ht-dev/patches/23245
[1]: mailto:greg@gpanders.com

✓ #523353 SUCCESS git.sr.ht/patches/alpine.yml    https://builds.sr.ht/~sircmpwn/job/523353
✗ #523354 FAILED  git.sr.ht/patches/archlinux.yml https://builds.sr.ht/~sircmpwn/job/523354
✓ #523355 SUCCESS git.sr.ht/patches/debian.yml    https://builds.sr.ht/~sircmpwn/job/523355
Reply to thread Export thread (mbox)