From: Eric Sunshine Date: Sun, 03 Feb 2019 21:28:13 GMT Subject: Re: [PATCH v3] git-submodule.sh: shorten submodule SHA-1s using rev-parse Message-ID: In-Reply-To: <20190203210027.13272-1-svenvh@gmail.com> On Sun, Feb 3, 2019 at 4:01 PM Sven van Haastregt wrote: > 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. > > We cannot always rely on successfully invoking `git rev-parse` in the > submodule directory. Keep the old method using `cut` as a fallback. Reviewers and future readers of this patch are left in the dark regarding the circumstances in which git-rev-parse may fail in the submodule directory. It would be helpful for the commit message to explain this potential failure in enough detail for someone working in this area in the future to understand any implications of changes to this code. > Signed-off-by: Sven van Haastregt > --- > Differences since v2: Simplify code as suggested by Eric > Sunshine and suppress stderr. This version looks better. Thanks.