summaryrefslogtreecommitdiff
path: root/argv-array.h
diff options
context:
space:
mode:
authorLibravatar Johannes Schindelin <johannes.schindelin@gmx.de>2017-06-14 13:35:50 +0200
committerLibravatar Junio C Hamano <gitster@pobox.com>2017-06-15 12:31:43 -0700
commit659fef199fb52d4a5cb24f1dfd2b272980fc5038 (patch)
treebd1bcc8562aa16ca180ceb336791548b8350b704 /argv-array.h
parentconfig: report correct line number upon error (diff)
downloadtgif-659fef199fb52d4a5cb24f1dfd2b272980fc5038.tar.xz
help: use early config when autocorrecting aliases
Git has this feature which suggests similar commands (including aliases) in case the user specified an unknown command. This feature currently relies on a side effect of the way we expand aliases right now: when a command is not a builtin, we use the regular config machinery (meaning: discovering the .git/ directory and initializing global state such as the config cache) to see whether the command refers to an alias. However, we will change the way aliases are expanded in the next commits, to use the early config instead. That means that the autocorrect feature can no longer discover the available aliases by looking at the config cache (because it has not yet been initialized). So let's just use the early config machinery instead. This is slightly less performant than the previous way, as the early config is used *twice*: once to see whether the command refers to an alias, and then to see what aliases are most similar. However, this is hardly a performance-critical code path, so performance is less important here. Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de> Reviewed-by: Jeff King <peff@peff.net> Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 'argv-array.h')
0 files changed, 0 insertions, 0 deletions