<feed xmlns='http://www.w3.org/2005/Atom'>
<title>git/git-compat-util.h, branch v2.40.2</title>
<subtitle>Mirror of https://git.kernel.org/pub/scm/git/git.git/
</subtitle>
<id>https://git.shady.money/git/atom?h=v2.40.2</id>
<link rel='self' href='https://git.shady.money/git/atom?h=v2.40.2'/>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/'/>
<updated>2023-01-23T21:39:51Z</updated>
<entry>
<title>Merge branch 'rs/use-enhanced-bre-on-macos'</title>
<updated>2023-01-23T21:39:51Z</updated>
<author>
<name>Junio C Hamano</name>
<email>gitster@pobox.com</email>
</author>
<published>2023-01-23T21:39:51Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=5427bb4893e29a9502bbee5aed84c3b26e1a4e15'/>
<id>urn:sha1:5427bb4893e29a9502bbee5aed84c3b26e1a4e15</id>
<content type='text'>
Newer regex library macOS stopped enabling GNU-like enhanced BRE,
where '\(A\|B\)' works as alternation, unless explicitly asked with
the REG_ENHANCED flag.  "git grep" now can be compiled to do so, to
retain the old behaviour.

* rs/use-enhanced-bre-on-macos:
  use enhanced basic regular expressions on macOS
</content>
</entry>
<entry>
<title>Merge branch 'rs/dup-array'</title>
<updated>2023-01-22T01:21:58Z</updated>
<author>
<name>Junio C Hamano</name>
<email>gitster@pobox.com</email>
</author>
<published>2023-01-22T01:21:58Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=60ce816cb637f8fac5e8e5b8a53dff8707b2c04c'/>
<id>urn:sha1:60ce816cb637f8fac5e8e5b8a53dff8707b2c04c</id>
<content type='text'>
Code cleaning.

* rs/dup-array:
  use DUP_ARRAY
  add DUP_ARRAY
  do full type check in BARF_UNLESS_COPYABLE
  factor out BARF_UNLESS_COPYABLE
  mingw: make argv2 in try_shell_exec() non-const
</content>
</entry>
<entry>
<title>Sync with 2.39.1</title>
<updated>2023-01-16T20:11:58Z</updated>
<author>
<name>Junio C Hamano</name>
<email>gitster@pobox.com</email>
</author>
<published>2023-01-16T20:11:58Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=508386c6c5857b4faa2c3e491f422c98cc69ae76'/>
<id>urn:sha1:508386c6c5857b4faa2c3e491f422c98cc69ae76</id>
<content type='text'>
</content>
</entry>
<entry>
<title>add DUP_ARRAY</title>
<updated>2023-01-09T04:28:36Z</updated>
<author>
<name>René Scharfe</name>
<email>l.s.r@web.de</email>
</author>
<published>2023-01-01T21:14:12Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=d2ec87a684e2f9cd1f0c653620a00d74ad5ee2ce'/>
<id>urn:sha1:d2ec87a684e2f9cd1f0c653620a00d74ad5ee2ce</id>
<content type='text'>
Add a macro for allocating and populating a shallow copy of an array.
It is intended to replace a sequence like this:

   ALLOC_ARRAY(dst, n);
   COPY_ARRAY(dst, src, n);

With the less repetitve:

   DUP_ARRAY(dst, src, n);

It checks whether the types of source and destination are compatible to
ensure the copy can be used safely.

An easier alternative would be to only consider the source and return
a void pointer, that could be used like this:

   dst = ARRAY_DUP(src, n);

That would be more versatile, as it could be used in declarations as
well.  Making it type-safe would require the use of typeof_unqual from
C23, though.

So use the safe and compatible variant for now.

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>do full type check in BARF_UNLESS_COPYABLE</title>
<updated>2023-01-09T04:28:36Z</updated>
<author>
<name>René Scharfe</name>
<email>l.s.r@web.de</email>
</author>
<published>2023-01-01T21:11:20Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=08e8c266653a486cc441ec031136875bf579f054'/>
<id>urn:sha1:08e8c266653a486cc441ec031136875bf579f054</id>
<content type='text'>
Use __builtin_types_compatible_p to perform a full type check if
possible.  Otherwise fall back to the old size comparison, but add a
non-evaluated assignment to catch more type mismatches.  It doesn't flag
copies between arrays with different signedness, but that's as close to
a full type check as it gets without the builtin, as far as I can see.

Helped-by: Junio C Hamano &lt;gitster@pobox.com&gt;
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>factor out BARF_UNLESS_COPYABLE</title>
<updated>2023-01-09T04:28:36Z</updated>
<author>
<name>René Scharfe</name>
<email>l.s.r@web.de</email>
</author>
<published>2023-01-01T21:08:53Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=1891846fa4d439be7f9a1a32c062f62cd863df2b'/>
<id>urn:sha1:1891846fa4d439be7f9a1a32c062f62cd863df2b</id>
<content type='text'>
Move the common basic element type check of COPY_ARRAY and MOVE_ARRAY to
a new macro.  This reduces code duplication and simplifies adding more
elaborate checks.

Suggested-by: Junio C Hamano &lt;gitster@pobox.com&gt;
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>use enhanced basic regular expressions on macOS</title>
<updated>2023-01-08T01:06:34Z</updated>
<author>
<name>René Scharfe</name>
<email>l.s.r@web.de</email>
</author>
<published>2023-01-08T00:42:04Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=54463d32ef6798c772c8bbf69b2c1897a854db9f'/>
<id>urn:sha1:54463d32ef6798c772c8bbf69b2c1897a854db9f</id>
<content type='text'>
When 1819ad327b (grep: fix multibyte regex handling under macOS,
2022-08-26) started to use the native regex library instead of Git's
own (compat/regex/), it lost support for alternation in basic
regular expressions.

Bring it back by enabling the flag REG_ENHANCED on macOS when
compiling basic regular expressions.

Reported-by: Marco Nenciarini &lt;marco.nenciarini@enterprisedb.com&gt;
Suggested-by: Jeff King &lt;peff@peff.net&gt;
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>Merge branch 'jk/avoid-redef-system-functions-2.30'</title>
<updated>2022-12-19T02:46:16Z</updated>
<author>
<name>Junio C Hamano</name>
<email>gitster@pobox.com</email>
</author>
<published>2022-12-19T02:46:16Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=efcc48efa7337cdd7e60ba19ad0e07766e5e8cd3'/>
<id>urn:sha1:efcc48efa7337cdd7e60ba19ad0e07766e5e8cd3</id>
<content type='text'>
Redefining system functions for a few functions did not follow our
usual "implement git_foo() and #define foo(args) git_foo(args)"
pattern, which has broken build for some folks.

* jk/avoid-redef-system-functions-2.30:
  git-compat-util: undefine system names before redeclaring them
  git-compat-util: avoid redefining system function names
</content>
</entry>
<entry>
<title>Sync with 2.38.3</title>
<updated>2022-12-13T12:25:15Z</updated>
<author>
<name>Junio C Hamano</name>
<email>gitster@pobox.com</email>
</author>
<published>2022-12-13T12:25:15Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=96738bb0e1e4bff68cf39ed288330d76afdbc425'/>
<id>urn:sha1:96738bb0e1e4bff68cf39ed288330d76afdbc425</id>
<content type='text'>
</content>
</entry>
<entry>
<title>Sync with Git 2.37.5</title>
<updated>2022-12-13T12:23:36Z</updated>
<author>
<name>Junio C Hamano</name>
<email>gitster@pobox.com</email>
</author>
<published>2022-12-13T12:23:36Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=fea9f607a88dc43e479c7c9105663f28b8a0deb9'/>
<id>urn:sha1:fea9f607a88dc43e479c7c9105663f28b8a0deb9</id>
<content type='text'>
</content>
</entry>
</feed>
