{"thread":{"id":"28624","subject":"unexpected behavior with `git log --skip filename`","startedAt":"2011-10-07T17:15:03Z","lastAt":"2011-10-08T17:47:58Z","messageCount":4,"participants":["Andrew McNabb","Jay Soffian"],"isPatch":false,"patchVersion":null,"patchTotal":null},"messages":[{"id":"177166","messageId":"20111007171503.GB16607@mcnabbs.org","threadId":"28624","inReplyTo":null,"subject":"unexpected behavior with `git log --skip filename`","fromName":"Andrew McNabb","fromEmail":"amcnabb@mcnabbs.org","sentAt":"2011-10-07T17:15:03Z","receivedAt":"2011-10-07T17:15:03Z","isPatch":false,"sender":{"key":"amcnabb@mcnabbs.org","avatar":null},"body":"The \"--skip\" option to \"git log\" did not behave as I expected, but I'm\nnot sure whether this was user error, unclear documentation, or a bug.\nSpecifically, I ran the following, intending to find the previous\nrevision of a given file:\n\ngit log --skip=1 -n 1 --oneline some-filename\n\nMy expectation was that this would behave the same as:\n\ngit log -n 2 --oneline some-filename |tail -n 1\n\nInstead, the --skip=1 parameter seemed to be ignored.  After I tried\nseveral different values, it appears that the commits are skipped before\npath matching with \"some-filename\".\n\nIs this the intended behavior?  If so, should the documentation be\nclarified by changing \"Note that they are applied before commit ordering\nand formatting options, such as --reverse\" to something like \"Note that\nthey are applied before path matching, commit ordering, and formatting\noptions, such as --reverse\"?\n\n--\nAndrew McNabb\nhttp://www.mcnabbs.org/andrew/\nPGP Fingerprint: 8A17 B57C 6879 1863 DE55  8012 AB4D 6098 8826 6868\n"},{"id":"177191","messageId":"CAG+J_DwnUOeDTiUW-UUJGLLg8jJ4EhXN21B7o_hOMnyowM9a8g@mail.gmail.com","threadId":"28624","inReplyTo":"20111007171503.GB16607@mcnabbs.org","subject":"Re: unexpected behavior with `git log --skip filename`","fromName":"Jay Soffian","fromEmail":"jaysoffian@gmail.com","sentAt":"2011-10-07T21:54:36Z","receivedAt":"2011-10-07T21:54:36Z","isPatch":false,"sender":{"key":"jaysoffian@gmail.com","avatar":"https://avatars.githubusercontent.com/u/155970?v=4"},"body":"On Fri, Oct 7, 2011 at 1:15 PM, Andrew McNabb <amcnabb@mcnabbs.org> wrote:\n> The \"--skip\" option to \"git log\" did not behave as I expected, but I'm\n> not sure whether this was user error, unclear documentation, or a bug.\n> Specifically, I ran the following, intending to find the previous\n> revision of a given file:\n>\n> git log --skip=1 -n 1 --oneline some-filename\n>\n> My expectation was that this would behave the same as:\n>\n> git log -n 2 --oneline some-filename |tail -n 1\n>\n> Instead, the --skip=1 parameter seemed to be ignored.  After I tried\n> several different values, it appears that the commits are skipped before\n> path matching with \"some-filename\".\n\nHmm:\n\n$ git log --oneline GIT-VERSION-GEN | head -2\n7f41b6bbe3 Post 1.7.7 first wave\n703f05ad58 Git 1.7.7\n\n$ git log --oneline --skip=1 -n 1 GIT-VERSION-GEN\n703f05ad58 Git 1.7.7\n\nj.\n"},{"id":"177209","messageId":"20111008023637.GA18136@mcnabbs.org","threadId":"28624","inReplyTo":"CAG+J_DwnUOeDTiUW-UUJGLLg8jJ4EhXN21B7o_hOMnyowM9a8g@mail.gmail.com","subject":"Re: unexpected behavior with `git log --skip filename`","fromName":"Andrew McNabb","fromEmail":"amcnabb@mcnabbs.org","sentAt":"2011-10-08T02:36:37Z","receivedAt":"2011-10-08T02:36:37Z","isPatch":false,"sender":{"key":"amcnabb@mcnabbs.org","avatar":null},"body":"On Fri, Oct 07, 2011 at 05:54:36PM -0400, Jay Soffian wrote:\n> \n> Hmm:\n> \n> $ git log --oneline GIT-VERSION-GEN | head -2\n> 7f41b6bbe3 Post 1.7.7 first wave\n> 703f05ad58 Git 1.7.7\n> \n> $ git log --oneline --skip=1 -n 1 GIT-VERSION-GEN\n> 703f05ad58 Git 1.7.7\n\nI went back to reproduce this, and I think I may have been using the\n--follow option earlier.  In my private repository, git log gives\nidentical output for the last two commits when I don't specify --skip:\n\n$ git log -n 2 --oneline httpd.conf.orig\nf0026e9 updated many of the *.orig files to the latest version\ne57e840 moved the .orig files into place, too\n$ git log --follow -n 2 --oneline httpd.conf.orig\nf0026e9 updated many of the *.orig files to the latest version\ne57e840 moved the .orig files into place, too\n$\n\nBut when I specify --skip=1, the output is different:\n\n$ git log -n 1 --skip=1 --oneline httpd.conf.orig\ne57e840 moved the .orig files into place, too\n$ git log --follow -n 1 --skip=1 --oneline httpd.conf.orig\nf0026e9 updated many of the *.orig files to the latest version\n$\n\n\nGIT-VERSION-GEN example that you shared, I don't notice this difference.\nIt's not immediately obvious to me what's different between the two\nexamples.\n\n--\nAndrew McNabb\nhttp://www.mcnabbs.org/andrew/\nPGP Fingerprint: 8A17 B57C 6879 1863 DE55  8012 AB4D 6098 8826 6868\n"},{"id":"177239","messageId":"CAG+J_DwDX4e+siHCUYEyfhOChf+GDWFtj-Hypxk0mtB4J_0kNg@mail.gmail.com","threadId":"28624","inReplyTo":"20111008023637.GA18136@mcnabbs.org","subject":"Re: unexpected behavior with `git log --skip filename`","fromName":"Jay Soffian","fromEmail":"jaysoffian@gmail.com","sentAt":"2011-10-08T17:47:58Z","receivedAt":"2011-10-08T17:47:58Z","isPatch":false,"sender":{"key":"jaysoffian@gmail.com","avatar":"https://avatars.githubusercontent.com/u/155970?v=4"},"body":"On Fri, Oct 7, 2011 at 10:36 PM, Andrew McNabb <amcnabb@mcnabbs.org> wrote:\n> I went back to reproduce this, and I think I may have been using the\n> --follow option earlier.\n\n--follow is, er, special. It doesn't combine well with other rev-list\noptions. You'll have to search this list for details. Sorry I can't\nprovide more info. :-(\n\nj.\n"}]}