]> git.ipfire.org Git - thirdparty/git.git/commit
repo: add the --format flag
authorLucas Seiki Oshiro <lucasseikioshiro@gmail.com>
Sat, 16 Aug 2025 22:46:03 +0000 (19:46 -0300)
committerJunio C Hamano <gitster@pobox.com>
Sun, 17 Aug 2025 16:13:41 +0000 (09:13 -0700)
commita81224d12818e94a2e3c257ee2e5b0f3169da12b
tree29a6a23f4ab3c71fe94d8daaf37cc504b5b795ba
parente52cd654c9b21a98817578b8fd668da99053ee2b
repo: add the --format flag

Add the --format flag to git-repo-info. By using this flag, the users
can choose the format for obtaining the data they requested.

Given that this command can be used for generating input for other
applications and for being read by end users, it requires at least two
formats: one for being read by humans and other for being read by
machines. Some other Git commands also have two output formats, notably
git-config which was the inspiration for the two formats that were
chosen here:

- keyvalue, where the retrieved data is printed one per line, using =
  for delimiting the key and the value. This is the default format,
  targeted for end users.
- nul, where the retrieved data is separated by NUL characters, using
  the newline character for delimiting the key and the value. This
  format is targeted for being read by machines.

Helped-by: Phillip Wood <phillip.wood@dunelm.org.uk>
Helped-by: Junio C Hamano <gitster@pobox.com>
Helped-by: Justin Tobler <jltobler@gmail.com>
Helped-by: Eric Sunshine <sunshine@sunshineco.com>
Mentored-by: Karthik Nayak <karthik.188@gmail.com>
Mentored-by: Patrick Steinhardt <ps@pks.im>
Signed-off-by: Lucas Seiki Oshiro <lucasseikioshiro@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
Documentation/git-repo.adoc
builtin/repo.c
t/t1900-repo.sh