<feed xmlns='http://www.w3.org/2005/Atom'>
<title>git/help.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>2026-04-17T04:27:20Z</updated>
<entry>
<title>Merge branch 'js/parseopt-subcommand-autocorrection' into jch</title>
<updated>2026-04-17T04:27:20Z</updated>
<author>
<name>Junio C Hamano</name>
<email>gitster@pobox.com</email>
</author>
<published>2026-04-17T04:27:20Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=8dd4eed84bfa07d9ecab33ad6825111669775d0d'/>
<id>urn:sha1:8dd4eed84bfa07d9ecab33ad6825111669775d0d</id>
<content type='text'>
The parse-options library learned to auto-correct misspelled
subcommand names.

* js/parseopt-subcommand-autocorrection:
  doc: document autocorrect API
  parseopt: add tests for subcommand autocorrection
  parseopt: enable subcommand autocorrection for git-remote and git-notes
  parseopt: autocorrect mistyped subcommands
  autocorrect: provide config resolution API
  autocorrect: rename AUTOCORRECT_SHOW to AUTOCORRECT_HINT
  autocorrect: use mode and delay instead of magic numbers
  help: move tty check for autocorrection to autocorrect.c
  help: make autocorrect handling reusable
  parseopt: extract subcommand handling from parse_options_step()
</content>
</entry>
<entry>
<title>autocorrect: provide config resolution API</title>
<updated>2026-03-16T18:21:08Z</updated>
<author>
<name>Jiamu Sun</name>
<email>39@barroit.sh</email>
</author>
<published>2026-03-16T15:36:19Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=7cd07f167d2980ad58de08a8bd7787d2ef5882b9'/>
<id>urn:sha1:7cd07f167d2980ad58de08a8bd7787d2ef5882b9</id>
<content type='text'>
Add autocorrect_resolve(). This resolves and populates the correct
values for autocorrect config.

Make autocorrect config callback internal. The API is meant to provide
a high-level way to retrieve the config. Allowing access to the config
callback from outside violates that intent.

Additionally, in some cases, without access to the config callback, two
config iterations cannot be merged into one, which can hurt performance.
This is fine, as the code path that calls autocorrect_resolve() is cold.

Signed-off-by: Jiamu Sun &lt;39@barroit.sh&gt;
Signed-off-by: Junio C Hamano &lt;gitster@pobox.com&gt;
</content>
</entry>
<entry>
<title>autocorrect: rename AUTOCORRECT_SHOW to AUTOCORRECT_HINT</title>
<updated>2026-03-16T18:21:08Z</updated>
<author>
<name>Jiamu Sun</name>
<email>39@barroit.sh</email>
</author>
<published>2026-03-16T15:36:18Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=f06f1f043cbf58b82f1243fd09fc2c8b0202a853'/>
<id>urn:sha1:f06f1f043cbf58b82f1243fd09fc2c8b0202a853</id>
<content type='text'>
AUTOCORRECT_SHOW is ambiguous. Its purpose is to show commands similar
to the unknown one and take no other action. Rename it to fit the
semantics.

Signed-off-by: Jiamu Sun &lt;39@barroit.sh&gt;
Signed-off-by: Junio C Hamano &lt;gitster@pobox.com&gt;
</content>
</entry>
<entry>
<title>autocorrect: use mode and delay instead of magic numbers</title>
<updated>2026-03-16T18:21:07Z</updated>
<author>
<name>Jiamu Sun</name>
<email>39@barroit.sh</email>
</author>
<published>2026-03-16T15:36:17Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=a6e0ccbd38e4b274fa2360bc8a49d8049d1ded95'/>
<id>urn:sha1:a6e0ccbd38e4b274fa2360bc8a49d8049d1ded95</id>
<content type='text'>
Drop magic numbers and describe autocorrect config with a mode enum and
an integer delay. This reduces errors when mutating config values and
makes the values easier to access.

Signed-off-by: Jiamu Sun &lt;39@barroit.sh&gt;
Signed-off-by: Junio C Hamano &lt;gitster@pobox.com&gt;
</content>
</entry>
<entry>
<title>help: move tty check for autocorrection to autocorrect.c</title>
<updated>2026-03-16T18:21:07Z</updated>
<author>
<name>Jiamu Sun</name>
<email>39@barroit.sh</email>
</author>
<published>2026-03-16T15:36:16Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=916b96c0ec006216fcb9475fea37c9bc8e6b6505'/>
<id>urn:sha1:916b96c0ec006216fcb9475fea37c9bc8e6b6505</id>
<content type='text'>
TTY checking is the autocorrect config parser's responsibility. It must
ensure the parsed value is correct and reliable. Thus, move the check to
autocorrect_resolve_config().

Signed-off-by: Jiamu Sun &lt;39@barroit.sh&gt;
Signed-off-by: Junio C Hamano &lt;gitster@pobox.com&gt;
</content>
</entry>
<entry>
<title>help: make autocorrect handling reusable</title>
<updated>2026-03-16T18:21:07Z</updated>
<author>
<name>Jiamu Sun</name>
<email>39@barroit.sh</email>
</author>
<published>2026-03-16T15:36:15Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=e0245a1169b2acddd94be4da02c426419507f0b5'/>
<id>urn:sha1:e0245a1169b2acddd94be4da02c426419507f0b5</id>
<content type='text'>
Move config parsing and prompt/delay handling into autocorrect.c and
expose them in autocorrect.h. This makes autocorrect reusable regardless
of which target links against it.

