]> git.ipfire.org Git - thirdparty/git.git/commit
git-submodule.sh: shorten submodule SHA-1s using rev-parse
authorSven van Haastregt <svenvh@gmail.com>
Sun, 3 Feb 2019 21:00:27 +0000 (21:00 +0000)
committerJunio C Hamano <gitster@pobox.com>
Mon, 4 Feb 2019 21:33:56 +0000 (13:33 -0800)
commit0586a438f64bc13d6634379cbeeaa96c9e8241d9
treea0bea11a27cc9c805b9801e5d4726592b3a69c70
parent0d0ac3826a3bbb9247e39e12623bbcfdd722f24c
git-submodule.sh: shorten submodule SHA-1s using rev-parse

Until now, `git submodule summary` was always emitting 7-character
SHA-1s that have a higher chance of being ambiguous for larger
repositories.  Use `git rev-parse --short` instead, which will
determine suitable short SHA-1 lengths.

When a submodule hasn't been initialized with "submodule init" or
not cloned, `git rev-parse` would not work in it yet; as a fallback,
use the original method of cutting at 7 hexdigits.

Signed-off-by: Sven van Haastregt <svenvh@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
git-submodule.sh