<feed xmlns='http://www.w3.org/2005/Atom'>
<title>git/contrib, branch v2.47.2</title>
<subtitle>Mirror of https://git.kernel.org/pub/scm/git/git.git/
</subtitle>
<id>https://git.shady.money/git/atom?h=v2.47.2</id>
<link rel='self' href='https://git.shady.money/git/atom?h=v2.47.2'/>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/'/>
<updated>2024-10-10T20:31:12Z</updated>
<entry>
<title>contrib: fix typos</title>
<updated>2024-10-10T20:31:12Z</updated>
<author>
<name>Andrew Kreimer</name>
<email>algonell@gmail.com</email>
</author>
<published>2024-10-10T15:11:20Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=f5dedddb753e5366168052cc9cbfec760bbeb3ee'/>
<id>urn:sha1:f5dedddb753e5366168052cc9cbfec760bbeb3ee</id>
<content type='text'>
Fix typos via codespell.

Signed-off-by: Andrew Kreimer &lt;algonell@gmail.com&gt;
Signed-off-by: Junio C Hamano &lt;gitster@pobox.com&gt;
</content>
</entry>
<entry>
<title>Merge branch 'jc/cmake-unit-test-updates'</title>
<updated>2024-09-25T17:37:13Z</updated>
<author>
<name>Junio C Hamano</name>
<email>gitster@pobox.com</email>
</author>
<published>2024-09-25T17:37:13Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=cbb5b53a9c0e6bbe6f8df2dd371735ecbc710fe7'/>
<id>urn:sha1:cbb5b53a9c0e6bbe6f8df2dd371735ecbc710fe7</id>
<content type='text'>
CMake adjustments for recent changes around unit tests.

* jc/cmake-unit-test-updates:
  cmake: generalize the handling of the `UNIT_TEST_OBJS` list
  cmake: stop looking for `REFTABLE_TEST_OBJS` in the Makefile
  cmake: rename clar-related variables to avoid confusion
</content>
</entry>
<entry>
<title>Merge branch 'jk/jump-quickfix-fixes'</title>
<updated>2024-09-23T17:35:08Z</updated>
<author>
<name>Junio C Hamano</name>
<email>gitster@pobox.com</email>
</author>
<published>2024-09-23T17:35:08Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=621ac241be8d7898bf05a3f8dfac3222f7899a70'/>
<id>urn:sha1:621ac241be8d7898bf05a3f8dfac3222f7899a70</id>
<content type='text'>
A few usability fixes to "git jump" (in contrib/).

* jk/jump-quickfix-fixes:
  git-jump: ignore deleted files in diff mode
  git-jump: always specify column 1 for diff entries
</content>
</entry>
<entry>
<title>cmake: generalize the handling of the `UNIT_TEST_OBJS` list</title>
<updated>2024-09-19T01:06:05Z</updated>
<author>
<name>Johannes Schindelin</name>
<email>johannes.schindelin@gmx.de</email>
</author>
<published>2024-09-18T19:29:29Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=8afda42fce60126fe6d3bde86a44d8db63a77c08'/>
<id>urn:sha1:8afda42fce60126fe6d3bde86a44d8db63a77c08</id>
<content type='text'>
In a15d4465a991 (cmake: also build unit tests, 2023-09-25), I
accommodated the CMake definition. Seeing that a `UNIT_TEST_OBJS` list
was introduced that was built by transforming the `UNIT_TEST_PROGRAMS`
list and then adding a single, hard-coded file
("t/unit-tests/test-lib.c"), I decided to hard-code that in the CMake
definition, too.

The reason why I hard-coded it instead of imitating the
`parse_makefile_for_sources()` paradigm that was used elsewhere when
using the `Makefile` as source of truth for given lists of files: This
function expects _only_ hard-coded values, and that transformed
`UNIT_TEST_PROGRAMS` list complicated everything.

In 872721538c26 (cmake: fix build of `t-oidtree`, 2024-07-12), I
accommodated the CMake definition again, after seeing that the
`UNIT_TEST_OBJS` was still defined via that transformed list but now
appending _two_ hard-coded files ("t/unit-tests/lib-oid.c" joined the
fray).

In 428672a3b16 (Makefile: stop listing test library objects twice,
2024-09-16), the `Makefile` was changed so that `UNIT_TEST_OBJS` is
finally only constructed using hard-coded file names just like the other
`*_OBJS` variables. I missed that and therefore did not adjust the CMake
definition. Besides, the code was working, so there was no real need to
adjust it.

