<feed xmlns='http://www.w3.org/2005/Atom'>
<title>git/userdiff.c, branch v2.45.3</title>
<subtitle>Mirror of https://git.kernel.org/pub/scm/git/git.git/
</subtitle>
<id>https://git.shady.money/git/atom?h=v2.45.3</id>
<link rel='self' href='https://git.shady.money/git/atom?h=v2.45.3'/>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/'/>
<updated>2024-04-05T22:21:43Z</updated>
<entry>
<title>userdiff: better method/property matching for C#</title>
<updated>2024-04-05T22:21:43Z</updated>
<author>
<name>Steven Jeuris</name>
<email>steven.jeuris@3shape.com</email>
</author>
<published>2024-04-03T21:42:44Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=ec0e3075d245afa3f3a848bd7bdc6376dea85fe0'/>
<id>urn:sha1:ec0e3075d245afa3f3a848bd7bdc6376dea85fe0</id>
<content type='text'>
- Support multi-line methods by not requiring closing parenthesis.
- Support multiple generics (comma was missing before).
- Add missing `foreach`, `lock` and  `fixed` keywords to skip over.
- Remove `instanceof` keyword, which isn't C#.
- Also detect non-method keywords not positioned at the start of a line.
- Added tests; none existed before.

The overall strategy is to focus more on what isn't expected for
method/property definitions, instead of what is, but is fully optional.

Signed-off-by: Steven Jeuris &lt;steven.jeuris@gmail.com&gt;
Acked-by: Johannes Sixt &lt;j6t@kdbg.org&gt;
Signed-off-by: Junio C Hamano &lt;gitster@pobox.com&gt;
</content>
</entry>
<entry>
<title>Merge branch 'jk/textconv-cache-outside-repo-fix'</title>
<updated>2024-03-05T17:44:42Z</updated>
<author>
<name>Junio C Hamano</name>
<email>gitster@pobox.com</email>
</author>
<published>2024-03-05T17:44:42Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=6249de53a3016e33dd32ef83620068f19a4e08af'/>
<id>urn:sha1:6249de53a3016e33dd32ef83620068f19a4e08af</id>
<content type='text'>
The code incorrectly attempted to use textconv cache when asked,
even when we are not running in a repository, which has been
corrected.

* jk/textconv-cache-outside-repo-fix:
  userdiff: skip textconv caching when not in a repository
</content>
</entry>
<entry>
<title>userdiff: skip textconv caching when not in a repository</title>
<updated>2024-02-26T17:40:55Z</updated>
<author>
<name>Jeff King</name>
<email>peff@peff.net</email>
</author>
<published>2024-02-26T10:27:29Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=affe355fe706d79ce6959277c39a7f1b1ec35f58'/>
<id>urn:sha1:affe355fe706d79ce6959277c39a7f1b1ec35f58</id>
<content type='text'>
The textconv caching system uses git-notes to store its cache entries.
But if you're using "diff --no-index" outside of a repository, then
obviously that isn't going to work.

Since caching is just an optimization, it's OK for us to skip it.
However, the current behavior is much worse: we call notes_cache_init()
which tries to look up the ref, and the low-level ref code hits a BUG(),
killing the program. Instead, we should notice before setting up the
cache that it there's no repository, and just silently skip it.

Reported-by: Paweł Dominiak &lt;dominiak.pawel@gmail.com&gt;
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>use xstrncmpz()</title>
<updated>2024-02-12T17:32:41Z</updated>
<author>
<name>René Scharfe</name>
<email>l.s.r@web.de</email>
</author>
<published>2024-02-10T07:43:01Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=f0e578c69cd91a554179c09dab6989f6eb0e2910'/>
<id>urn:sha1:f0e578c69cd91a554179c09dab6989f6eb0e2910</id>
<content type='text'>
Add and apply a semantic patch for calling xstrncmpz() to compare a
NUL-terminated string with a buffer of a known length instead of using
strncmp() and checking the terminating NUL explicitly.  This simplifies
callers by reducing code duplication.

