<feed xmlns='http://www.w3.org/2005/Atom'>
<title>git/line-range.c, branch v2.15.2</title>
<subtitle>Mirror of https://git.kernel.org/pub/scm/git/git.git/
</subtitle>
<id>https://git.shady.money/git/atom?h=v2.15.2</id>
<link rel='self' href='https://git.shady.money/git/atom?h=v2.15.2'/>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/'/>
<updated>2017-01-30T22:17:00Z</updated>
<entry>
<title>use SWAP macro</title>
<updated>2017-01-30T22:17:00Z</updated>
<author>
<name>René Scharfe</name>
<email>l.s.r@web.de</email>
</author>
<published>2017-01-28T21:40:58Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=35d803bc9a0d21c36b1381f6e42455beeb73b715'/>
<id>urn:sha1:35d803bc9a0d21c36b1381f6e42455beeb73b715</id>
<content type='text'>
Apply the semantic patch swap.cocci to convert hand-rolled swaps to use
the macro SWAP.  The resulting code is shorter and easier to read, the
object code is effectively unchanged.

The patch for object.c had to be hand-edited in order to preserve the
comment before the change; Coccinelle tried to eat it for some reason.

Signed-off-by: Rene Scharfe &lt;l.s.r@web.de&gt;
Signed-off-by: Junio C Hamano &lt;gitster@pobox.com&gt;
</content>
</entry>
<entry>
<title>line-range: reject -L line numbers less than 1</title>
<updated>2013-08-06T21:48:55Z</updated>
<author>
<name>Eric Sunshine</name>
<email>sunshine@sunshineco.com</email>
</author>
<published>2013-08-06T13:59:49Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=5ce922a014f78684a96c3d03a51decf0d21fa58d'/>
<id>urn:sha1:5ce922a014f78684a96c3d03a51decf0d21fa58d</id>
<content type='text'>
Since inception, git-blame -L has been documented as accepting 1-based
line numbers. When handed a line number less than 1, -L's behavior is
undocumented and undefined; it's also nonsensical and should be
diagnosed as an error. Do so.

Signed-off-by: Eric Sunshine &lt;sunshine@sunshineco.com&gt;
Signed-off-by: Junio C Hamano &lt;gitster@pobox.com&gt;
</content>
</entry>
<entry>
<title>line-range: teach -L^:RE to search from start of file</title>
<updated>2013-08-06T21:48:02Z</updated>
<author>
<name>Eric Sunshine</name>
<email>sunshine@sunshineco.com</email>
</author>
<published>2013-08-06T13:59:47Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=215e76c7ff8be46b8206c45aed3b6ec29069d4fc'/>
<id>urn:sha1:215e76c7ff8be46b8206c45aed3b6ec29069d4fc</id>
<content type='text'>
The -L:RE option of blame/log searches from the end of the previous -L
range, if any. Add new notation -L^:RE to override this behavior and
search from start of file.

Signed-off-by: Eric Sunshine &lt;sunshine@sunshineco.com&gt;
Signed-off-by: Junio C Hamano &lt;gitster@pobox.com&gt;
</content>
</entry>
<entry>
<title>line-range: teach -L:RE to search from end of previous -L range</title>
<updated>2013-08-06T21:47:34Z</updated>
<author>
<name>Eric Sunshine</name>
<email>sunshine@sunshineco.com</email>
</author>
<published>2013-08-06T13:59:46Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=1ce761a524e34f2d629759cb57c67d13acbe4a7a'/>
<id>urn:sha1:1ce761a524e34f2d629759cb57c67d13acbe4a7a</id>
<content type='text'>
For consistency with -L/RE/, teach -L:RE to search relative to the end
of the previous -L range, if any.

The new behavior invalidates one test in t4211 which assumes that -L:RE
begins searching at start of file. This test will be resurrected in a
follow-up patch which teaches -L:RE how to override the default relative
search behavior.

Signed-off-by: Eric Sunshine &lt;sunshine@sunshineco.com&gt;
Signed-off-by: Junio C Hamano &lt;gitster@pobox.com&gt;
</content>
</entry>
<entry>
<title>line-range: teach -L^/RE/ to search from start of file</title>
<updated>2013-08-06T21:47:04Z</updated>
<author>
<name>Eric Sunshine</name>
<email>sunshine@sunshineco.com</email>
</author>
<published>2013-08-06T13:59:45Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=a6ac5f9864958f65269d8d58a049324403b039fd'/>
<id>urn:sha1:a6ac5f9864958f65269d8d58a049324403b039fd</id>
<content type='text'>
The -L/RE/ option of blame/log searches from the end of the previous -L
range, if any. Add new notation -L^/RE/ to override this behavior and
search from start of file.

The new ^/RE/ syntax is valid only as the &lt;start&gt; argument of
-L&lt;start&gt;,&lt;end&gt;. The &lt;end&gt; argument, as usual, is relative to &lt;start&gt;.

