From: Junio C Hamano Date: Sat, 14 Feb 2026 00:42:46 GMT Subject: Re: [PATCH v2 04/13] config: format int64s gently Message-ID: In-Reply-To: <2bca4d231686e33ea9d4d85b10fcffd60a63ad46.1771026918.git.gitgitgadget@gmail.com> "Derrick Stolee via GitGitGadget" writes: > +static int format_config_int64(struct strbuf *buf, > + const char *key_, > + const char *value_, > + const struct key_value_info *kvi, > + int gently) > +{ > + int64_t v = 0; > + if (gently) { > + if (git_parse_int64(value_, &v)) > + return -1; > + } else { > + /* may die() */ > + v = git_config_int64(key_, value_ ? value_ : "", kvi); > + } > + > + strbuf_addf(buf, "%"PRId64, v); > + return 0; > +} This establishes the pattern the next handful of patches follow. We already have in parse.c helpers that we can use for the gentler parsing, and otherwise we'd use git_config_*() that the caller of these new helpers were using originally. I'd have preferred to have the blank line moved to the gap between the decl and the first statement, i.e., > +{ > + int64_t v = 0; > + > + if (gently) { > + if (git_parse_int64(value_, &v)) > + return -1; > + } else { > + /* may die() */ > + v = git_config_int64(key_, value_ ? value_ : "", kvi); > + } > + strbuf_addf(buf, "%"PRId64, v); > + return 0; > +} These "format X gently" steps look very good.