{"thread":{"id":"52470","subject":"[PATCH 0/2] Improve line log documentation","startedAt":"2019-12-17T05:07:49Z","lastAt":"2019-12-26T17:46:57Z","messageCount":18,"participants":["Philippe Blain via GitGitGadget","SZEDER Gábor","Derrick Stolee","Junio C Hamano","Philippe Blain"],"isPatch":true,"patchVersion":1,"patchTotal":2},"messages":[{"id":"388324","messageId":"pull.494.git.1576559263.gitgitgadget@gmail.com","threadId":"52470","inReplyTo":null,"subject":"[PATCH 0/2] Improve line log documentation","fromName":"Philippe Blain via GitGitGadget","fromEmail":"gitgitgadget@gmail.com","sentAt":"2019-12-17T05:07:41Z","receivedAt":"2019-12-17T05:07:49Z","isPatch":true,"sender":{"key":"levraiphilippeblain@gmail.com","avatar":"https://avatars.githubusercontent.com/u/44212482?v=4"},"body":"These two patches add more information to the documentation for line history\n(git log -L) : \n\n * Mention explicitly that only the --patch and --no-patch diff formats are\n   supported \n * Mention that any given regex must match in the starting revision\n\nRegarding point 2 : I stumbled upon this while reading the history of\n'filter_refs' in fetch-pack.c. I did\n\n    git log -s -L :filter_refs:fetch-pack.c\n\nwhich shows a list of commits starting with 745f7a8cac (fetch-pack: move\ncore code to libgit.a, 2012-10-26). So then I did\n\n    git log  -s -L :filter_refs:fetch-pack.c -L :filter_refs:builtin/fetch-pack.c\n\nwhich fails with\n\n    fatal: -L parameter 'filter_refs' starting at line 1: no match\n\nPhilippe Blain (2):\n  Documentation/git-log: document accepted line-log diff formats\n  Documentation/git-log: mention that line-log regex must match in\n    starting revision\n\n Documentation/git-log.txt | 9 +++++++--\n Documentation/gitk.txt    | 6 +++++-\n 2 files changed, 12 insertions(+), 3 deletions(-)\n\n\nbase-commit: ad05a3d8e5a6a06443836b5e40434262d992889a\nPublished-As: https://github.com/gitgitgadget/git/releases/tag/pr-494%2Fphil-blain%2Fline-log-doc-v1\nFetch-It-Via: git fetch https://github.com/gitgitgadget/git pr-494/phil-blain/line-log-doc-v1\nPull-Request: https://github.com/gitgitgadget/git/pull/494\n-- \ngitgitgadget\n"},{"id":"388325","messageId":"0ed04a8629a64d15062e13c1f1739b01436a897b.1576559263.git.gitgitgadget@gmail.com","threadId":"52470","inReplyTo":"pull.494.git.1576559263.gitgitgadget@gmail.com","subject":"[PATCH 1/2] Documentation/git-log: document accepted line-log diff formats","fromName":"Philippe Blain via GitGitGadget","fromEmail":"gitgitgadget@gmail.com","sentAt":"2019-12-17T05:07:42Z","receivedAt":"2019-12-17T05:07:50Z","isPatch":true,"sender":{"key":"levraiphilippeblain@gmail.com","avatar":"https://avatars.githubusercontent.com/u/44212482?v=4"},"body":"From: Philippe Blain <levraiphilippeblain@gmail.com>\n\nCurrently the line-log functionality (git log -L) only supports\ndisplaying patch output (`-p`, its default behavior) and suppressing it\n(`-s`). A check was added in the code to that effect in 5314efaea (line-log:\ndetect unsupported formats, 2019-03-10) but the documentation was not\nupdated.\n\nExplicitly mention that `-L` implies `-p`, that patch output can be\nsuppressed using `-s`, and that all other diff formats are not allowed.\n\nAdditionnally, mention that the ':<funcname>' form implies `--function-context`.\n\nSigned-off-by: Philippe Blain <levraiphilippeblain@gmail.com>\n---\n Documentation/git-log.txt | 6 +++++-\n Documentation/gitk.txt    | 6 +++++-\n 2 files changed, 10 insertions(+), 2 deletions(-)\n\ndiff --git a/Documentation/git-log.txt b/Documentation/git-log.txt\nindex b406bc4c48..1c52bf184d 100644\n--- a/Documentation/git-log.txt\n+++ b/Documentation/git-log.txt\n@@ -77,7 +77,11 @@ produced by `--stat`, etc.\n \tnot give any pathspec limiters.  This is currently limited to\n \ta walk starting from a single revision, i.e., you may only\n \tgive zero or one positive revision arguments.\n-\tYou can specify this option more than once.\n+\tYou can specify this option more than once. Implies `--patch`.\n+\tIf ``:<funcname>'' is given, implies `--function-context`.\n+\tPatch output can be suppressed using `-s`, but other diff formats\n+\t(namely `--raw`, `--numstat`, `--shortstat`, `--dirstat`, `--summary`,\n+\t`--name-only`, `--name-status`, `--check`) are not currently implemented.\n +\n include::line-range-format.txt[]\n \ndiff --git a/Documentation/gitk.txt b/Documentation/gitk.txt\nindex 1eabb0aaf3..91993b9d4c 100644\n--- a/Documentation/gitk.txt\n+++ b/Documentation/gitk.txt\n@@ -106,7 +106,11 @@ linkgit:git-rev-list[1] for a complete list.\n \tnot give any pathspec limiters.  This is currently limited to\n \ta walk starting from a single revision, i.e., you may only\n \tgive zero or one positive revision arguments.\n-\tYou can specify this option more than once.\n+\tYou can specify this option more than once. Implies `--patch`.\n+\tIf ``:<funcname>'' is given, implies `--function-context`.\n+\tPatch output can be suppressed using `-s`, but other diff formats\n+\t(namely `--raw`, `--numstat`, `--shortstat`, `--dirstat`, `--summary`,\n+\t`--name-only`, `--name-status`, `--check`) are not currently implemented.\n +\n *Note:* gitk (unlike linkgit:git-log[1]) currently only understands\n this option if you specify it \"glued together\" with its argument.  Do\n-- \ngitgitgadget\n\n"},{"id":"388326","messageId":"4ea4eeae0c1e23221012855168bf6640be93fd4f.1576559263.git.gitgitgadget@gmail.com","threadId":"52470","inReplyTo":"pull.494.git.1576559263.gitgitgadget@gmail.com","subject":"[PATCH 2/2] Documentation/git-log: mention that line-log regex must match in starting revision","fromName":"Philippe Blain via GitGitGadget","fromEmail":"gitgitgadget@gmail.com","sentAt":"2019-12-17T05:07:43Z","receivedAt":"2019-12-17T05:07:51Z","isPatch":true,"sender":{"key":"levraiphilippeblain@gmail.com","avatar":"https://avatars.githubusercontent.com/u/44212482?v=4"},"body":"From: Philippe Blain <levraiphilippeblain@gmail.com>\n\nWhen giving a regex as parameter <start> or <end> in\n`git log -L <start>,<end>:<file>`, or a function name in\n`git log -L :<funcname>:<file>`, the given regex must match in the starting\nrevision, or else the command exits with a fatal error.\n\nThis is not obvious in the documentation, so add a note to that\neffect.\n\nSigned-off-by: Philippe Blain <levraiphilippeblain@gmail.com>\n---\n Documentation/git-log.txt | 3 ++-\n 1 file changed, 2 insertions(+), 1 deletion(-)\n\ndiff --git a/Documentation/git-log.txt b/Documentation/git-log.txt\nindex 1c52bf184d..5c3fd39048 100644\n--- a/Documentation/git-log.txt\n+++ b/Documentation/git-log.txt\n@@ -76,7 +76,8 @@ produced by `--stat`, etc.\n \t(or the function name regex <funcname>) within the <file>.  You may\n \tnot give any pathspec limiters.  This is currently limited to\n \ta walk starting from a single revision, i.e., you may only\n-\tgive zero or one positive revision arguments.\n+\tgive zero or one positive revision arguments, and any given regex for\n+\t<start> or <end> (or <funcname>) must match in the starting revision.\n \tYou can specify this option more than once. Implies `--patch`.\n \tIf ``:<funcname>'' is given, implies `--function-context`.\n \tPatch output can be suppressed using `-s`, but other diff formats\n-- \ngitgitgadget\n"},{"id":"388354","messageId":"20191217113301.GA8609@szeder.dev","threadId":"52470","inReplyTo":"0ed04a8629a64d15062e13c1f1739b01436a897b.1576559263.git.gitgitgadget@gmail.com","subject":"Re: [PATCH 1/2] Documentation/git-log: document accepted line-log diff formats","fromName":"SZEDER Gábor","fromEmail":"szeder.dev@gmail.com","sentAt":"2019-12-17T11:33:01Z","receivedAt":"2019-12-17T11:33:10Z","isPatch":true,"sender":{"key":"szeder.dev@gmail.com","avatar":"https://avatars.githubusercontent.com/u/116324?v=4"},"body":"On Tue, Dec 17, 2019 at 05:07:42AM +0000, Philippe Blain via GitGitGadget wrote:\n> From: Philippe Blain <levraiphilippeblain@gmail.com>\n> \n> Currently the line-log functionality (git log -L) only supports\n> displaying patch output (`-p`, its default behavior) and suppressing it\n> (`-s`). A check was added in the code to that effect in 5314efaea (line-log:\n> detect unsupported formats, 2019-03-10) but the documentation was not\n> updated.\n> \n> Explicitly mention that `-L` implies `-p`, that patch output can be\n> suppressed using `-s`, and that all other diff formats are not allowed.\n> \n> Additionnally, mention that the ':<funcname>' form implies `--function-context`.\n> \n> Signed-off-by: Philippe Blain <levraiphilippeblain@gmail.com>\n> ---\n>  Documentation/git-log.txt | 6 +++++-\n>  Documentation/gitk.txt    | 6 +++++-\n>  2 files changed, 10 insertions(+), 2 deletions(-)\n> \n> diff --git a/Documentation/git-log.txt b/Documentation/git-log.txt\n> index b406bc4c48..1c52bf184d 100644\n> --- a/Documentation/git-log.txt\n> +++ b/Documentation/git-log.txt\n> @@ -77,7 +77,11 @@ produced by `--stat`, etc.\n>  \tnot give any pathspec limiters.  This is currently limited to\n>  \ta walk starting from a single revision, i.e., you may only\n>  \tgive zero or one positive revision arguments.\n> -\tYou can specify this option more than once.\n> +\tYou can specify this option more than once. Implies `--patch`.\n> +\tIf ``:<funcname>'' is given, implies `--function-context`.\n\n':<funcname>' doesn't imply '--function-context', but defines a line\nrange starting at the function-name-looking line that first matches\n\"funcname\" and ending just before the next function-name-looking line,\nand line-log will then show that line range as context for each\ncommit.  Although in many cases it shows diffs that look like as if\n'--function-context' were given, there are corner cases where they\nclearly differ, e.g. when following the history of a function that was\nat one point combined with the function directly below it.\n\nNote the two commits in the middle that show two functions although\nonly one of them was actually modified in each of those commits:\n\n  $ git log --oneline -L:func:file.c\n  04b0c16 Combine funcA() and funcB() into func()\n  \n  diff --git a/file.c b/file.c\n  --- a/file.c\n  +++ b/file.c\n  @@ -1,9 +1,4 @@\n  -int funcA()\n  +int func()\n   {\n  -\treturn A;\n  -}\n  -\n  -int funcB()\n  -{\n  -\treturn B;\n  +\treturn A + B;\n   }\n  ed0d4d9 Modify funcB()\n  \n  diff --git a/file.c b/file.c\n  --- a/file.c\n  +++ b/file.c\n  @@ -1,9 +1,9 @@\n   int funcA()\n   {\n   \treturn A;\n   }\n   \n   int funcB()\n   {\n  -\treturn b;\n  +\treturn B;\n   }\n  0d4e9b5 Modify funcA()\n  \n  diff --git a/file.c b/file.c\n  --- a/file.c\n  +++ b/file.c\n  @@ -1,9 +1,9 @@\n   int funcA()\n   {\n  -\treturn a;\n  +\treturn A;\n   }\n   \n   int funcB()\n   {\n   \treturn b;\n   }\n  c3f8a44 Add funcA() and funcB()\n  \n  diff --git a/file.c b/file.c\n  --- /dev/null\n  +++ b/file.c\n  @@ -0,0 +1,9 @@\n  +int funcA()\n  +{\n  +\treturn a;\n  +}\n  +\n  +int funcB()\n  +{\n  +\treturn b;\n  +}\n\nNow compare that to the same two middle commits shown with '-p\n--function-context', which doesn't show the unmodified function:\n\n  $ git log --oneline -p --function-context file.c\n  04b0c16 Combine funcA() and funcB() into func()\n  diff --git a/file.c b/file.c\n  index 89571b3..33301ea 100644\n  --- a/file.c\n  +++ b/file.c\n  @@ -1,9 +1,4 @@\n  -int funcA()\n  +int func()\n   {\n  -\treturn A;\n  -}\n  -\n  -int funcB()\n  -{\n  -\treturn B;\n  +\treturn A + B;\n   }\n  ed0d4d9 Modify funcB()\n  diff --git a/file.c b/file.c\n  index 13592c8..89571b3 100644\n  --- a/file.c\n  +++ b/file.c\n  @@ -5,5 +5,5 @@ int funcA()\n   \n   int funcB()\n   {\n  -\treturn b;\n  +\treturn B;\n   }\n  0d4e9b5 Modify funcA()\n  diff --git a/file.c b/file.c\n  index 11e1e87..13592c8 100644\n  --- a/file.c\n  +++ b/file.c\n  @@ -1,6 +1,6 @@\n   int funcA()\n   {\n  -\treturn a;\n  +\treturn A;\n   }\n   \n   int funcB()\n  c3f8a44 Add funcA() and funcB()\n  diff --git a/file.c b/file.c\n  new file mode 100644\n  index 0000000..11e1e87\n  --- /dev/null\n  +++ b/file.c\n  @@ -0,0 +1,9 @@\n  +int funcA()\n  +{\n  +\treturn a;\n  +}\n  +\n  +int funcB()\n  +{\n  +\treturn b;\n  +}\n\n"},{"id":"388375","messageId":"ba68e03a-18ff-0fb4-e64a-002b6d6c4d4a@gmail.com","threadId":"52470","inReplyTo":"0ed04a8629a64d15062e13c1f1739b01436a897b.1576559263.git.gitgitgadget@gmail.com","subject":"Re: [PATCH 1/2] Documentation/git-log: document accepted line-log diff formats","fromName":"Derrick Stolee","fromEmail":"stolee@gmail.com","sentAt":"2019-12-17T15:33:46Z","receivedAt":"2019-12-17T15:33:50Z","isPatch":true,"sender":{"key":"stolee@gmail.com","avatar":"https://avatars.githubusercontent.com/u/570044?v=4"},"body":"On 12/17/2019 12:07 AM, Philippe Blain via GitGitGadget wrote:\n> From: Philippe Blain <levraiphilippeblain@gmail.com>\n> \n> Currently the line-log functionality (git log -L) only supports\n> displaying patch output (`-p`, its default behavior) and suppressing it\n> (`-s`). A check was added in the code to that effect in 5314efaea (line-log:\n> detect unsupported formats, 2019-03-10) but the documentation was not\n> updated.\n> \n> Explicitly mention that `-L` implies `-p`, that patch output can be\n> suppressed using `-s`, and that all other diff formats are not allowed.\n> \n> Additionnally, mention that the ':<funcname>' form implies `--function-context`.\n\ns/Additionnally/Additionally/\n\n> Signed-off-by: Philippe Blain <levraiphilippeblain@gmail.com>\n> ---\n>  Documentation/git-log.txt | 6 +++++-\n>  Documentation/gitk.txt    | 6 +++++-\n>  2 files changed, 10 insertions(+), 2 deletions(-)\n> \n> diff --git a/Documentation/git-log.txt b/Documentation/git-log.txt\n> index b406bc4c48..1c52bf184d 100644\n> --- a/Documentation/git-log.txt\n> +++ b/Documentation/git-log.txt\n> @@ -77,7 +77,11 @@ produced by `--stat`, etc.\n>  \tnot give any pathspec limiters.  This is currently limited to\n>  \ta walk starting from a single revision, i.e., you may only\n>  \tgive zero or one positive revision arguments.\n> -\tYou can specify this option more than once.\n> +\tYou can specify this option more than once. Implies `--patch`.\n> +\tIf ``:<funcname>'' is given, implies `--function-context`.\n> +\tPatch output can be suppressed using `-s`, but other diff formats\n\nI would prefer the longer \"--no-patch\" over \"-s\", especially because you\nfollow with several options in this style.\n\n> +\t(namely `--raw`, `--numstat`, `--shortstat`, `--dirstat`, `--summary`,\n> +\t`--name-only`, `--name-status`, `--check`) are not currently implemented.\n>  +\n>  include::line-range-format.txt[]\n>  \n> diff --git a/Documentation/gitk.txt b/Documentation/gitk.txt\n> index 1eabb0aaf3..91993b9d4c 100644\n> --- a/Documentation/gitk.txt\n> +++ b/Documentation/gitk.txt\n> @@ -106,7 +106,11 @@ linkgit:git-rev-list[1] for a complete list.\n>  \tnot give any pathspec limiters.  This is currently limited to\n>  \ta walk starting from a single revision, i.e., you may only\n>  \tgive zero or one positive revision arguments.\n> -\tYou can specify this option more than once.\n> +\tYou can specify this option more than once. Implies `--patch`.\n> +\tIf ``:<funcname>'' is given, implies `--function-context`.\n> +\tPatch output can be suppressed using `-s`, but other diff formats\n\n(same)\n\n> +\t(namely `--raw`, `--numstat`, `--shortstat`, `--dirstat`, `--summary`,\n> +\t`--name-only`, `--name-status`, `--check`) are not currently implemented.\n\nThanks,\n-Stolee\n\n"},{"id":"388376","messageId":"1d033204-80fd-25f8-3a80-0cb641953139@gmail.com","threadId":"52470","inReplyTo":"4ea4eeae0c1e23221012855168bf6640be93fd4f.1576559263.git.gitgitgadget@gmail.com","subject":"Re: [PATCH 2/2] Documentation/git-log: mention that line-log regex must match in starting revision","fromName":"Derrick Stolee","fromEmail":"stolee@gmail.com","sentAt":"2019-12-17T15:34:43Z","receivedAt":"2019-12-17T15:34:47Z","isPatch":true,"sender":{"key":"stolee@gmail.com","avatar":"https://avatars.githubusercontent.com/u/570044?v=4"},"body":"On 12/17/2019 12:07 AM, Philippe Blain via GitGitGadget wrote:\n> From: Philippe Blain <levraiphilippeblain@gmail.com>\n> \n> When giving a regex as parameter <start> or <end> in\n> `git log -L <start>,<end>:<file>`, or a function name in\n> `git log -L :<funcname>:<file>`, the given regex must match in the starting\n> revision, or else the command exits with a fatal error.\n> \n> This is not obvious in the documentation, so add a note to that\n> effect.\n\nThis seems helpful. Thanks.\n\n-Stolee\n"},{"id":"388382","messageId":"xmqq5zieizrb.fsf@gitster-ct.c.googlers.com","threadId":"52470","inReplyTo":"1d033204-80fd-25f8-3a80-0cb641953139@gmail.com","subject":"Re: [PATCH 2/2] Documentation/git-log: mention that line-log regex must match in starting revision","fromName":"Junio C Hamano","fromEmail":"gitster@pobox.com","sentAt":"2019-12-17T18:16:24Z","receivedAt":"2019-12-17T18:16:32Z","isPatch":true,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"Derrick Stolee <stolee@gmail.com> writes:\n\n> On 12/17/2019 12:07 AM, Philippe Blain via GitGitGadget wrote:\n>> From: Philippe Blain <levraiphilippeblain@gmail.com>\n>> \n>> When giving a regex as parameter <start> or <end> in\n>> `git log -L <start>,<end>:<file>`, or a function name in\n>> `git log -L :<funcname>:<file>`, the given regex must match in the starting\n>> revision, or else the command exits with a fatal error.\n>> \n>> This is not obvious in the documentation, so add a note to that\n>> effect.\n>\n> This seems helpful. Thanks.\n\nEven when you specify <start> or <end> as a line number, they must\nexist in the starting revision or it would be a fatal error.  If we\nare clarifying with this patch for completeness, I think we should\nalso mention it together.  \n\nOr we could even drop the mention of regex and say <start> and\n<end>, regardless of how they are specified (including :<funcname>\nformat), must exist in the starting revision.\n\n\n"},{"id":"388415","messageId":"E3047E9B-B269-4DC3-A894-BB39C7A20E77@gmail.com","threadId":"52470","inReplyTo":"20191217113301.GA8609@szeder.dev","subject":"Re: [PATCH 1/2] Documentation/git-log: document accepted line-log diff formats","fromName":"Philippe Blain","fromEmail":"levraiphilippeblain@gmail.com","sentAt":"2019-12-18T02:44:01Z","receivedAt":"2019-12-18T02:44:06Z","isPatch":true,"sender":{"key":"levraiphilippeblain@gmail.com","avatar":"https://avatars.githubusercontent.com/u/44212482?v=4"},"body":"That’s a good point. I did not think of such corner cases. I will remove that mention then.\n\n> Le 17 déc. 2019 à 06:33, SZEDER Gábor <szeder.dev@gmail.com> a écrit :\n> \n> On Tue, Dec 17, 2019 at 05:07:42AM +0000, Philippe Blain via GitGitGadget wrote:\n>> From: Philippe Blain <levraiphilippeblain@gmail.com>\n>> \n>> Currently the line-log functionality (git log -L) only supports\n>> displaying patch output (`-p`, its default behavior) and suppressing it\n>> (`-s`). A check was added in the code to that effect in 5314efaea (line-log:\n>> detect unsupported formats, 2019-03-10) but the documentation was not\n>> updated.\n>> \n>> Explicitly mention that `-L` implies `-p`, that patch output can be\n>> suppressed using `-s`, and that all other diff formats are not allowed.\n>> \n>> Additionnally, mention that the ':<funcname>' form implies `--function-context`.\n>> \n>> Signed-off-by: Philippe Blain <levraiphilippeblain@gmail.com>\n>> ---\n>> Documentation/git-log.txt | 6 +++++-\n>> Documentation/gitk.txt    | 6 +++++-\n>> 2 files changed, 10 insertions(+), 2 deletions(-)\n>> \n>> diff --git a/Documentation/git-log.txt b/Documentation/git-log.txt\n>> index b406bc4c48..1c52bf184d 100644\n>> --- a/Documentation/git-log.txt\n>> +++ b/Documentation/git-log.txt\n>> @@ -77,7 +77,11 @@ produced by `--stat`, etc.\n>> \tnot give any pathspec limiters.  This is currently limited to\n>> \ta walk starting from a single revision, i.e., you may only\n>> \tgive zero or one positive revision arguments.\n>> -\tYou can specify this option more than once.\n>> +\tYou can specify this option more than once. Implies `--patch`.\n>> +\tIf ``:<funcname>'' is given, implies `--function-context`.\n> \n> ':<funcname>' doesn't imply '--function-context', but defines a line\n> range starting at the function-name-looking line that first matches\n> \"funcname\" and ending just before the next function-name-looking line,\n> and line-log will then show that line range as context for each\n> commit.  Although in many cases it shows diffs that look like as if\n> '--function-context' were given, there are corner cases where they\n> clearly differ, e.g. when following the history of a function that was\n> at one point combined with the function directly below it.\n> \n> Note the two commits in the middle that show two functions although\n> only one of them was actually modified in each of those commits:\n> \n>  $ git log --oneline -L:func:file.c\n>  04b0c16 Combine funcA() and funcB() into func()\n> \n>  diff --git a/file.c b/file.c\n>  --- a/file.c\n>  +++ b/file.c\n>  @@ -1,9 +1,4 @@\n>  -int funcA()\n>  +int func()\n>   {\n>  -\treturn A;\n>  -}\n>  -\n>  -int funcB()\n>  -{\n>  -\treturn B;\n>  +\treturn A + B;\n>   }\n>  ed0d4d9 Modify funcB()\n> \n>  diff --git a/file.c b/file.c\n>  --- a/file.c\n>  +++ b/file.c\n>  @@ -1,9 +1,9 @@\n>   int funcA()\n>   {\n>   \treturn A;\n>   }\n> \n>   int funcB()\n>   {\n>  -\treturn b;\n>  +\treturn B;\n>   }\n>  0d4e9b5 Modify funcA()\n> \n>  diff --git a/file.c b/file.c\n>  --- a/file.c\n>  +++ b/file.c\n>  @@ -1,9 +1,9 @@\n>   int funcA()\n>   {\n>  -\treturn a;\n>  +\treturn A;\n>   }\n> \n>   int funcB()\n>   {\n>   \treturn b;\n>   }\n>  c3f8a44 Add funcA() and funcB()\n> \n>  diff --git a/file.c b/file.c\n>  --- /dev/null\n>  +++ b/file.c\n>  @@ -0,0 +1,9 @@\n>  +int funcA()\n>  +{\n>  +\treturn a;\n>  +}\n>  +\n>  +int funcB()\n>  +{\n>  +\treturn b;\n>  +}\n> \n> Now compare that to the same two middle commits shown with '-p\n> --function-context', which doesn't show the unmodified function:\n> \n>  $ git log --oneline -p --function-context file.c\n>  04b0c16 Combine funcA() and funcB() into func()\n>  diff --git a/file.c b/file.c\n>  index 89571b3..33301ea 100644\n>  --- a/file.c\n>  +++ b/file.c\n>  @@ -1,9 +1,4 @@\n>  -int funcA()\n>  +int func()\n>   {\n>  -\treturn A;\n>  -}\n>  -\n>  -int funcB()\n>  -{\n>  -\treturn B;\n>  +\treturn A + B;\n>   }\n>  ed0d4d9 Modify funcB()\n>  diff --git a/file.c b/file.c\n>  index 13592c8..89571b3 100644\n>  --- a/file.c\n>  +++ b/file.c\n>  @@ -5,5 +5,5 @@ int funcA()\n> \n>   int funcB()\n>   {\n>  -\treturn b;\n>  +\treturn B;\n>   }\n>  0d4e9b5 Modify funcA()\n>  diff --git a/file.c b/file.c\n>  index 11e1e87..13592c8 100644\n>  --- a/file.c\n>  +++ b/file.c\n>  @@ -1,6 +1,6 @@\n>   int funcA()\n>   {\n>  -\treturn a;\n>  +\treturn A;\n>   }\n> \n>   int funcB()\n>  c3f8a44 Add funcA() and funcB()\n>  diff --git a/file.c b/file.c\n>  new file mode 100644\n>  index 0000000..11e1e87\n>  --- /dev/null\n>  +++ b/file.c\n>  @@ -0,0 +1,9 @@\n>  +int funcA()\n>  +{\n>  +\treturn a;\n>  +}\n>  +\n>  +int funcB()\n>  +{\n>  +\treturn b;\n>  +}\n\n"},{"id":"388416","messageId":"0F535392-AB61-42C7-8E18-12661A51BF9F@gmail.com","threadId":"52470","inReplyTo":"ba68e03a-18ff-0fb4-e64a-002b6d6c4d4a@gmail.com","subject":"Re: [PATCH 1/2] Documentation/git-log: document accepted line-log diff formats","fromName":"Philippe Blain","fromEmail":"levraiphilippeblain@gmail.com","sentAt":"2019-12-18T02:47:44Z","receivedAt":"2019-12-18T02:47:49Z","isPatch":true,"sender":{"key":"levraiphilippeblain@gmail.com","avatar":"https://avatars.githubusercontent.com/u/44212482?v=4"},"body":"\n> Le 17 déc. 2019 à 10:33, Derrick Stolee <stolee@gmail.com> a écrit :\n> \n> I would prefer the longer \"--no-patch\" over \"-s\", especially because you\n> follow with several options in this style.\n\nThat’s a good idea. Thanks for the review!"},{"id":"388418","messageId":"147443E8-EA04-45D2-B3BC-D879A5FFECDC@gmail.com","threadId":"52470","inReplyTo":"xmqq5zieizrb.fsf@gitster-ct.c.googlers.com","subject":"Re: [PATCH 2/2] Documentation/git-log: mention that line-log regex must match in starting revision","fromName":"Philippe Blain","fromEmail":"levraiphilippeblain@gmail.com","sentAt":"2019-12-18T03:28:37Z","receivedAt":"2019-12-18T03:28:41Z","isPatch":true,"sender":{"key":"levraiphilippeblain@gmail.com","avatar":"https://avatars.githubusercontent.com/u/44212482?v=4"},"body":"\n> Le 17 déc. 2019 à 13:16, Junio C Hamano <gitster@pobox.com> a écrit :\n> Even when you specify <start> or <end> as a line number, they must\n> exist in the starting revision or it would be a fatal error.  If we\n> are clarifying with this patch for completeness, I think we should\n> also mention it together.  \nThanks for the feedback. I did some tests : \n    git log -L 73,2000000085:Documentation/git-log.txt\ndoes not error and shows the history from line 73 to the end of the file.\n    git log -L 300,2000000085:Documentation/git-log.txt \nerrors out:\n    fatal: file Documentation/git-log.txt has only 239 lines\nBut \n    git log -L 300,-2000000085:Documentation/git-log.txt\ndoes not error out and shows the history for the whole file. Also,\n    git log -L 1,-2000000085:Documentation/git-log.txt\ndoes not error out and gives the history for the first line.\n\nSo I think that it’s really only regex that must match..."},{"id":"388420","messageId":"d8e753ec-2835-331f-99de-35a4a5369b48@gmail.com","threadId":"52470","inReplyTo":"147443E8-EA04-45D2-B3BC-D879A5FFECDC@gmail.com","subject":"Re: [PATCH 2/2] Documentation/git-log: mention that line-log regex must match in starting revision","fromName":"Derrick Stolee","fromEmail":"stolee@gmail.com","sentAt":"2019-12-18T10:55:25Z","receivedAt":"2019-12-18T10:55:31Z","isPatch":true,"sender":{"key":"stolee@gmail.com","avatar":"https://avatars.githubusercontent.com/u/570044?v=4"},"body":"On 12/17/2019 10:28 PM, Philippe Blain wrote:\n> \n>> Le 17 déc. 2019 à 13:16, Junio C Hamano <gitster@pobox.com> a écrit :\n>> Even when you specify <start> or <end> as a line number, they must\n>> exist in the starting revision or it would be a fatal error.  If we\n>> are clarifying with this patch for completeness, I think we should\n>> also mention it together.  \n...\n>     git log -L 300,2000000085:Documentation/git-log.txt \n> errors out:\n>     fatal: file Documentation/git-log.txt has only 239 lines\n\nThis case seems important enough to include what it means to \"match\".\n\nSpecifically, the range must match at least one line in the file.\n\n> But \n>     git log -L 300,-2000000085:Documentation/git-log.txt\n> does not error out and shows the history for the whole file. Also,\n>     git log -L 1,-2000000085:Documentation/git-log.txt\n> does not error out and gives the history for the first line.\n\nNegative numbers in the ranges are a bit strange to include, and the\nlarge magnitude you include here seems unnecessary for the test.\nHowever, it appears that we do store signed values in the line-log\nmachinery:\n\n/* A range [start,end].  Lines are numbered starting at 0, and the\n * ranges include start but exclude end. */\nstruct range {\n\tlong start, end;\n};\n\nPerhaps these should be replaced with an unsigned value instead,\njust to be clear that negative values do not make sense in this\ncontext?\n\nOr rather, do we want to enforce start < end if they are to be\nvaluable? We apparently do assert() this in\nrange_set_check_invariants() for all that does.\n\nThe current behavior of showing only the first line\nis a strange byproduct of allowing these odd ranges, but we may\nwant to keep it for consistency. That would imply we allow\nstart <= end, and auto-correct these negative values to have\nend = start. (This does not fix the 300,-1 case, but that\nis strange enough to be considered a bug, right?)\n\nThanks,\n-Stolee\n\n"},{"id":"388421","messageId":"20191218110929.GB8609@szeder.dev","threadId":"52470","inReplyTo":"147443E8-EA04-45D2-B3BC-D879A5FFECDC@gmail.com","subject":"Re: [PATCH 2/2] Documentation/git-log: mention that line-log regex must match in starting revision","fromName":"SZEDER Gábor","fromEmail":"szeder.dev@gmail.com","sentAt":"2019-12-18T11:09:29Z","receivedAt":"2019-12-18T11:09:36Z","isPatch":true,"sender":{"key":"szeder.dev@gmail.com","avatar":"https://avatars.githubusercontent.com/u/116324?v=4"},"body":"On Tue, Dec 17, 2019 at 10:28:37PM -0500, Philippe Blain wrote:\n> \n> > Le 17 déc. 2019 à 13:16, Junio C Hamano <gitster@pobox.com> a écrit :\n> > Even when you specify <start> or <end> as a line number, they must\n> > exist in the starting revision or it would be a fatal error.  If we\n> > are clarifying with this patch for completeness, I think we should\n> > also mention it together.  \n> Thanks for the feedback. I did some tests : \n\nI'll swap the order of your first two tests:\n\n>     git log -L 300,2000000085:Documentation/git-log.txt \n> errors out:\n>     fatal: file Documentation/git-log.txt has only 239 lines\n\nHere the entire line range is outside of the file, so there is not\nmuch we can do about it, but error out.\n\nAn alternative would be to treat it as an empty line range and then\ndon't show any commits but exit silently, but I think that would be\nconfusing (\"why didn't I get any output?!\"), and telling the user\nwhat's wrong is better (\"Ah, ok, I mistyped 192 as 912\").\n\n>     git log -L 73,2000000085:Documentation/git-log.txt\n> does not error and shows the history from line 73 to the end of the file.\n\nHere there is an overlap between the given line range and the file\n(lines 73-239), so we have two possibilities:\n\n  - be strict and error out saying that the <end> doesn't make sense.\n\n  - be lax about it, and interpret the <end> as the end of file.  This\n    allows for cases like \"I want line log from here to the end of\n    file, but instead of finding out the exact number of lines in the\n    file I'll just say 999999 that is surely larger than the file, and\n    you shall do what I mean\".\n\nThose who implemented the line-log feature chose the latter.  I think\nit's the better choice.\n\n> But \n>     git log -L 300,-2000000085:Documentation/git-log.txt\n> does not error out and shows the history for the whole file. Also,\n>     git log -L 1,-2000000085:Documentation/git-log.txt\n> does not error out and gives the history for the first line.\n\nThese are a variant of the previous case, with the difference that\nbecause of the '-' in <end> it is not an absolute line number but\nrelative, and is interpreted as that many lines before <start> (i.e.\nin this case <start> actually means the end of the line range).\n\nI think the same argument can be made about <end> pointing past the\nbeginning of the file, though, arguably, it's not as useful, because\nthe first line as always 1, and '-L 123,-99999' is more keystrokes\nthan '-L 1,123'.\n\n> So I think that it’s really only regex that must match...\n"},{"id":"388437","messageId":"20191218114954.GC8609@szeder.dev","threadId":"52470","inReplyTo":"d8e753ec-2835-331f-99de-35a4a5369b48@gmail.com","subject":"Re: [PATCH 2/2] Documentation/git-log: mention that line-log regex must match in starting revision","fromName":"SZEDER Gábor","fromEmail":"szeder.dev@gmail.com","sentAt":"2019-12-18T11:49:55Z","receivedAt":"2019-12-18T11:50:02Z","isPatch":true,"sender":{"key":"szeder.dev@gmail.com","avatar":"https://avatars.githubusercontent.com/u/116324?v=4"},"body":"On Wed, Dec 18, 2019 at 05:55:25AM -0500, Derrick Stolee wrote:\n> On 12/17/2019 10:28 PM, Philippe Blain wrote:\n> > \n> >> Le 17 déc. 2019 à 13:16, Junio C Hamano <gitster@pobox.com> a écrit :\n> >> Even when you specify <start> or <end> as a line number, they must\n> >> exist in the starting revision or it would be a fatal error.  If we\n> >> are clarifying with this patch for completeness, I think we should\n> >> also mention it together.  \n> ...\n> >     git log -L 300,2000000085:Documentation/git-log.txt \n> > errors out:\n> >     fatal: file Documentation/git-log.txt has only 239 lines\n> \n> This case seems important enough to include what it means to \"match\".\n> \n> Specifically, the range must match at least one line in the file.\n> \n> > But \n> >     git log -L 300,-2000000085:Documentation/git-log.txt\n> > does not error out and shows the history for the whole file. Also,\n> >     git log -L 1,-2000000085:Documentation/git-log.txt\n> > does not error out and gives the history for the first line.\n> \n> Negative numbers in the ranges are a bit strange to include, and the\n> large magnitude you include here seems unnecessary for the test.\n> However, it appears that we do store signed values in the line-log\n> machinery:\n> \n> /* A range [start,end].  Lines are numbered starting at 0, and the\n>  * ranges include start but exclude end. */\n> struct range {\n> \tlong start, end;\n> };\n> \n> Perhaps these should be replaced with an unsigned value instead,\n> just to be clear that negative values do not make sense in this\n> context?\n> \n> Or rather, do we want to enforce start < end if they are to be\n> valuable? We apparently do assert() this in\n> range_set_check_invariants() for all that does.\n\nWe have different contexts for start,end here: the '-L <start>,<end>'\nspecified on the command line and the 'start' and 'end' fields of the\ninternal 'struct range' are not the same and different constraints\napply to them.\n\n'-L X,+Y' and '-L X,-Y' are explicitly allowed, and mean that Y is\ninterpreted relative to X, the former meaning Y lines starting at X,\nwhile the latter meaning Y lines ending at X.  These are interpreted\nwhile parsing the '-L ...' options, during which we do pass around\nnegative values in (signed) long parameters, see\nline-range.c:parse_loc().  (though, arguably, having unsigned types\nand a separate flag parameter might make the code more clear)\n\nThe purpose of range_set_check_invariants() is different: as the\nfile's content changes over its history the internal line ranges must\nbe adjusted (grown, shrunk, shifted around or sometimes even merged)\naccordingly, and this function makes sure that the resulting 'struct\nrange' instances after these adjustments still make sense, because the\nrest of the line log machinery expects sorted and non-overlapping line\nranges.\n\n\n> The current behavior of showing only the first line\n> is a strange byproduct of allowing these odd ranges, but we may\n> want to keep it for consistency. That would imply we allow\n> start <= end, and auto-correct these negative values to have\n> end = start. (This does not fix the 300,-1 case, but that\n> is strange enough to be considered a bug, right?)\n> \n> Thanks,\n> -Stolee\n> \n"},{"id":"388446","messageId":"xmqqwoatecq0.fsf@gitster-ct.c.googlers.com","threadId":"52470","inReplyTo":"d8e753ec-2835-331f-99de-35a4a5369b48@gmail.com","subject":"Re: [PATCH 2/2] Documentation/git-log: mention that line-log regex must match in starting revision","fromName":"Junio C Hamano","fromEmail":"gitster@pobox.com","sentAt":"2019-12-18T17:59:51Z","receivedAt":"2019-12-18T17:59:57Z","isPatch":true,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"Derrick Stolee <stolee@gmail.com> writes:\n\n> On 12/17/2019 10:28 PM, Philippe Blain wrote:\n>> \n>>> Le 17 déc. 2019 à 13:16, Junio C Hamano <gitster@pobox.com> a écrit :\n>>> Even when you specify <start> or <end> as a line number, they must\n>>> exist in the starting revision or it would be a fatal error.  If we\n>>> are clarifying with this patch for completeness, I think we should\n>>> also mention it together.  \n> ...\n>>     git log -L 300,2000000085:Documentation/git-log.txt \n>> errors out:\n>>     fatal: file Documentation/git-log.txt has only 239 lines\n>\n> This case seems important enough to include what it means to \"match\".\n\nYup, that is why I suggested not to focus too much on regexp and\n\"match\"-ing, but express it in terms of the lines that are specified\nby given arguments to \"exist\".  The word \"match\" gives an incorrect\nconnotation that the description in the paragraph that uses the verb\napplies only to regexp.\n\n\n\n"},{"id":"388928","messageId":"pull.494.v2.git.1577382217.gitgitgadget@gmail.com","threadId":"52470","inReplyTo":"pull.494.git.1576559263.gitgitgadget@gmail.com","subject":"[PATCH v2 0/2] Improve line log documentation","fromName":"Philippe Blain via GitGitGadget","fromEmail":"gitgitgadget@gmail.com","sentAt":"2019-12-26T17:43:35Z","receivedAt":"2019-12-26T17:43:42Z","isPatch":true,"sender":{"key":"levraiphilippeblain@gmail.com","avatar":"https://avatars.githubusercontent.com/u/44212482?v=4"},"body":"These two patches add more information to the documentation for line history\n(git log -L) : \n\n * Mention explicitly that only the --patch and --no-patch diff formats are\n   supported \n * Mention that parameters <start>, <end> and <funcname> must exist in the\n   starting revision\n\nRegarding point 2 : I stumbled upon this while reading the history of\n'filter_refs' in fetch-pack.c. I did\n\n    git log -s -L :filter_refs:fetch-pack.c\n\nwhich shows a list of commits starting with 745f7a8cac (fetch-pack: move\ncore code to libgit.a, 2012-10-26). So then I did\n\n    git log  -s -L :filter_refs:fetch-pack.c -L :filter_refs:builtin/fetch-pack.c\n\nwhich fails with\n\n    fatal: -L parameter 'filter_refs' starting at line 1: no match\n\nChanges since v1:\n\n * Shorten the commit titles\n * Use long options names for --patch and --no-patch\n * Remove inexact mention of --function-context\n * Reword the clarification regarding <start>, <end> and <funcname> so that\n   it doesn't apply only to regex parameters\n * Also add this clarification to Documentation/gitk.txt since it applies\n   there as well\n\nPhilippe Blain (2):\n  doc: log, gitk: document accepted line-log diff formats\n  doc: log, gitk: line-log arguments must exist in starting revision\n\n Documentation/git-log.txt | 8 ++++++--\n Documentation/gitk.txt    | 8 ++++++--\n 2 files changed, 12 insertions(+), 4 deletions(-)\n\n\nbase-commit: ad05a3d8e5a6a06443836b5e40434262d992889a\nPublished-As: https://github.com/gitgitgadget/git/releases/tag/pr-494%2Fphil-blain%2Fline-log-doc-v2\nFetch-It-Via: git fetch https://github.com/gitgitgadget/git pr-494/phil-blain/line-log-doc-v2\nPull-Request: https://github.com/gitgitgadget/git/pull/494\n\nRange-diff vs v1:\n\n 1:  0ed04a8629 ! 1:  e68ef0ced3 Documentation/git-log: document accepted line-log diff formats\n     @@ -1,18 +1,16 @@\n      Author: Philippe Blain <levraiphilippeblain@gmail.com>\n      \n     -    Documentation/git-log: document accepted line-log diff formats\n     +    doc: log, gitk: document accepted line-log diff formats\n      \n          Currently the line-log functionality (git log -L) only supports\n     -    displaying patch output (`-p`, its default behavior) and suppressing it\n     -    (`-s`). A check was added in the code to that effect in 5314efaea (line-log:\n     -    detect unsupported formats, 2019-03-10) but the documentation was not\n     +    displaying patch output (`-p | --patch`, its default behavior) and suppressing it\n     +    (`-s | --no-patch`). A check was added in the code to that effect in 5314efaea\n     +    (line-log: detect unsupported formats, 2019-03-10) but the documentation was not\n          updated.\n      \n          Explicitly mention that `-L` implies `-p`, that patch output can be\n          suppressed using `-s`, and that all other diff formats are not allowed.\n      \n     -    Additionnally, mention that the ':<funcname>' form implies `--function-context`.\n     -\n          Signed-off-by: Philippe Blain <levraiphilippeblain@gmail.com>\n      \n       diff --git a/Documentation/git-log.txt b/Documentation/git-log.txt\n     @@ -24,8 +22,7 @@\n       \tgive zero or one positive revision arguments.\n      -\tYou can specify this option more than once.\n      +\tYou can specify this option more than once. Implies `--patch`.\n     -+\tIf ``:<funcname>'' is given, implies `--function-context`.\n     -+\tPatch output can be suppressed using `-s`, but other diff formats\n     ++\tPatch output can be suppressed using `--no-patch`, but other diff formats\n      +\t(namely `--raw`, `--numstat`, `--shortstat`, `--dirstat`, `--summary`,\n      +\t`--name-only`, `--name-status`, `--check`) are not currently implemented.\n       +\n     @@ -41,8 +38,7 @@\n       \tgive zero or one positive revision arguments.\n      -\tYou can specify this option more than once.\n      +\tYou can specify this option more than once. Implies `--patch`.\n     -+\tIf ``:<funcname>'' is given, implies `--function-context`.\n     -+\tPatch output can be suppressed using `-s`, but other diff formats\n     ++\tPatch output can be suppressed using `--no-patch`, but other diff formats\n      +\t(namely `--raw`, `--numstat`, `--shortstat`, `--dirstat`, `--summary`,\n      +\t`--name-only`, `--name-status`, `--check`) are not currently implemented.\n       +\n 2:  4ea4eeae0c ! 2:  c7d489794c Documentation/git-log: mention that line-log regex must match in starting revision\n     @@ -1,10 +1,10 @@\n      Author: Philippe Blain <levraiphilippeblain@gmail.com>\n      \n     -    Documentation/git-log: mention that line-log regex must match in starting revision\n     +    doc: log, gitk: line-log arguments must exist in starting revision\n      \n     -    When giving a regex as parameter <start> or <end> in\n     -    `git log -L <start>,<end>:<file>`, or a function name in\n     -    `git log -L :<funcname>:<file>`, the given regex must match in the starting\n     +    The line number, regex or offset parameters <start> and <end> in\n     +    `git log -L <start>,<end>:<file>`, or the function name regex in\n     +    `git log -L :<funcname>:<file>` must exist in the starting\n          revision, or else the command exits with a fatal error.\n      \n          This is not obvious in the documentation, so add a note to that\n     @@ -20,8 +20,22 @@\n       \tnot give any pathspec limiters.  This is currently limited to\n       \ta walk starting from a single revision, i.e., you may only\n      -\tgive zero or one positive revision arguments.\n     -+\tgive zero or one positive revision arguments, and any given regex for\n     -+\t<start> or <end> (or <funcname>) must match in the starting revision.\n     ++\tgive zero or one positive revision arguments, and\n     ++\t<start> and <end> (or <funcname>) must exist in the starting revision.\n       \tYou can specify this option more than once. Implies `--patch`.\n     - \tIf ``:<funcname>'' is given, implies `--function-context`.\n     - \tPatch output can be suppressed using `-s`, but other diff formats\n     + \tPatch output can be suppressed using `--no-patch`, but other diff formats\n     + \t(namely `--raw`, `--numstat`, `--shortstat`, `--dirstat`, `--summary`,\n     +\n     + diff --git a/Documentation/gitk.txt b/Documentation/gitk.txt\n     + --- a/Documentation/gitk.txt\n     + +++ b/Documentation/gitk.txt\n     +@@\n     + \t(or the function name regex <funcname>) within the <file>.  You may\n     + \tnot give any pathspec limiters.  This is currently limited to\n     + \ta walk starting from a single revision, i.e., you may only\n     +-\tgive zero or one positive revision arguments.\n     ++\tgive zero or one positive revision arguments, and\n     ++\t<start> and <end> (or <funcname>) must exist in the starting revision.\n     + \tYou can specify this option more than once. Implies `--patch`.\n     + \tPatch output can be suppressed using `--no-patch`, but other diff formats\n     + \t(namely `--raw`, `--numstat`, `--shortstat`, `--dirstat`, `--summary`,\n\n-- \ngitgitgadget\n"},{"id":"388929","messageId":"e68ef0ced3b6ec34009f725a7ac762e6df4fa868.1577382217.git.gitgitgadget@gmail.com","threadId":"52470","inReplyTo":"pull.494.v2.git.1577382217.gitgitgadget@gmail.com","subject":"[PATCH v2 1/2] doc: log, gitk: document accepted line-log diff formats","fromName":"Philippe Blain via GitGitGadget","fromEmail":"gitgitgadget@gmail.com","sentAt":"2019-12-26T17:43:36Z","receivedAt":"2019-12-26T17:43:42Z","isPatch":true,"sender":{"key":"levraiphilippeblain@gmail.com","avatar":"https://avatars.githubusercontent.com/u/44212482?v=4"},"body":"From: Philippe Blain <levraiphilippeblain@gmail.com>\n\nCurrently the line-log functionality (git log -L) only supports\ndisplaying patch output (`-p | --patch`, its default behavior) and suppressing it\n(`-s | --no-patch`). A check was added in the code to that effect in 5314efaea\n(line-log: detect unsupported formats, 2019-03-10) but the documentation was not\nupdated.\n\nExplicitly mention that `-L` implies `-p`, that patch output can be\nsuppressed using `-s`, and that all other diff formats are not allowed.\n\nSigned-off-by: Philippe Blain <levraiphilippeblain@gmail.com>\n---\n Documentation/git-log.txt | 5 ++++-\n Documentation/gitk.txt    | 5 ++++-\n 2 files changed, 8 insertions(+), 2 deletions(-)\n\ndiff --git a/Documentation/git-log.txt b/Documentation/git-log.txt\nindex b406bc4c48..6574c0d91f 100644\n--- a/Documentation/git-log.txt\n+++ b/Documentation/git-log.txt\n@@ -77,7 +77,10 @@ produced by `--stat`, etc.\n \tnot give any pathspec limiters.  This is currently limited to\n \ta walk starting from a single revision, i.e., you may only\n \tgive zero or one positive revision arguments.\n-\tYou can specify this option more than once.\n+\tYou can specify this option more than once. Implies `--patch`.\n+\tPatch output can be suppressed using `--no-patch`, but other diff formats\n+\t(namely `--raw`, `--numstat`, `--shortstat`, `--dirstat`, `--summary`,\n+\t`--name-only`, `--name-status`, `--check`) are not currently implemented.\n +\n include::line-range-format.txt[]\n \ndiff --git a/Documentation/gitk.txt b/Documentation/gitk.txt\nindex 1eabb0aaf3..c487af5b74 100644\n--- a/Documentation/gitk.txt\n+++ b/Documentation/gitk.txt\n@@ -106,7 +106,10 @@ linkgit:git-rev-list[1] for a complete list.\n \tnot give any pathspec limiters.  This is currently limited to\n \ta walk starting from a single revision, i.e., you may only\n \tgive zero or one positive revision arguments.\n-\tYou can specify this option more than once.\n+\tYou can specify this option more than once. Implies `--patch`.\n+\tPatch output can be suppressed using `--no-patch`, but other diff formats\n+\t(namely `--raw`, `--numstat`, `--shortstat`, `--dirstat`, `--summary`,\n+\t`--name-only`, `--name-status`, `--check`) are not currently implemented.\n +\n *Note:* gitk (unlike linkgit:git-log[1]) currently only understands\n this option if you specify it \"glued together\" with its argument.  Do\n-- \ngitgitgadget\n\n"},{"id":"388930","messageId":"c7d489794caa8f76e8d3cc4ec95b76279333dff1.1577382217.git.gitgitgadget@gmail.com","threadId":"52470","inReplyTo":"pull.494.v2.git.1577382217.gitgitgadget@gmail.com","subject":"[PATCH v2 2/2] doc: log, gitk: line-log arguments must exist in starting revision","fromName":"Philippe Blain via GitGitGadget","fromEmail":"gitgitgadget@gmail.com","sentAt":"2019-12-26T17:43:37Z","receivedAt":"2019-12-26T17:43:43Z","isPatch":true,"sender":{"key":"levraiphilippeblain@gmail.com","avatar":"https://avatars.githubusercontent.com/u/44212482?v=4"},"body":"From: Philippe Blain <levraiphilippeblain@gmail.com>\n\nThe line number, regex or offset parameters <start> and <end> in\n`git log -L <start>,<end>:<file>`, or the function name regex in\n`git log -L :<funcname>:<file>` must exist in the starting\nrevision, or else the command exits with a fatal error.\n\nThis is not obvious in the documentation, so add a note to that\neffect.\n\nSigned-off-by: Philippe Blain <levraiphilippeblain@gmail.com>\n---\n Documentation/git-log.txt | 3 ++-\n Documentation/gitk.txt    | 3 ++-\n 2 files changed, 4 insertions(+), 2 deletions(-)\n\ndiff --git a/Documentation/git-log.txt b/Documentation/git-log.txt\nindex 6574c0d91f..bed09bb09e 100644\n--- a/Documentation/git-log.txt\n+++ b/Documentation/git-log.txt\n@@ -76,7 +76,8 @@ produced by `--stat`, etc.\n \t(or the function name regex <funcname>) within the <file>.  You may\n \tnot give any pathspec limiters.  This is currently limited to\n \ta walk starting from a single revision, i.e., you may only\n-\tgive zero or one positive revision arguments.\n+\tgive zero or one positive revision arguments, and\n+\t<start> and <end> (or <funcname>) must exist in the starting revision.\n \tYou can specify this option more than once. Implies `--patch`.\n \tPatch output can be suppressed using `--no-patch`, but other diff formats\n \t(namely `--raw`, `--numstat`, `--shortstat`, `--dirstat`, `--summary`,\ndiff --git a/Documentation/gitk.txt b/Documentation/gitk.txt\nindex c487af5b74..c653ebb6a8 100644\n--- a/Documentation/gitk.txt\n+++ b/Documentation/gitk.txt\n@@ -105,7 +105,8 @@ linkgit:git-rev-list[1] for a complete list.\n \t(or the function name regex <funcname>) within the <file>.  You may\n \tnot give any pathspec limiters.  This is currently limited to\n \ta walk starting from a single revision, i.e., you may only\n-\tgive zero or one positive revision arguments.\n+\tgive zero or one positive revision arguments, and\n+\t<start> and <end> (or <funcname>) must exist in the starting revision.\n \tYou can specify this option more than once. Implies `--patch`.\n \tPatch output can be suppressed using `--no-patch`, but other diff formats\n \t(namely `--raw`, `--numstat`, `--shortstat`, `--dirstat`, `--summary`,\n-- \ngitgitgadget\n"},{"id":"388931","messageId":"85985FB4-A32A-477E-BA95-53EBB5034621@gmail.com","threadId":"52470","inReplyTo":"xmqqwoatecq0.fsf@gitster-ct.c.googlers.com","subject":"Re: [PATCH 2/2] Documentation/git-log: mention that line-log regex must match in starting revision","fromName":"Philippe Blain","fromEmail":"levraiphilippeblain@gmail.com","sentAt":"2019-12-26T17:46:50Z","receivedAt":"2019-12-26T17:46:57Z","isPatch":true,"sender":{"key":"levraiphilippeblain@gmail.com","avatar":"https://avatars.githubusercontent.com/u/44212482?v=4"},"body":"\n> Le 18 déc. 2019 à 12:59, Junio C Hamano <gitster@pobox.com> a écrit :\n> ...\n> Yup, that is why I suggested not to focus too much on regexp and\n> \"match\"-ing, but express it in terms of the lines that are specified\n> by given arguments to \"exist\".  The word \"match\" gives an incorrect\n> connotation that the description in the paragraph that uses the verb\n> applies only to regexp.\n\nI agree. Thanks for the suggestion. I changed it to « exist » in v2."}]}