With a4f50bb1e9b (t/unit-tests: introduce reftable library, 2024-09-16),
however, the `UNIT_TEST_OBJS` list became a trio, and the CMake
definition has to be adjusted again. Now that we can use the
`parse_makefile_for_sources()` function without many complications,
let's do that.

Signed-off-by: Johannes Schindelin &lt;johannes.schindelin@gmx.de&gt;
Signed-off-by: Junio C Hamano &lt;gitster@pobox.com&gt;
</content>
</entry>
<entry>
<title>cmake: stop looking for `REFTABLE_TEST_OBJS` in the Makefile</title>
<updated>2024-09-19T01:06:05Z</updated>
<author>
<name>Johannes Schindelin</name>
<email>johannes.schindelin@gmx.de</email>
</author>
<published>2024-09-18T19:23:20Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=75c4d8f0448a7669447942e725cb87ce22067ff2'/>
<id>urn:sha1:75c4d8f0448a7669447942e725cb87ce22067ff2</id>
<content type='text'>
As of 15e29ea1c648 (t: move reftable/stack_test.c to the unit testing
framework, 2024-09-08), the reftable tests are no longer part of
`test-tool.exe`, so let's stop looking for those lines that are no
longer in the `Makefile`.

Signed-off-by: Johannes Schindelin &lt;johannes.schindelin@gmx.de&gt;
Signed-off-by: Junio C Hamano &lt;gitster@pobox.com&gt;
</content>
</entry>
<entry>
<title>cmake: rename clar-related variables to avoid confusion</title>
<updated>2024-09-19T01:06:05Z</updated>
<author>
<name>Johannes Schindelin</name>
<email>johannes.schindelin@gmx.de</email>
</author>
<published>2024-09-18T19:21:16Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=77c6bd9f38c96a568d851beef185aeb9930de7b4'/>
<id>urn:sha1:77c6bd9f38c96a568d851beef185aeb9930de7b4</id>
<content type='text'>
In c3de556a841f (Makefile: rename clar-related variables to avoid
confusion, 2024-09-10) some `Makefile` variables were renamed that were
partially used by the CMake definition. Adapt the latter to the new lay
of the land.

Signed-off-by: Johannes Schindelin &lt;johannes.schindelin@gmx.de&gt;
Signed-off-by: Junio C Hamano &lt;gitster@pobox.com&gt;
</content>
</entry>
<entry>
<title>Merge branch 'ps/clar-unit-test'</title>
<updated>2024-09-19T01:02:05Z</updated>
<author>
<name>Junio C Hamano</name>
<email>gitster@pobox.com</email>
</author>
<published>2024-09-19T01:02:05Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=5d55832f5cf914d583881cdb6f7b76b1793e2b16'/>
<id>urn:sha1:5d55832f5cf914d583881cdb6f7b76b1793e2b16</id>
<content type='text'>
Import clar unit tests framework libgit2 folks invented for our
use.

* ps/clar-unit-test:
  Makefile: rename clar-related variables to avoid confusion
  clar: add CMake support
  t/unit-tests: convert ctype tests to use clar
  t/unit-tests: convert strvec tests to use clar
  t/unit-tests: implement test driver
  Makefile: wire up the clar unit testing framework
  Makefile: do not use sparse on third-party sources
  Makefile: make hdr-check depend on generated headers
  Makefile: fix sparse dependency on GENERATED_H
  clar: stop including `shellapi.h` unnecessarily
  clar(win32): avoid compile error due to unused `fs_copy()`
  clar: avoid compile error with mingw-w64
  t/clar: fix compatibility with NonStop
  t: import the clar unit testing framework
  t: do not pass GIT_TEST_OPTS to unit tests with prove
</content>
</entry>
<entry>
<title>git-jump: ignore deleted files in diff mode</title>
<updated>2024-09-16T16:20:46Z</updated>
<author>
<name>Jeff King</name>
<email>peff@peff.net</email>
</author>
<published>2024-09-15T11:20:24Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=083b82544d6e5b27a4b3fa7f105ba330f490227b'/>
<id>urn:sha1:083b82544d6e5b27a4b3fa7f105ba330f490227b</id>
<content type='text'>
If you do something like this:

  rm file_a
  echo change &gt;file_b
  git jump diff

then we'll generate two quickfix entries for the diff, one for each
file. But the one for the deleted file is rather pointless. There's no
content to show since the file is gone, and in fact we open the editor
with the path /dev/null!

