<feed xmlns='http://www.w3.org/2005/Atom'>
<title>git/t/annotate-tests.sh, branch v2.21.4</title>
<subtitle>Mirror of https://git.kernel.org/pub/scm/git/git.git/
</subtitle>
<id>https://git.shady.money/git/atom?h=v2.21.4</id>
<link rel='self' href='https://git.shady.money/git/atom?h=v2.21.4'/>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/'/>
<updated>2018-06-15T17:29:13Z</updated>
<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>blame: fix object casting regression</title>
<updated>2015-11-24T22:07:04Z</updated>
<author>
<name>Jeff King</name>
<email>peff@peff.net</email>
</author>
<published>2015-11-17T23:22:37Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=7cb5f7c44dfea798a5ad99ee5b42fdaf8de4e379'/>
<id>urn:sha1:7cb5f7c44dfea798a5ad99ee5b42fdaf8de4e379</id>
<content type='text'>
Commit 1b0d400 refactored the prepare_final() function so
that it could be reused in multiple places. Originally, the
loop had two outputs: a commit to stuff into sb-&gt;final, and
the name of the commit from the rev-&gt;pending array.

After the refactor, that loop is put in its own function
with a single return value: the object_array_entry from the
rev-&gt;pending array. This contains both the name and the object,
but with one important difference: the object is the
_original_ object found by the revision parser, not the
dereferenced commit. If one feeds a tag to "git blame", we
end up casting the tag object to a "struct commit", which
causes a segfault.

Instead, let's return the commit (properly casted) directly
from the function, and take the "name" as an optional
out-parameter. This does the right thing, and actually
simplifies the callers, who no longer need to cast or
dereference the object_array_entry themselves.

[test case by Max Kirillov &lt;max@max630.net&gt;]

Signed-off-by: Jeff King &lt;peff@peff.net&gt;
</content>
</entry>
<entry>
<title>blame: handle --first-parent</title>
<updated>2015-09-16T16:59:05Z</updated>
<author>
<name>Jeff King</name>
<email>peff@peff.net</email>
</author>
<published>2015-09-15T10:05:39Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=95a4fb0eac20de024fed242a7c9227af86334202'/>
<id>urn:sha1:95a4fb0eac20de024fed242a7c9227af86334202</id>
<content type='text'>
The revision.c options-parser will parse "--first-parent"
for us, but the blame code does not actually respect it, as
we simply iterate over the whole list returned by
first_scapegoat(). We can fix this by returning a
truncated parent list.

Note that we could technically also do so by limiting the
return value of num_scapegoats(), but that is less robust.
We would rely on nobody ever looking at the "next" pointer
from the returned list.

Combining "--reverse" with "--first-parent" is more
complicated, and will probably involve cooperation from
revision.c. Since the desired semantics are not even clear,
let's punt on this for now, but explicitly disallow it to
avoid confusing users (this is not really a regression,
since it did something nonsensical before).

Signed-off-by: Jeff King &lt;peff@peff.net&gt;
Signed-off-by: Junio C Hamano &lt;gitster@pobox.com&gt;
</content>
</entry>
<entry>
<title>t: fix trivial &amp;&amp;-chain breakage</title>
<updated>2015-03-20T17:20:14Z</updated>
<author>
<name>Jeff King</name>
<email>peff@peff.net</email>
</author>
<published>2015-03-20T10:07:15Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=99094a7ad484085b9f6849a8ebe1e23467c5bc14'/>
<id>urn:sha1:99094a7ad484085b9f6849a8ebe1e23467c5bc14</id>
<content type='text'>
These are tests which are missing a link in their &amp;&amp;-chain,
but during a setup phase. We may fail to notice failure in
commands that build the test environment, but these are
typically not expected to fail at all (but it's still good
to double-check that our test environment is what we
expect).

Signed-off-by: Jeff King &lt;peff@peff.net&gt;
Signed-off-by: Junio C Hamano &lt;gitster@pobox.com&gt;
</content>
</entry>
<entry>
<title>t800[12]: work around MSys limitation</title>
<updated>2014-07-21T16:39:57Z</updated>
<author>
<name>Karsten Blees</name>
<email>blees@dcon.de</email>
</author>
<published>2014-07-17T15:37:05Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=e8d08871c97cf8e932ded11ef1659d5d14e4b36a'/>
<id>urn:sha1:e8d08871c97cf8e932ded11ef1659d5d14e4b36a</id>
<content type='text'>
MSys works very hard to convert Unix-style paths into DOS-style ones.
*Very* hard.

