GithubHelp home page GithubHelp logo

Comments (8)

klaussilveira avatar klaussilveira commented on August 15, 2024

I don't think git log allows me to give an offset along with it's limit parameter. Any ideas on how we can paginate without storing data in cache or a database? I would like to keep GitList simple and just parsing raw git output.

from gitlist.

kulbirsaini avatar kulbirsaini commented on August 15, 2024

There exist options for git log which can help us achieve pagination. Look for the -number, --skip, --max-count and --reverse options in Commit Listing section of the man page.

from gitlist.

klaussilveira avatar klaussilveira commented on August 15, 2024

Thanks. That was useful. This command never crossed my mind! git log --skip=20 --max-count=10. 10 commits per page, starting at offset 20.

However, i have to make two git log runs: one to discover the total amount of commits available and another to get the actual commits from that page. Otherwise, the pager won't be very smart (the next button will be available to the infinite).

I'm thinking about leaving pagination to Javascript and load the entire thing there. The problem is that this would be an interface-oriented change and the load would still be high. Any opinions/suggestions? I can make the pagination very easily, but the next button will go on, and on, and on. Just not very intelligent.

from gitlist.

klaussilveira avatar klaussilveira commented on August 15, 2024

Please, reopen with all the issues the current pagination system has. This way the discussion will be more focused towards improving pagination, rather than having it.

from gitlist.

kulbirsaini avatar kulbirsaini commented on August 15, 2024

I don't think that pushing all the commits to browser and then let javascript decide paging will be a good idea because you won't be able to get all the commits from git repo in the first place (for large repos like Linux). So, we have to figure out a way to count the total commits on the fly. There must be some hidden git feature to do this. Let's explore.

from gitlist.

klaussilveira avatar klaussilveira commented on August 15, 2024

Git exploring never stops to amuse me. GitList made me read so many man pages and i'm still finding new stuff...

I can make the git log output as slim as possible, but depending on repository size, it can be useless and will be a visible overhead.

from gitlist.

kulbirsaini avatar kulbirsaini commented on August 15, 2024

To count all the commits in a repo, we can use git rev-list --all --count. This seems pretty fast. Take ~7-8 seconds to count commits for Linux on my VPS with 1GB RAM, Intel Xeon 2.33GHz. There are like 302939 commits in the repo I have.

from gitlist.

kulbirsaini avatar kulbirsaini commented on August 15, 2024

Everything is awesome after your latest commit :-) Now, we need some way to cache the count. May be using session variable or something. If we can do that, we can finally browse Linux repo commits without pain :-)

from gitlist.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.