Git development
 help / color / mirror / Atom feed
* [PATCH 0/7] fast-import: standardize usage string and SYNOPSIS
@ 2026-07-16 16:55 Christian Couder
  2026-07-16 16:55 ` [PATCH 1/7] parse-options: introduce OPT_HIDDEN_GROUP Christian Couder
                   ` (6 more replies)
  0 siblings, 7 replies; 12+ messages in thread
From: Christian Couder @ 2026-07-16 16:55 UTC (permalink / raw)
  To: git
  Cc: Junio C Hamano, Patrick Steinhardt, Elijah Newren, Jeff King,
	brian m . carlson, Johannes Schindelin, Justin Tobler,
	Christian Couder

The goal of this series is to improve on `git fast-import`'s usage
string as it is obsolete in many ways.

Along the way it modernizes "builtin/fast-import.c" mostly by using
`struct option`, by starting to remove global variables and libify
that command, and by introducing a new `OPT_HIDDEN_GROUP` macro.

`struct option` is used only for the usage string for now and there
are still many global variables left, so it's left to future work to
finish on these directions.

But this is already enough to standardize the usage string and make it
consistent with the SYNOPSIS in the docs, so that the command can be
removed from "t/t0450/adoc-help-mismatches".

Overview of the patches
=======================

  - Patch 1/7: Introduces OPT_HIDDEN_GROUP and improves on the hidden
    option tests.

  - Patches 2/7 and 3/7: Improves on the parse-options API docs.

  - Patch 4/7: Cleans up an 'i' loop counter variable in
    cmd_fast_import().

  - Patches 5/7 and 6/7: Starts libifying "builtin/fast-import.c" by
    introducing a 'struct fast_import_state' and using it to store
    some global variables.

  - Patch 7/7: Improves the usage string and SYNOPSIS by introducing
    `struct option`.

CI tests
========

They all pass, see: https://github.com/chriscool/git/actions/runs/29513714019

Christian Couder (7):
  parse-options: introduce OPT_HIDDEN_GROUP
  api-parse-options.adoc: document per-option flags
  api-parse-options.adoc: document hidden and OPT_*_F option macros
  fast-import: localize 'i' into the 'for' loops using it
  fast-import: introduce 'struct fast_import_state'
  fast-import: move command state globals into 'struct
    fast_import_state'
  fast-import: use struct option for usage string

 Documentation/git-fast-import.adoc            |   2 +-
 .../technical/api-parse-options.adoc          |  79 ++++
 builtin/fast-import.c                         | 372 +++++++++++-------
 parse-options.c                               |   4 +-
 parse-options.h                               |   5 +
 t/helper/test-parse-options.c                 |   4 +
 t/t0040-parse-options.sh                      |  25 +-
 t/t0450/adoc-help-mismatches                  |   1 -
 8 files changed, 344 insertions(+), 148 deletions(-)

-- 
2.55.0.185.g9120d2b5c0


^ permalink raw reply	[flat|nested] 12+ messages in thread

end of thread, other threads:[~2026-07-16 22:31 UTC | newest]

Thread overview: 12+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-07-16 16:55 [PATCH 0/7] fast-import: standardize usage string and SYNOPSIS Christian Couder
2026-07-16 16:55 ` [PATCH 1/7] parse-options: introduce OPT_HIDDEN_GROUP Christian Couder
2026-07-16 21:14   ` Junio C Hamano
2026-07-16 22:14     ` .mailmap etiquette (was "Re: [PATCH 1/7] parse-options: introduce OPT_HIDDEN_GROUP") D. Ben Knoble
2026-07-16 22:31       ` Junio C Hamano
2026-07-16 16:55 ` [PATCH 2/7] api-parse-options.adoc: document per-option flags Christian Couder
2026-07-16 16:55 ` [PATCH 3/7] api-parse-options.adoc: document hidden and OPT_*_F option macros Christian Couder
2026-07-16 16:55 ` [PATCH 4/7] fast-import: localize 'i' into the 'for' loops using it Christian Couder
2026-07-16 16:55 ` [PATCH 5/7] fast-import: introduce 'struct fast_import_state' Christian Couder
2026-07-16 16:55 ` [PATCH 6/7] fast-import: move command state globals into " Christian Couder
2026-07-16 16:55 ` [PATCH 7/7] fast-import: use struct option for usage string Christian Couder
2026-07-16 21:35   ` Junio C Hamano

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox