]> git.ipfire.org Git - thirdparty/git.git/commit
git: move seen-alias bookkeeping into handle_alias(...)
authorKristoffer Haugsbakk <code@khaugsbakk.name>
Wed, 17 Sep 2025 20:24:13 +0000 (22:24 +0200)
committerJunio C Hamano <gitster@pobox.com>
Wed, 17 Sep 2025 20:47:23 +0000 (13:47 -0700)
commitb4f9282d8db88619b2becac7f4ee2cad75a72ff9
tree75dcb6a2fd62c5c8ce1114063f6a27481318faf1
parent5f31632ed7d8c2928b5cdd7a1358367415d24535
git: move seen-alias bookkeeping into handle_alias(...)

We are about to complicate the command handling by allowing *deprecated*
builtins to be shadowed by aliases.  We need to organize the code in
order to facilitate that.[1]

The code in the `while(1)` speculatively adds commands to the list
before finding out if it’s an alias.  Let’s instead move it inside
`handle_alias(...)`—where it conceptually belongs anyway—and in turn
only run this logic when we have found an alias.[2]

[1]: We will do that with an additional call to `handle_alias(1)` inside
    the loop.  *Not* moving this code leaves a blind spot; we will miss
    alias looping crafted via deprecated builtin names
[2]: Also rename the list to a more descriptive name

Based-on-patch-by: Jeff King <peff@peff.net>
Signed-off-by: Kristoffer Haugsbakk <code@khaugsbakk.name>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
git.c