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

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

From
Eric Sunshine <sunshine@sunshineco.com>
Date
Feb 3, 2019, 21:28 UTC
Message-ID
<CAPig+cQXuzMwZjHa3n+DwRFL3E76U8uAvhiFiC5S=B23f03Vnw@mail.gmail.com>
In-Reply-To
<20190203210027.13272-1-svenvh@gmail.com>
On Sun, Feb 3, 2019 at 4:01 PM Sven van Haastregt <svenvh@gmail.com> wrote:
Show 7 quoted lines
> 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 <svenvh@gmail.com>
> ---
> Differences since v2: Simplify code as suggested by Eric
> Sunshine <sunshine@sunshineco.com> and suppress stderr.
This version looks better. Thanks.
Previous: Sven van HaastregtNext: Junio C Hamano
Message 2 of 4 in “git-submodule.sh: shorten submodule SHA-1s using rev-parse”
  1. git-submodule.sh: shorten submodule SHA-1s using rev-parseSven van Haastregt, Feb 3, 2019
  2. Eric SunshineFeb 3, 2019
  3. Junio C HamanoFeb 4, 2019
  4. Eric SunshineFeb 4, 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.