git/list[1] front-page[2] threads[3] people[4] search[5] about
 

Re: [PATCH v2 6/7] Documentation: put blame/log -L in sticked form

From
Junio C Hamano <gitster@pobox.com>
Date
Oct 30, 2013, 01:11 UTC
Message-ID
<xmqqvc0fd0la.fsf@gitster.dls.corp.google.com>
In-Reply-To
<c41aef218951f8b0ec6a20e1dbc39712ad13afce.1383031141.git.tr@thomasrast.ch>
Thomas Rast <tr@thomasrast.ch> writes:
> The next patch will document gitk -L, but gitk does not understand the
> separated form ('gitk -L :foo:bar' results in an error).  Spell
> git-blame and git-log -L, which are supposed to be "the same" option,
> without the spaces to prevent confusion.

I agree that this patch may reduce confusion locally, but if we were to go in this direction, we should be consistent and enforce "stuck" form everywhere, not just the options you happened to have passed thru to gitk, but other options such as "-S <revs-file>", and also other commands that do not have anything to do with gitk (e.g. "git commit -C<commit>", not "git commit -C <commit>". Otherwise you will give a wrong impression to readers as if they have to remember which ones need to use the stuck form and which ones do not.

Show 82 quoted lines
> Signed-off-by: Thomas Rast <tr@thomasrast.ch>
> ---
>  Documentation/blame-options.txt | 8 ++++----
>  Documentation/git-blame.txt     | 8 ++++----
>  Documentation/git-log.txt       | 6 +++---
>  3 files changed, 11 insertions(+), 11 deletions(-)
>
> diff --git a/Documentation/blame-options.txt b/Documentation/blame-options.txt
> index 0cebc4f..28ca95e 100644
> --- a/Documentation/blame-options.txt
> +++ b/Documentation/blame-options.txt
> @@ -9,13 +9,13 @@
>  --show-stats::
>  	Include additional statistics at the end of blame output.
>  
> --L <start>,<end>::
> --L :<regex>::
> +-L<start>,<end>::
> +-L:<regex>::
>  	Annotate only the given line range. May be specified multiple times.
>  	Overlapping ranges are allowed.
>  +
> -<start> and <end> are optional. ``-L <start>'' or ``-L <start>,'' spans from
> -<start> to end of file. ``-L ,<end>'' spans from start of file to <end>.
> +<start> and <end> are optional. ``-L<start>'' or ``-L<start>,'' spans from
> +<start> to end of file. ``-L,<end>'' spans from start of file to <end>.
>  +
>  include::line-range-format.txt[]
>  
> diff --git a/Documentation/git-blame.txt b/Documentation/git-blame.txt
> index f2c85cc..085dba1 100644
> --- a/Documentation/git-blame.txt
> +++ b/Documentation/git-blame.txt
> @@ -9,7 +9,7 @@ SYNOPSIS
>  --------
>  [verse]
>  'git blame' [-c] [-b] [-l] [--root] [-t] [-f] [-n] [-s] [-e] [-p] [-w] [--incremental]
> -	    [-L <range>] [-S <revs-file>] [-M] [-C] [-C] [-C] [--since=<date>]
> +	    [-L<range>] [-S <revs-file>] [-M] [-C] [-C] [-C] [--since=<date>]
>  	    [--abbrev=<n>] [<rev> | --contents <file> | --reverse <rev>] [--] <file>
>  
>  DESCRIPTION
> @@ -139,12 +139,12 @@ lines 40-60 for file `foo`, you can use the `-L` option like so
>  (they mean the same thing -- both ask for 21 lines starting at
>  line 40):
>  
> -	git blame -L 40,60 foo
> -	git blame -L 40,+21 foo
> +	git blame -L40,60 foo
> +	git blame -L40,+21 foo
>  
>  Also you can use a regular expression to specify the line range:
>  
> -	git blame -L '/^sub hello {/,/^}$/' foo
> +	git blame -L'/^sub hello {/,/^}$/' foo
>  
>  which limits the annotation to the body of the `hello` subroutine.
>  
> diff --git a/Documentation/git-log.txt b/Documentation/git-log.txt
> index 34097ef..87c10fa 100644
> --- a/Documentation/git-log.txt
> +++ b/Documentation/git-log.txt
> @@ -62,8 +62,8 @@ produced by --stat etc.
>  	Note that only message is considered, if also a diff is shown
>  	its size is not included.
>  
> --L <start>,<end>:<file>::
> --L :<regex>:<file>::
> +-L<start>,<end>:<file>::
> +-L:<regex>:<file>::
>  
>  	Trace the evolution of the line range given by "<start>,<end>"
>  	(or the funcname regex <regex>) within the <file>.  You may
> @@ -152,7 +152,7 @@ EXAMPLES
>  	This makes sense only when following a strict policy of merging all
>  	topic branches when staying on a single integration branch.
>  
> -`git log -L '/int main/',/^}/:main.c`::
> +`git log -L'/int main/',/^}/:main.c`::
>  
>  	Shows how the function `main()` in the file 'main.c' evolved
>  	over time.
Previous: Thomas RastNext: Thomas Rast
Message 26 of 42 in “gitk support for git log -L”
  1. 0/4 gitk support for git log -LThomas Rast, Jun 9, 2013
  2. 1/4 gitk: refactor per-line part of getblobdiffline and its supportThomas Rast, Jun 9, 2013
  3. 2/4 gitk: split out diff part in $commitinfoThomas Rast, Jun 9, 2013
  4. 3/4 gitk: support showing the gathered inline diffsThomas Rast, Jun 9, 2013
  5. 4/4 gitk: recognize -L optionThomas Rast, Jun 9, 2013
  6. Thomas RastJul 23, 2013
  7. Thomas RastJul 29, 2013
  8. Jens LehmannJul 29, 2013
  9. Thomas RastJul 31, 2013
  10. Paul MackerrasAug 18, 2013
  11. Thomas RastAug 19, 2013
  12. Junio C HamanoAug 19, 2013
  13. Thomas RastOct 13, 2013
  14. Jonathan NiederOct 14, 2013
  15. Documentation: revamp gitk(1)Thomas Rast, Oct 20, 2013
  16. 0/7 gitk -LThomas Rast, Oct 29, 2013
  17. 1/7 gitk: support -G option from the command lineThomas Rast, Oct 29, 2013
  18. Junio C HamanoOct 30, 2013
  19. Thomas RastOct 30, 2013
  20. Junio C HamanoOct 30, 2013
  21. 2/7 gitk: refactor per-line part of getblobdiffline and its supportThomas Rast, Oct 29, 2013
  22. 3/7 gitk: split out diff part in $commitinfoThomas Rast, Oct 29, 2013
  23. 4/7 gitk: support showing the gathered inline diffsThomas Rast, Oct 29, 2013
  24. 5/7 gitk: recognize -L optionThomas Rast, Oct 29, 2013
  25. 6/7 Documentation: put blame/log -L in sticked formThomas Rast, Oct 29, 2013
  26. Junio C HamanoOct 30, 2013
  27. Thomas RastOct 30, 2013
  28. Junio C HamanoOct 30, 2013
  29. Thomas RastOct 30, 2013
  30. Junio C HamanoOct 30, 2013
  31. 0/5 gitk -LThomas Rast, Nov 16, 2013
  32. 1/5 gitk: support -G option from the command lineThomas Rast, Nov 16, 2013
  33. 2/5 gitk: refactor per-line part of getblobdiffline and its supportThomas Rast, Nov 16, 2013
  34. 3/5 gitk: split out diff part in $commitinfoThomas Rast, Nov 16, 2013
  35. 4/5 gitk: support showing the gathered inline diffsThomas Rast, Nov 16, 2013
  36. 5/5 gitk: recognize -L optionThomas Rast, Nov 16, 2013
  37. Paul MackerrasDec 1, 2013
  38. 0/3 Documentation: stuck arguments and gitk log -LThomas Rast, Nov 16, 2013
  39. 1/3 commit-tree: use prefixcmp instead of memcmp(..., N)Thomas Rast, Nov 16, 2013
  40. 2/3 Documentation: convert to --option=arg form where possibleThomas Rast, Nov 16, 2013
  41. 3/3 Documentation/gitk: document -L optionThomas Rast, Nov 16, 2013
  42. 7/7 Documentation/gitk: document -L optionThomas Rast, Oct 29, 2013

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.