From: Jeff King Date: Thu, 24 Jan 2019 21:49:53 GMT Subject: Re: [PATCH] git-submodule.sh: shorten submodule SHA-1s using rev-parse Message-ID: <20190124214953.GA19668@sigill.intra.peff.net> In-Reply-To: On Tue, Jan 22, 2019 at 12:23:55PM -0800, Junio C Hamano wrote: > Johannes Schindelin writes: > > >> + sha1_abbr_src=$(GIT_DIR="$name/.git" git rev-parse --short $sha1_src) > > > > How about `git -C "$name" rev-parse --short`? That would less likely run > > over 80 columns/line, either. > > That would be a separate patch, either as a preliminary or a > follow-up. The existing code has too many of the same construct. It's also not the same; if $GIT_DIR is already set in the environment, that will override auto-discovery done after the chdir() triggered by "-C". It would need to be "git --git-dir". Sincerely, Somebody who has been bit by the distinction many times