git/list[1] front-page[2] threads[3] people[4] search[5] about
 

Re: [PATCH] git-submodule.sh: shorten submodule SHA-1s using rev-parse

From
Johannes Schindelin <johannes.schindelin@gmx.de>
Date
Jan 25, 2019, 13:05 UTC
Message-ID
<nycvar.QRO.7.76.6.1901251405010.41@tvgsbejvaqbjf.bet>
In-Reply-To
<20190124214953.GA19668@sigill.intra.peff.net>
Hi Peff,
On Thu, 24 Jan 2019, Jeff King wrote:
Show 18 quoted lines
> On Tue, Jan 22, 2019 at 12:23:55PM -0800, Junio C Hamano wrote:
> 
> > Johannes Schindelin <Johannes.Schindelin@gmx.de> 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
Ouch. Good point.

Thanks, Dscho

Previous: Jeff KingNext: Junio C Hamano
Message 5 of 7 in “git-submodule.sh: shorten submodule SHA-1s using rev-parse”
  1. git-submodule.sh: shorten submodule SHA-1s using rev-parseSven van Haastregt, Jan 20, 2019
  2. Johannes SchindelinJan 22, 2019
  3. Junio C HamanoJan 22, 2019
  4. Jeff KingJan 24, 2019
  5. Johannes SchindelinJan 25, 2019
  6. Junio C HamanoJan 22, 2019
  7. Sven van HaastregtJan 22, 2019

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.