{"thread":{"id":"54756","subject":"Bug: git log -L manpage claims regexes are supported, but they are not","startedAt":"2020-12-04T02:48:40Z","lastAt":"2020-12-04T02:57:38Z","messageCount":3,"participants":["Daniel","Eric Sunshine","Daniel Heath"],"isPatch":false,"patchVersion":null,"patchTotal":null},"messages":[{"id":"411294","messageId":"147444de-7653-d067-596a-9448ae6b8cac@heath.cc","threadId":"54756","inReplyTo":null,"subject":"Bug: git log -L manpage claims regexes are supported, but they are not","fromName":"Daniel","fromEmail":"daniel@heath.cc","sentAt":"2020-12-04T02:47:34Z","receivedAt":"2020-12-04T02:48:40Z","isPatch":false,"sender":{"key":"daniel@heath.cc","avatar":null},"body":"Context:\n\n   $ git version\ngit version 2.25.1\n\n   $ git log -L ^/bootstrap-sass/,+2 Gemfile\nfatal: -L argument not 'start,end:file' or ':funcname:file': \n^/bootstrap-sass/,+2\n\n\nI expected the above to work, based on the contents of `git help log`, \nwhich describes the regex format.\n\nThis regex format works correctly in `git blame -L`, and it appears the \nmanpage was copied across but not the implementation.\n\n\n$ git help log\n\n        -L <start>,<end>:<file>, -L :<funcname>:<file>\n            Trace the evolution of the line range given by \n\"<start>,<end>\" (or the function name regex <funcname>) within the \n<file>. You may not give any pathspec limiters. This is\n            currently limited to a walk starting from a single revision, \ni.e., you may only give zero or one positive revision arguments, and \n<start> and <end> (or <funcname>) must\n            exist in the starting revision. You can specify this option \nmore than once. Implies --patch. Patch output can be suppressed using \n--no-patch, but other diff formats (namely\n            --raw, --numstat, --shortstat, --dirstat, --summary, \n--name-only, --name-status, --check) are not currently implemented.\n\n            <start> and <end> can take one of these forms:\n\n            •   number\n\n                If <start> or <end> is a number, it specifies an \nabsolute line number (lines count from 1).\n\n            •   /regex/\n\n                This form will use the first line matching the given \nPOSIX regex. If <start> is a regex, it will search from the end of the \nprevious -L range, if any, otherwise from the\n                start of file. If <start> is “^/regex/”, it will search \nfrom the start of file. If <end> is a regex, it will search starting at \nthe line given by <start>.\n\n            •   +offset or -offset\n\n                This is only valid for <end> and will specify a number \nof lines before or after the line given by <start>.\n\n            If “:<funcname>” is given in place of <start> and <end>, it \nis a regular expression that denotes the range from the first funcname \nline that matches <funcname>, up to the\n            next funcname line. “:<funcname>” searches from the end of \nthe previous -L range, if any, otherwise from the start of file. \n“^:<funcname>” searches from the start of file.\n\n\n"},{"id":"411295","messageId":"CAPig+cT-Tf2ray+j9b45vz-qoiSZ4MkTyGVDr6PRJCXsvbx0=Q@mail.gmail.com","threadId":"54756","inReplyTo":"147444de-7653-d067-596a-9448ae6b8cac@heath.cc","subject":"Re: Bug: git log -L manpage claims regexes are supported, but they are not","fromName":"Eric Sunshine","fromEmail":"sunshine@sunshineco.com","sentAt":"2020-12-04T02:54:13Z","receivedAt":"2020-12-04T02:55:23Z","isPatch":false,"sender":{"key":"sunshine@sunshineco.com","avatar":"https://avatars.githubusercontent.com/u/163641?v=4"},"body":"On Thu, Dec 3, 2020 at 9:50 PM Daniel <daniel@heath.cc> wrote:\n>    $ git log -L ^/bootstrap-sass/,+2 Gemfile\n> fatal: -L argument not 'start,end:file' or ':funcname:file':\n> ^/bootstrap-sass/,+2\n>\n> $ git help log\n>         -L <start>,<end>:<file>, -L :<funcname>:<file>\n\nYou're missing the colon between <end> and <file> in your example. It should be:\n\n    $ git log -L ^/bootstrap-sass/,+2:Gemfile\n"},{"id":"411296","messageId":"c41cbbd9-d395-41fe-9013-8a1bac68d491@www.fastmail.com","threadId":"54756","inReplyTo":"CAPig+cT-Tf2ray+j9b45vz-qoiSZ4MkTyGVDr6PRJCXsvbx0=Q@mail.gmail.com","subject":"Re: Bug: git log -L manpage claims regexes are supported, but they are not","fromName":"Daniel Heath","fromEmail":"daniel@heath.cc","sentAt":"2020-12-04T02:56:07Z","receivedAt":"2020-12-04T02:57:38Z","isPatch":false,"sender":{"key":"daniel@heath.cc","avatar":null},"body":"Thanks very much! \n\nI was thrown by `git blame` having an almost-identical but opposite interface (must use a space and not a colon).\n\nThanks,\nDaniel Heath\n\nOn Fri, Dec 4, 2020, at 1:54 PM, Eric Sunshine wrote:\n> On Thu, Dec 3, 2020 at 9:50 PM Daniel <daniel@heath.cc> wrote:\n> >    $ git log -L ^/bootstrap-sass/,+2 Gemfile\n> > fatal: -L argument not 'start,end:file' or ':funcname:file':\n> > ^/bootstrap-sass/,+2\n> >\n> > $ git help log\n> >         -L <start>,<end>:<file>, -L :<funcname>:<file>\n> \n> You're missing the colon between <end> and <file> in your example. It should be:\n> \n>     $ git log -L ^/bootstrap-sass/,+2:Gemfile\n>\n"}]}