update-index: add --show-index-version
commit606e088d5d9af2393b4b05a8a180162c129cd734
authorJunio C Hamano <gitster@pobox.com>
Tue, 12 Sep 2023 19:32:34 +0000 (12 12:32 -0700)
committerJunio C Hamano <gitster@pobox.com>
Tue, 12 Sep 2023 23:21:53 +0000 (12 16:21 -0700)
tree6684eaf70d5ce0a78944896aaae3a3e1f2c23405
parent764b2330db42d07ed8c7d4f6c66a1d1203fb95de
update-index: add --show-index-version

"git update-index --index-version N" is used to set the index format
version to a specific version, but there was no way to query the
current version used in the on-disk index file.

Teach the command a new "--show-index-version" option, and also
teach the "--index-version N" option to report what the version was
when run with the "--verbose" option.

Helped-by: Linus Arver <linusa@google.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
Documentation/git-update-index.txt
builtin/update-index.c
t/t2107-update-index-basic.sh