From: Junio C Hamano Date: Tue, 04 May 2010 17:31:11 GMT Subject: Re: [PATCH v2] blame: add a range option to -L Message-ID: <7vd3xbmv4w.fsf@alter.siamese.dyndns.org> In-Reply-To: <1272909995-3198-1-git-send-email-wfp5p@virginia.edu> Bill Pemberton writes: > In addition to , you can now use
% > to specify how many lines around
that you want to see. > For example: -L 20%5 would show lines 15 through 25 > > Signed-off-by: Bill Pemberton > --- Please retitle, as (1) -L has always been about "range", and (2) what you are adding now is a "radius" option ;-) > +-L
%:: > + This works like , with the annotated range > + centered on
and showing lines around it. I am not sure how "like ," in this sentence helps the readers. If you bring up the similarity, shouldn't you at least be saying that it is an shorthand to give " lines before
" as , and " lines after
" as , or somesuch? > diff --git a/Documentation/git-blame.txt b/Documentation/git-blame.txt > index a27f439..73f6b83 100644 > --- a/Documentation/git-blame.txt > +++ b/Documentation/git-blame.txt > @@ -110,6 +110,14 @@ line 40): > git blame -L 40,60 foo > git blame -L 40,+21 foo > > +A range of lines around a particular line can be shown by using '%' > +instead of ','. If you wanted to see line 20 along with the 5 > +lines around it: > + > + git blame -L 20%5 foo > + > + > + Why this many blank lines around the example? I see this at the beginning of parse_loc() in builtin/blame.c: /* Allow "-L ,+20" to mean starting at * for 20 lines, or "-L ,-5" for 5 lines ending at * . */ which means that it is not "-L ," to begin with. I wonder if it makes the interface more consistent to rewrite the above comment like this: /* * Allow "-L ,+20" to mean starting at * for 20 lines; "-L ,-5" for 5 lines ending at * ; and "-L ,+-5" for 5 lines around * . */ and the match the code.