git@vger.kernel.org mailing list mirror (one of many)
 help / color / mirror / code / Atom feed
From: Junio C Hamano <gitster@pobox.com>
To: Eric Sunshine <sunshine@sunshineco.com>
Cc: Sven van Haastregt <svenvh@gmail.com>, Git List <git@vger.kernel.org>
Subject: Re: [PATCH v3] git-submodule.sh: shorten submodule SHA-1s using rev-parse
Date: Mon, 04 Feb 2019 10:47:18 -0800	[thread overview]
Message-ID: <xmqqftt3v1ah.fsf@gitster-ct.c.googlers.com> (raw)
In-Reply-To: <CAPig+cQXuzMwZjHa3n+DwRFL3E76U8uAvhiFiC5S=B23f03Vnw@mail.gmail.com> (Eric Sunshine's message of "Sun, 3 Feb 2019 16:28:13 -0500")

Eric Sunshine <sunshine@sunshineco.com> writes:

> On Sun, Feb 3, 2019 at 4:01 PM Sven van Haastregt <svenvh@gmail.com> 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.

Replace that problematic sentence with something like

	As a submodule may not be initialized with "submodule init"
	or not cloned, `git rev-parse` may not work in it yet; as a
	fallback, use the original method of cutting at 7 hexdigits.

perhaps?


>
>> 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.

  reply	other threads:[~2019-02-04 18:47 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-02-03 21:00 [PATCH v3] git-submodule.sh: shorten submodule SHA-1s using rev-parse Sven van Haastregt
2019-02-03 21:28 ` Eric Sunshine
2019-02-04 18:47   ` Junio C Hamano [this message]
2019-02-04 19:01     ` Eric Sunshine

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: http://vger.kernel.org/majordomo-info.html

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=xmqqftt3v1ah.fsf@gitster-ct.c.googlers.com \
    --to=gitster@pobox.com \
    --cc=git@vger.kernel.org \
    --cc=sunshine@sunshineco.com \
    --cc=svenvh@gmail.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://80x24.org/mirrors/git.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).