The feature proposal of adding a command interface to cat-file was first discussed in [A]. In [B], Taylor expressed the need for a fuller proposal before moving forward with a new flag. An RFC was created [C] and the idea was discussed more thoroughly, and overall it seemed like it was headed in the right direction. This patch series consolidates the feedback from these different threads. The latest change since [C] was replacing the flush command with a series of commands to allow a read "session", so we can queue up a bunch of objects and then get either their info or contents, then end by flushing. This is to address Phillip's concern about deadlocks if we allow the caller to call flush whenever they want. This patch series has two parts: 1. preparation patch to rename a variable 2. logic to handle --batch-command flag, and adding different commands A. https://lore.kernel.org/git/xmqqk0hitnkc.fsf@gitster.g/ B. https://lore.kernel.org/git/YehomwNiIs0l83W7@nand.local/ C. https://lore.kernel.org/git/e75ba9ea-fdda-6e9f-4dd6-24190117d93b@xxxxxxxxx/ John Cai (2): cat-file.c: rename cmdmode to mode catfile.c: add --batch-command mode Documentation/git-cat-file.txt | 27 +++++ builtin/cat-file.c | 203 +++++++++++++++++++++++++++++---- t/t1006-cat-file.sh | 46 +++++++- 3 files changed, 251 insertions(+), 25 deletions(-) base-commit: 5d01301f2b865aa8dba1654d3f447ce9d21db0b5 Published-As: https://github.com/gitgitgadget/git/releases/tag/pr-git-1212%2Fjohn-cai%2Fjc-cat-file-batch-command-v1 Fetch-It-Via: git fetch https://github.com/gitgitgadget/git pr-git-1212/john-cai/jc-cat-file-batch-command-v1 Pull-Request: https://github.com/git/git/pull/1212 -- gitgitgadget