Signed-off-by: Eric Sunshine &lt;sunshine@sunshineco.com&gt;
Signed-off-by: Junio C Hamano &lt;gitster@pobox.com&gt;
</content>
</entry>
<entry>
<title>line-range: teach -L/RE/ to search relative to anchor point</title>
<updated>2013-08-06T21:36:34Z</updated>
<author>
<name>Eric Sunshine</name>
<email>sunshine@sunshineco.com</email>
</author>
<published>2013-08-06T13:59:41Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=815834e9aa6148b7815b9aea7db5d44640a4383a'/>
<id>urn:sha1:815834e9aa6148b7815b9aea7db5d44640a4383a</id>
<content type='text'>
Range specification -L/RE/ for blame/log unconditionally begins
searching at line one. Mailing list discussion [1] suggests that, in the
presence of multiple -L options, -L/RE/ should search relative to the
endpoint of the previous -L range, if any.

Teach the parsing machinery underlying blame's and log's -L options to
accept a start point for -L/RE/ searches. Follow-up patches will upgrade
blame and log to take advantage of this ability.

[1]: http://thread.gmane.org/gmane.comp.version-control.git/229755/focus=229966

Signed-off-by: Eric Sunshine &lt;sunshine@sunshineco.com&gt;
Signed-off-by: Junio C Hamano &lt;gitster@pobox.com&gt;
</content>
</entry>
<entry>
<title>blame: reject empty ranges -L,+0 and -L,-0</title>
<updated>2013-08-05T18:54:32Z</updated>
<author>
<name>Eric Sunshine</name>
<email>sunshine@sunshineco.com</email>
</author>
<published>2013-07-31T08:15:45Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=5d57cac6ae7c661d430dcc7dd2e44c994bf797be'/>
<id>urn:sha1:5d57cac6ae7c661d430dcc7dd2e44c994bf797be</id>
<content type='text'>
Empty ranges -L,+0 and -L,-0 are nonsensical in the context of blame yet
they are accepted (in fact, both are interpreted as -L1,Y where Y is
end-of-file). Report them as invalid.

Signed-off-by: Eric Sunshine &lt;sunshine@sunshineco.com&gt;
Signed-off-by: Junio C Hamano &lt;gitster@pobox.com&gt;
</content>
</entry>
<entry>
<title>blame: reject empty ranges -LX,+0 and -LX,-0</title>
<updated>2013-08-05T18:54:32Z</updated>
<author>
<name>Eric Sunshine</name>
<email>sunshine@sunshineco.com</email>
</author>
<published>2013-07-31T08:15:43Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=abba35395f859600cca1c04f1eab633963a8646e'/>
<id>urn:sha1:abba35395f859600cca1c04f1eab633963a8646e</id>
<content type='text'>
Empty ranges -LX,+0 and -LX,-0 are nonsensical in the context of blame
yet they are accepted (in fact, both are interpreted as -LX,+2).  Report
them as invalid.

Signed-off-by: Eric Sunshine &lt;sunshine@sunshineco.com&gt;
Signed-off-by: Junio C Hamano &lt;gitster@pobox.com&gt;
</content>
</entry>
<entry>
<title>line-range: fix "blame -L X,-N" regression</title>
<updated>2013-07-18T01:02:12Z</updated>
<author>
<name>Eric Sunshine</name>
<email>sunshine@sunshineco.com</email>
</author>
<published>2013-07-17T21:25:27Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=3bf65f9e62d25089ca50eb348844d21cdbb53019'/>
<id>urn:sha1:3bf65f9e62d25089ca50eb348844d21cdbb53019</id>
<content type='text'>
"blame -L X,-N" is documented as blaming "N lines ending at X".  In
practice, the behavior is achieved by swapping the two range endpoints
if the second is less than the first.  25ed3412 (Refactor parse_loc;
2013-03-28) broke this interpretation by removing the swapping code from
blame.c and failing to add it to line-range.c along with other code
relocated from blame.c. Thus, such a range is effectively treated as
empty.  Fix this regression.

Signed-off-by: Eric Sunshine &lt;sunshine@sunshineco.com&gt;
Signed-off-by: Junio C Hamano &lt;gitster@pobox.com&gt;
</content>
</entry>
<entry>
<title>log -L: :pattern:file syntax to find by funcname</title>
<updated>2013-03-28T17:30:04Z</updated>
<author>
<name>Thomas Rast</name>
<email>trast@student.ethz.ch</email>
</author>
<published>2013-03-28T16:47:33Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=13b8f68c1f0b6d4ff5a7bed5a834e7e5e34a9fd0'/>
<id>urn:sha1:13b8f68c1f0b6d4ff5a7bed5a834e7e5e34a9fd0</id>
<content type='text'>
This new syntax finds a funcname matching /pattern/, and then takes from there
up to (but not including) the next funcname.  So you can say

  git log -L:main:main.c

and it will dig up the main() function and show its line-log, provided
there are no other funcnames matching 'main'.

Signed-off-by: Thomas Rast &lt;trast@student.ethz.ch&gt;
Signed-off-by: Junio C Hamano &lt;gitster@pobox.com&gt;
</content>
</entry>
</feed>