So hard, indeed, that

	git blame -L/hello/,/green/

is translated into something like

	git blame -LC:/msysgit/hello/,C:/msysgit/green/

As seen in msys_p2w in src\msys\msys\rt\src\winsup\cygwin\path.cc, line
3204ff:

	case '-':
	  //
	  // here we check for POSIX paths as attributes to a POSIX switch.
	  //
	...

seemingly absolute POSIX paths in single-letter options get expanded by
msys.dll unless they contain '=' or ';'.

So a quick and very dirty fix is to use '-L/;*evil/'. (Using an equal sign
works only when it is before a comma, so in the above example, /=*green/
would still be converted to a DOS-style path.)

The -L mangling can be done by the script, just before the parameter is
passed to the executable.  This version does not modify the body of the
tests and is active on MinGW only.

Commit-message-by: Johannes Schindelin &lt;johannes.schindelin@gmx.de&gt;
Author: Stepan Kasal &lt;kasal@ucw.cz&gt;
Signed-off-by: Johannes Schindelin &lt;johannes.schindelin@gmx.de&gt;
Signed-off-by: Stepan Kasal &lt;kasal@ucw.cz&gt;
Signed-off-by: Junio C Hamano &lt;gitster@pobox.com&gt;
</content>
</entry>
<entry>
<title>Remove the line length limit for graft files</title>
<updated>2013-12-28T00:46:25Z</updated>
<author>
<name>Johannes Schindelin</name>
<email>Johannes.Schindelin@gmx.de</email>
</author>
<published>2013-12-27T20:49:57Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=e228c1736f25c59cd6da51ed97e03ecd80a935e6'/>
<id>urn:sha1:e228c1736f25c59cd6da51ed97e03ecd80a935e6</id>
<content type='text'>
Support for grafts predates Git's strbuf, and hence it is understandable
that there was a hard-coded line length limit of 1023 characters (which
was chosen a bit awkwardly, given that it is *exactly* one byte short of
aligning with the 41 bytes occupied by a commit name and the following
space or new-line character).

While regular commit histories hardly win comprehensibility in general
if they merge more than twenty-two branches in one go, it is not Git's
business to limit grafts in such a way.

In this particular developer's case, the use case that requires
substantially longer graft lines to be supported is the visualization of
the commits' order implied by their changes: commits are considered to
have an implicit relationship iff exchanging them in an interactive
rebase would result in merge conflicts.

Thusly implied branches tend to be very shallow in general, and the
resulting thicket of implied branches is usually very wide; It is
actually quite common that *most* of the commits in a topic branch have
not even one implied parent, so that a final merge commit has about as
many implied parents as there are commits in said branch.

[jc: squashed in tests by Jonathan]

Signed-off-by: Johannes Schindelin &lt;johannes.schindelin@gmx.de&gt;
Reviewed-by: Jonathan Nieder &lt;jrnieder@gmail.com&gt;
Signed-off-by: Junio C Hamano &lt;gitster@pobox.com&gt;
</content>
</entry>
<entry>
<title>t: replace pulls with merges</title>
<updated>2013-10-31T18:12:26Z</updated>
<author>
<name>Felipe Contreras</name>
<email>felipe.contreras@gmail.com</email>
</author>
<published>2013-10-31T09:25:33Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=501a75a7b308ed9631cd4802d891e6b56c06821a'/>
<id>urn:sha1:501a75a7b308ed9631cd4802d891e6b56c06821a</id>
<content type='text'>
This is what the code intended.

No functional changes.

Signed-off-by: Felipe Contreras &lt;felipe.contreras@gmail.com&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>t8001/t8002: blame: add tests of -L line numbers less than 1</title>
<updated>2013-08-06T21:48:29Z</updated>
<author>
<name>Eric Sunshine</name>
<email>sunshine@sunshineco.com</email>
</author>
<published>2013-08-06T13:59:48Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=9527604f7d6490fd4ce0809fe8fc8a600e03710d'/>
<id>urn:sha1:9527604f7d6490fd4ce0809fe8fc8a600e03710d</id>
<content type='text'>
git-blame -L is 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 rejected but is
nevertheless accepted. Demonstrate this shortcoming.

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>
