<feed xmlns='http://www.w3.org/2005/Atom'>
<title>git/line-range.c, branch jch</title>
<subtitle>Mirror of https://git.kernel.org/pub/scm/git/git.git/
</subtitle>
<id>https://git.shady.money/git/atom?h=jch</id>
<link rel='self' href='https://git.shady.money/git/atom?h=jch'/>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/'/>
<updated>2024-06-11T20:15:08Z</updated>
<entry>
<title>line-range: plug leaking find functions</title>
<updated>2024-06-11T20:15:08Z</updated>
<author>
<name>Patrick Steinhardt</name>
<email>ps@pks.im</email>
</author>
<published>2024-06-11T09:21:15Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=4b4f5a911c4d2fedf4620ff079dcb2a5a0edccc7'/>
<id>urn:sha1:4b4f5a911c4d2fedf4620ff079dcb2a5a0edccc7</id>
<content type='text'>
In `parse_range_funcname()` we may end up allocating a "find function",
but never free it. Fix this.

Signed-off-by: Patrick Steinhardt &lt;ps@pks.im&gt;
Signed-off-by: Junio C Hamano &lt;gitster@pobox.com&gt;
</content>
</entry>
<entry>
<title>treewide: remove unnecessary includes in source files</title>
<updated>2023-12-26T20:04:31Z</updated>
<author>
<name>Elijah Newren</name>
<email>newren@gmail.com</email>
</author>
<published>2023-12-23T17:14:50Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=eea0e59ffbed6e33d171ace5be13cde9faa41639'/>
<id>urn:sha1:eea0e59ffbed6e33d171ace5be13cde9faa41639</id>
<content type='text'>
Each of these were checked with
   gcc -E -I. ${SOURCE_FILE} | grep ${HEADER_FILE}
to ensure that removing the direct inclusion of the header actually
resulted in that header no longer being included at all (i.e. that
no other header pulled it in transitively).

...except for a few cases where we verified that although the header
was brought in transitively, nothing from it was directly used in
that source file.  These cases were:
  * builtin/credential-cache.c
  * builtin/pull.c
  * builtin/send-pack.c

Signed-off-by: Elijah Newren &lt;newren@gmail.com&gt;
Signed-off-by: Junio C Hamano &lt;gitster@pobox.com&gt;
</content>
</entry>
<entry>
<title>line-range: fix infinite loop bug with '$' regex</title>
<updated>2022-12-20T01:00:43Z</updated>
<author>
<name>Lars Kellogg-Stedman</name>
<email>lars@oddbit.com</email>
</author>
<published>2022-12-19T22:48:50Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=4e57c88e028c25ee9428b51ff829299bbb88a80c'/>
<id>urn:sha1:4e57c88e028c25ee9428b51ff829299bbb88a80c</id>
<content type='text'>
When the -L argument to "git log" is passed the zero-width regular
expression "$" (as in "-L :$:line-range.c"), this results in an
infinite loop in find_funcname_matching_regexp().

Modify find_funcname_matching_regexp to correctly match the entire line
instead of the zero-width match at eol and update the loop condition to
prevent an infinite loop in the event of other undiscovered corner cases.

The primary change is that we pre-decrement the beginning-of-line marker
('bol') before comparing it to '\n'. In the case of '$', where we match the
'\n' at the end of the line and start the loop with bol == eol, this
ensures that bol will find the beginning of the line on which the match
occurred.

Originally reported in &lt;https://stackoverflow.com/q/74690545/147356&gt;.

Signed-off-by: Lars Kellogg-Stedman &lt;lars@oddbit.com&gt;
Signed-off-by: Junio C Hamano &lt;gitster@pobox.com&gt;
</content>
</entry>
<entry>
<title>use CALLOC_ARRAY</title>
<updated>2021-03-14T00:00:09Z</updated>
<author>
<name>René Scharfe</name>
<email>l.s.r@web.de</email>
</author>
<published>2021-03-13T16:17:22Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=ca56dadb4b65ccaeab809d80db80a312dc00941a'/>
<id>urn:sha1:ca56dadb4b65ccaeab809d80db80a312dc00941a</id>
<content type='text'>
Add and apply a semantic patch for converting code that open-codes
CALLOC_ARRAY to use it instead.  It shortens the code and infers the
element size automatically.

Signed-off-by: René 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.c: remove implicit dependency on the_index</title>
<updated>2018-09-21T16:51:18Z</updated>
<author>
<name>Nguyễn Thái Ngọc Duy</name>
<email>pclouds@gmail.com</email>
</author>
<published>2018-09-21T15:57:34Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=80e03855413c7ac3727df572d44131656e467426'/>
<id>urn:sha1:80e03855413c7ac3727df572d44131656e467426</id>
<content type='text'>
Signed-off-by: Nguyễn Thái Ngọc Duy &lt;pclouds@gmail.com&gt;
Signed-off-by: Junio C Hamano &lt;gitster@pobox.com&gt;
</content>
</entry>
<entry>
<title>userdiff.c: remove implicit dependency on the_index</title>
<updated>2018-09-21T16:50:58Z</updated>
<author>
<name>Nguyễn Thái Ngọc Duy</name>
<email>pclouds@gmail.com</email>
</author>
<published>2018-09-21T15:57:33Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=acd00ea04998ce469d1775c658134b097e18f5a3'/>
<id>urn:sha1:acd00ea04998ce469d1775c658134b097e18f5a3</id>
<content type='text'>
[jc: squashed in missing forward decl in userdiff.h found by Ramsay]

Helped-by: Ramsay Jones &lt;ramsay@ramsayjones.plus.com&gt;
Signed-off-by: Nguyễn Thái Ngọc Duy &lt;pclouds@gmail.com&gt;
Signed-off-by: Junio C Hamano &lt;gitster@pobox.com&gt;
</content>
</entry>
<entry>
<title>blame: prevent error if range ends past end of file</title>
<updated>2018-06-15T17:29:13Z</updated>
<author>
<name>Isabella Stephens</name>
<email>istephens@atlassian.com</email>
</author>
<published>2018-06-15T06:29:27Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=96cfa94e68cfbe9942e230ae18b35eaf1ca30f99'/>
<id>urn:sha1:96cfa94e68cfbe9942e230ae18b35eaf1ca30f99</id>
<content type='text'>
If the -L option is used to specify a line range in git blame, and the
end of the range is past the end of the file, git will fail with a fatal
error. This commit prevents such behavior - instead we display the blame
for existing lines within the specified range. Tests are amended
accordingly.

This commit also fixes two corner cases. Blaming -L n,-(n+1) now blames
the first n lines of a file rather than from n to the end of the file.
Blaming -L ,-n will be treated as -L 1,-n and blame the first line of
the file, rather than blaming the whole file.

Signed-off-by: Isabella Stephens &lt;istephens@atlassian.com&gt;
Signed-off-by: Junio C Hamano &lt;gitster@pobox.com&gt;
</content>
</entry>
<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>
</feed>