I had to adjust remote.c manually because Coccinelle inexplicably
changed the indent of the else branches.

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>git-compat-util: move alloc macros to git-compat-util.h</title>
<updated>2023-07-05T18:42:31Z</updated>
<author>
<name>Calvin Wan</name>
<email>calvinwan@google.com</email>
</author>
<published>2023-07-05T17:09:24Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=91c080dff511b7a81f91d1cc79589b49e16a2b7a'/>
<id>urn:sha1:91c080dff511b7a81f91d1cc79589b49e16a2b7a</id>
<content type='text'>
alloc_nr, ALLOC_GROW, and ALLOC_GROW_BY are commonly used macros for
dynamic array allocation. Moving these macros to git-compat-util.h with
the other alloc macros focuses alloc.[ch] to allocation for Git objects
and additionally allows us to remove inclusions to alloc.h from files
that solely used the above macros.

Signed-off-by: Calvin Wan &lt;calvinwan@google.com&gt;
Signed-off-by: Junio C Hamano &lt;gitster@pobox.com&gt;
</content>
</entry>
<entry>
<title>attr: teach "--attr-source=&lt;tree&gt;" global option to "git"</title>
<updated>2023-05-06T21:34:09Z</updated>
<author>
<name>John Cai</name>
<email>johncai86@gmail.com</email>
</author>
<published>2023-05-06T04:15:29Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=44451a2e5eec5360378be23e2cdbd9ecee49e14e'/>
<id>urn:sha1:44451a2e5eec5360378be23e2cdbd9ecee49e14e</id>
<content type='text'>
Earlier, 47cfc9bd (attr: add flag `--source` to work with tree-ish,
2023-01-14) taught "git check-attr" the "--source=&lt;tree&gt;" option to
allow it to read attribute files from a tree-ish, but did so only
for the command.  Just like "check-attr" users wanted a way to use
attributes from a tree-ish and not from the working tree files,
users of other commands (like "git diff") would benefit from the
same.

Undo most of the UI change the commit made, while keeping the
internal logic to read attributes from a given tree-ish. Expose the
internal logic via a new "--attr-source=&lt;tree&gt;" command line option
given to "git", so that it can be used with any git command that
runs as part of the main git process.

Additionally, add an environment variable GIT_ATTR_SOURCE that is set
when --attr-source is passed in, so that subprocesses use the same value
for the attributes source tree.

Signed-off-by: John Cai &lt;johncai86@gmail.com&gt;
Signed-off-by: Junio C Hamano &lt;gitster@pobox.com&gt;
</content>
</entry>
<entry>
<title>Merge branch 'rs/userdiff-multibyte-regex'</title>
<updated>2023-04-20T21:33:35Z</updated>
<author>
<name>Junio C Hamano</name>
<email>gitster@pobox.com</email>
</author>
<published>2023-04-20T21:33:35Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=cbfe844aa1b6b0b9513f2ae2fc3d18ff3dd385e6'/>
<id>urn:sha1:cbfe844aa1b6b0b9513f2ae2fc3d18ff3dd385e6</id>
<content type='text'>
The userdiff regexp patterns for various filetypes that are built
into the system have been updated to avoid triggering regexp errors
from UTF-8 aware regex engines.

* rs/userdiff-multibyte-regex:
  userdiff: support regexec(3) with multi-byte support
</content>
</entry>
<entry>
<title>userdiff: support regexec(3) with multi-byte support</title>
<updated>2023-04-07T14:38:09Z</updated>
<author>
<name>René Scharfe</name>
<email>l.s.r@web.de</email>
</author>
<published>2023-04-06T20:19:11Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=be391449542d8a67cb343ec9d0b2f6854d665354'/>
<id>urn:sha1:be391449542d8a67cb343ec9d0b2f6854d665354</id>
<content type='text'>
Since 1819ad327b (grep: fix multibyte regex handling under macOS,
2022-08-26) we use the system library for all regular expression
matching on macOS, not just for git grep.  It supports multi-byte
strings and rejects invalid multi-byte characters.