Signed-off-by: Jiamu Sun &lt;39@barroit.sh&gt;
Signed-off-by: Junio C Hamano &lt;gitster@pobox.com&gt;
</content>
</entry>
<entry>
<title>Merge branch 'jh/alias-i18n-fixes'</title>
<updated>2026-03-10T21:23:24Z</updated>
<author>
<name>Junio C Hamano</name>
<email>gitster@pobox.com</email>
</author>
<published>2026-03-10T21:23:23Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=42afcb954bd4a69deba0a7b9823a9307b4223136'/>
<id>urn:sha1:42afcb954bd4a69deba0a7b9823a9307b4223136</id>
<content type='text'>
Further update to the i18n alias support to avoid regressions.

* jh/alias-i18n-fixes:
  doc: fix list continuation in alias.adoc
  git, help: fix memory leaks in alias listing
  alias: treat empty subsection [alias ""] as plain [alias]
  doc: fix list continuation in alias subsection example
</content>
</entry>
<entry>
<title>Merge branch 'jh/alias-i18n'</title>
<updated>2026-02-27T23:11:53Z</updated>
<author>
<name>Junio C Hamano</name>
<email>gitster@pobox.com</email>
</author>
<published>2026-02-27T23:11:53Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=c0d0b8daedd336677ed30bfb6bb7cdc6c47a468a'/>
<id>urn:sha1:c0d0b8daedd336677ed30bfb6bb7cdc6c47a468a</id>
<content type='text'>
Extend the alias configuration syntax to allow aliases using
characters outside ASCII alphanumeric (plus '-').

* jh/alias-i18n:
  completion: fix zsh alias listing for subsection aliases
  alias: support non-alphanumeric names via subsection syntax
  alias: prepare for subsection aliases
  help: use list_aliases() for alias listing
</content>
</entry>
<entry>
<title>git, help: fix memory leaks in alias listing</title>
<updated>2026-02-26T21:07:24Z</updated>
<author>
<name>Jonatan Holmgren</name>
<email>jonatan@jontes.page</email>
</author>
<published>2026-02-26T20:53:28Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=cdef6255095251500cc7d08d304072e1e2fa0bbd'/>
<id>urn:sha1:cdef6255095251500cc7d08d304072e1e2fa0bbd</id>
<content type='text'>
The list_aliases() function sets the util pointer of each list item to
a heap-allocated copy of the alias command value.  Two callers failed
to free these util pointers:

 - list_cmds() in git.c collects a string list with STRING_LIST_INIT_DUP
   and clears it with string_list_clear(&amp;list, 0), which frees the
   duplicated strings (strdup_strings=1) but not the util pointers.
   Pass free_util=1 to free them.

 - list_cmds_by_config() in help.c calls string_list_sort_u(list, 0) to
   deduplicate the list before processing completion.commands overrides.
   When duplicate entries are removed, the util pointer of each discarded
   item is leaked because free_util=0.  Pass free_util=1 to free them.

Reported-by: Jacob Keller &lt;jacob.e.keller@intel.com&gt;
Signed-off-by: Jonatan Holmgren &lt;jonatan@jontes.page&gt;
Signed-off-by: Junio C Hamano &lt;gitster@pobox.com&gt;
</content>
</entry>
<entry>
<title>alias: support non-alphanumeric names via subsection syntax</title>
<updated>2026-02-19T18:13:20Z</updated>
<author>
<name>Jonatan Holmgren</name>
<email>jonatan@jontes.page</email>
</author>
<published>2026-02-18T21:57:36Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=ac1f12a9de4b79b176a08f524fecdb092ff00e74'/>
<id>urn:sha1:ac1f12a9de4b79b176a08f524fecdb092ff00e74</id>
<content type='text'>
Git alias names are limited to ASCII alphanumeric characters and
dashes because aliases are implemented as config variable names.
This prevents aliases being created in languages using characters outside that range.

Add support for arbitrary alias names by using config subsections:

    [alias "förgrena"]
        command = branch

The subsection name is matched as-is (case-sensitive byte comparison),
while the existing definition without a subsection (e.g.,
"[alias] co = checkout") remains case-insensitive for backward
compatibility. This uses existing config infrastructure since
subsections already support arbitrary bytes, and avoids introducing
Unicode normalization.

Also teach the help subsystem about the new syntax so that "git help
-a" properly lists subsection aliases and the autocorrect feature can
suggest them. Use utf8_strwidth() instead of strlen() for column
alignment so that non-ASCII alias names display correctly.

Suggested-by: Jeff King &lt;peff@peff.net&gt;
Signed-off-by: Jonatan Holmgren &lt;jonatan@jontes.page&gt;
Signed-off-by: Junio C Hamano &lt;gitster@pobox.com&gt;
</content>
</entry>
</feed>
