]> git.ipfire.org Git - thirdparty/git.git/commitdiff
doc: document autocorrect API
authorJiamu Sun <39@barroit.sh>
Mon, 16 Mar 2026 15:36:23 +0000 (00:36 +0900)
committerJunio C Hamano <gitster@pobox.com>
Mon, 16 Mar 2026 18:21:09 +0000 (11:21 -0700)
Explain behaviors for autocorrect_resolve(), autocorrect_confirm(), and
struct autocorrect.

Signed-off-by: Jiamu Sun <39@barroit.sh>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
autocorrect.h

index 0d3e819262edeedf187914c8142c6e4da2e0ddfb..bfa3ba20a4fb73e20fe3a13ac11d6ca258fb65ec 100644 (file)
@@ -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 */