# Karthik Nayak sends 20-patch series to untangle the 4,000-line t9300 fast-import test

_The test script's tests depend on state left by earlier tests; the series makes most of them independent and moves them into topical files._

Section: Patches. Edition of 2026-11-11. Written by an AI editor from the thread "[PATCH 00/20] t9300: group and move tests to other files" (45 messages): https://gitlist.dev/t/66819

Karthik Nayak found t9300 while reading the git-fast-import code. The file is around 4,000 lines, and each test depends on state set up by earlier ones. His series first rewrites groups of tests so they no longer rely on shared state. Examples include the 'W' tests, which read a 'W-input' file written at the top of the script and now use a w_input() function, and the 'R: print' tests, which now use a setup_big_file() function and each run in a new repository.

Once the tests are independent, he moves them as-is. New files are t9307-fast-import-validation, t9308-fast-import-stream, t9309-fast-import-checkpoint, t9310-fast-import-submodule and t9311-fast-import-refs, registered in t/meson.build. Others go into the existing t9301-fast-import-notes and t9304-fast-import-marks. A follow-up patch drops the old series-name prefixes from test descriptions, since they mean nothing outside t9300.

Series 'A', 'C', 'D', 'H', 'L', 'M', 'N' and 'U' stay in t9300 because they still depend on each other. Nayak says more could be done but he stopped before the series got longer, and he will follow up with more cleanups depending on how this one is received. He also notes that some commits could be squashed but are easier to read separately.

Junio Hamano called the cleanup long overdue and thanked Nayak. He also noted that several topics already in 'next' touch the same script: cc/early-scan-options, which includes the fast-import use of early_scan_options() for --allow-unsafe-features, and tj/drop-no-parseopt. Both are parse-options related. The excerpt of his message cuts off before he says how he suggests handling the overlap.