This broke all built-in userdiff word regexes in UTF-8 locales because
they all include such invalid bytes in expressions that are intended to
match multi-byte characters without explicit support for that from the
regex engine.

"|[^[:space:]]|[\xc0-\xff][\x80-\xbf]+" is added to all built-in word
regexes to match a single non-space or multi-byte character.  The \xNN
characters are invalid if interpreted as UTF-8 because they have their
high bit set, which indicates they are part of a multi-byte character,
but they are surrounded by single-byte characters.

Replace that expression with "|[^[:space:]]" if the regex engine
supports multi-byte matching, as there is no need to have an explicit
range for multi-byte characters then.  Check for that capability at
runtime, because it depends on the locale and thus on environment
variables.  Construct the full replacement expression at build time
and just switch it in if necessary to avoid string manipulation and
allocations at runtime.

Additionally the word regex for tex contains the expression
"[a-zA-Z0-9\x80-\xff]+" with a similarly invalid range.  The best
replacement with only valid characters that I can come up with is
"([a-zA-Z0-9]|[^\x01-\x7f])+".  Unlike the original it matches NUL
characters, though.  Assuming that tex files usually don't contain NUL
this should be acceptable.

Reported-by: D. Ben Knoble &lt;ben.knoble@gmail.com&gt;
Reported-by: Eric Sunshine &lt;sunshine@sunshineco.com&gt;
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>Merge branch 'en/header-cleanup'</title>
<updated>2023-03-17T21:03:09Z</updated>
<author>
<name>Junio C Hamano</name>
<email>gitster@pobox.com</email>
</author>
<published>2023-03-17T21:03:08Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=88cc8ed8bc7d4bc9521b426e95ae2a38d3aec13a'/>
<id>urn:sha1:88cc8ed8bc7d4bc9521b426e95ae2a38d3aec13a</id>
<content type='text'>
Code clean-up to clarify the rule that "git-compat-util.h" must be
the first to be included.

* en/header-cleanup:
  diff.h: remove unnecessary include of object.h
  Remove unnecessary includes of builtin.h
  treewide: replace cache.h with more direct headers, where possible
  replace-object.h: move read_replace_refs declaration from cache.h to here
  object-store.h: move struct object_info from cache.h
  dir.h: refactor to no longer need to include cache.h
  object.h: stop depending on cache.h; make cache.h depend on object.h
  ident.h: move ident-related declarations out of cache.h
  pretty.h: move has_non_ascii() declaration from commit.h
  cache.h: remove dependence on hex.h; make other files include it explicitly
  hex.h: move some hex-related declarations from cache.h
  hash.h: move some oid-related declarations from cache.h
  alloc.h: move ALLOC_GROW() functions from cache.h
  treewide: remove unnecessary cache.h includes in source files
  treewide: remove unnecessary cache.h includes
  treewide: remove unnecessary git-compat-util.h includes in headers
  treewide: ensure one of the appropriate headers is sourced first
</content>
</entry>
<entry>
<title>Merge branch 'jc/diff-algo-attribute'</title>
<updated>2023-02-27T18:08:56Z</updated>
<author>
<name>Junio C Hamano</name>
<email>gitster@pobox.com</email>
</author>
<published>2023-02-27T18:08:56Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=ece8dc97ae53d08247aa283b6f299e3e5b2669db'/>
<id>urn:sha1:ece8dc97ae53d08247aa283b6f299e3e5b2669db</id>
<content type='text'>
The "diff" drivers specified by the "diff" attribute attached to
paths can now specify which algorithm (e.g. histogram) to use.

* jc/diff-algo-attribute:
  diff: teach diff to read algorithm from diff driver
  diff: consolidate diff algorithm option parsing
</content>
</entry>
</feed>
