From: Jiamu Sun <39@barroit.sh> Date: Mon, 16 Mar 2026 15:36:23 +0000 (+0900) Subject: doc: document autocorrect API X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=916b45080534e9603094dda39c4599a2f2a466d1;p=thirdparty%2Fgit.git doc: document autocorrect API Explain behaviors for autocorrect_resolve(), autocorrect_confirm(), and struct autocorrect. Signed-off-by: Jiamu Sun <39@barroit.sh> Signed-off-by: Junio C Hamano --- diff --git a/autocorrect.h b/autocorrect.h index 0d3e819262..bfa3ba20a4 100644 --- a/autocorrect.h +++ b/autocorrect.h @@ -9,13 +9,24 @@ enum autocorrect_mode { AUTOCORRECT_DELAY, }; +/** + * `mode` indicates which action will be performed by autocorrect_confirm(). + * `delay` is the timeout before autocorrect_confirm() returns, in tenths of a + * second. Use it only with AUTOCORRECT_DELAY. + */ struct autocorrect { enum autocorrect_mode mode; int delay; }; +/** + * Resolve the autocorrect configuration into `conf`. + */ void autocorrect_resolve(struct autocorrect *conf); +/** + * Interact with the user in different ways depending on `conf->mode`. + */ void autocorrect_confirm(struct autocorrect *conf, const char *assumed); #endif /* AUTOCORRECT_H */