In vim, at least, the result is a confusing annoyance: the editor opens
with an empty buffer, and you have to skip past it to the useful
quickfix entry (after scratching your head and figuring out that no,
nothing is broken).

Let's skip such entries entirely. There's nothing useful to show, since
the point is that the file has been deleted.

It is possible that you could be doing a diff whose post-image is not
the working tree, and then you'd perhaps be jumping to the deleted
content (or at least something that was in the same spot). But I don't
think it's worth worrying about that case. For one thing, using git-jump
for such diffs is a bad idea in general, as it's going to sometimes move
you to the wrong spot. And two, a deletion is always going to have one
hunk starting at line 1, which is not that interesting to jump to in the
first place.

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>git-jump: always specify column 1 for diff entries</title>
<updated>2024-09-16T16:20:43Z</updated>
<author>
<name>Jeff King</name>
<email>peff@peff.net</email>
</author>
<published>2024-09-15T11:18:46Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=9f5978e7778843bb729baef121c92f98bd187044'/>
<id>urn:sha1:9f5978e7778843bb729baef121c92f98bd187044</id>
<content type='text'>
When we generate a quickfix entry for a diff hunk, we provide just the
filename and line number along with the content, like:

  file:1: contents of the line

This can be a problem if the line itself looks like a quickfix header.
For example (and this is adapted from a real-world case that bit me):

  echo 'static_lease 10:11:12:13:14:15:16 10.0.0.1' &gt;file
  git add file
  echo change &gt;file

produces:

  file:1: static_lease 10:11:12:13:14:15:16 10.0.0.1

which is ambiguous. It could be line 1 of "file", or line 11 of the file
"file:1: static_lease 10", and so on. In the case of vim's default
config, it seems to prefer the latter (you can configure "errorformat"
with a variety of patterns, but out of the box it matches some common
ones).

One easy way to fix this is to provide a column number, like:

  file:1:1: static_lease 10:11:12:13:14:15:16 10.0.0.1

which causes vim to prefer line 1 of "file" again (due to the preference
order of the various patterns in the default errorformat).

There are other options. For example, at least in my version of vim,
wrapping the file in quotation marks like:

  "file":1: static_lease 10:11:12:13:14:15:16 10.0.0.1

also works. That perhaps would the right thing even if you had the silly
file name "file:1:1: foo 10". But it's not clear what would happen if
you had a filename with quotes in it.

This feature is inherently scraping text, and there's bound to be some
ambiguities. I don't think it's worth worrying too much about unlikely
filenames, as its the file content that is more likely to introduce
unexpected characters.

So let's just go with the extra ":1" column specifier. We know this is
supported everywhere, as git-jump's "grep" mode already uses it (and
thus doesn't exhibit the same problem).

The "merge" mode is mostly immune to this, as it only matches "&lt;&lt;&lt;&lt;&lt;&lt;&lt;"
conflict marker lines. It's possible of course to have a marker that
says "foo 10:11" later in the line, but in practice these will only have
branches and perhaps file names, so it's probably not worth worrying
about (and fixing it would involve passing --column to the system grep,
which may not be portable).

I also gave some thought as to whether we could put something more
useful than "1" in the column field for diffs. In theory we could find
the first changed character of the line, but this is tricky in practice.
You'd have to correlate before/after lines of the hunk to decide what
changed. So:

  -this is a foo line
  +this is a bar line

is easy (column 11). But:

  -this is a foo line
  +another line
  +this is a bar line

is harder.

This commit certainly doesn't preclude trying to do something more
clever later, but it's a much deeper rabbit hole than just fixing the
syntactic ambiguity.

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>clar: add CMake support</title>
<updated>2024-09-04T15:41:38Z</updated>
<author>
<name>Johannes Schindelin</name>
<email>johannes.schindelin@gmx.de</email>
</author>
<published>2024-09-04T14:17:25Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=894deb76a02c7bc98418100ec881768da77f3b75'/>
<id>urn:sha1:894deb76a02c7bc98418100ec881768da77f3b75</id>
<content type='text'>
Now that we're using `clar` as powerful test framework, we have to
adjust the Visual C build (read: the CMake definition) to be able to
handle that, too.

Signed-off-by: Johannes Schindelin &lt;johannes.schindelin@gmx.de&gt;
Signed-off-by: Patrick Steinhardt &lt;ps@pks.im&gt;
Signed-off-by: Junio C Hamano &lt;gitster@pobox.com&gt;
</content>
</entry>
</feed>
