{"thread":{"id":"15163","subject":"Problem with --skip and --max-count","startedAt":"2008-08-22T15:06:46Z","lastAt":"2008-08-22T15:06:46Z","messageCount":1,"participants":["Govind Salinas"],"isPatch":false,"patchVersion":null,"patchTotal":null},"messages":[{"id":"88141","messageId":"5d46db230808220806j21a81864he77a3b05e298ce2b@mail.gmail.com","threadId":"15163","inReplyTo":null,"subject":"Problem with --skip and --max-count","fromName":"Govind Salinas","fromEmail":"govind@sophiasuchtig.com","sentAt":"2008-08-22T15:06:46Z","receivedAt":"2008-08-22T15:06:46Z","isPatch":false,"sender":{"key":"govind@sophiasuchtig.com","avatar":null},"body":"Hey Folks,\n\nI have been working on my porcelain, trying to get it semi-polished and\nI noticed that the behavior of --skip and --max-count is not what I expected\nin several cases.\n\nFor simple output, it works as I think it should, but whenever you are doing\nsome kind of filtering or non-standard commit limiting, such as passing\n--follow, it does not print out the first X results.  Similarly --skipping the\nnumber of items that you got back does not put get you to where you left\noff.\n\nBasically, I am trying to use --skip and --max-count to do paging, but\nwhen I add filters, it doesn't work very well.  For example...\n\n$ git log --pretty=oneline --follow -- pyrite/git/repository.py | wc -l\n103\n\n$ git log --pretty=oneline --follow -20 -- pyrite/git/repository.py | wc -l\n2\n\n$ git log --pretty=oneline --follow -20 --skip=20 --\npyrite/git/repository.py | wc -l\n2\n\nSo where I am trying to page by 20, I am only getting a random number of\ncommits depending on how many fit the criteria in the window.  I understand\nthis is probably by design, but it is not optimal to work with.  I had to\nmanually do the skipping and limiting, which would probably have been\nmore efficient if it had been done by git.  Would it be possible to get\ngit to limit and skip based on the number of results it had returned rather\nthan the number of result it had processed?  Even new cmd line args\nwould work.\n\nI am using 1.6.0 BTW.\n\nThanks,\nGovind\n"}]}