Comments (8)
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.
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.
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.
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.
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.
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.
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.
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)
- Better support for repository depth
- Php compatability HOT 1
- Gave up on installing this... HOT 3
- Search for repository in subdirectories HOT 1
- Uncaught Error: Cannot assign string to property Symfony\Component\HttpKernel\Debug\FileLinkFormatter::$fileLinkFormat of type array|false HOT 2
- 404 on all assets HOT 11
- Hello, I use Gitlist 1.1.1 and I want to know if I respect the BSD-2-Clause HOT 2
- git clone over https does not work
- Support needed on installing HOT 3
- git_path from config.yml not used
- Can't create development environment HOT 1
- Can't list repositories HOT 2
- PHP 8.2 => 500 Internal Server Error, setLastErrors must be of type array, bool given HOT 3
- default_repository_dir from config.yml don't work HOT 2
- public/.htaccess is missing HOT 2
- automacao
- Openening a file containing the name of a branch or tag throws a CommandException
- Display Issue and Content Not Found Problem HOT 1
- Problem when adding gits
- pump_local_HMI_X2_V3.0.git HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from gitlist.