All of lore.kernel.org
 help / color / mirror / Atom feed
From: Junio C Hamano <gitster@pobox.com>
To: Stefan Beller <sbeller@google.com>
Cc: git@vger.kernel.org, Jens.Lehmann@web.de, dborowitz@google.com,
	jacob.keller@gmail.com
Subject: Re: [PATCH 1/2] submodule: Include check for objects when fetching
Date: Mon, 22 Feb 2016 14:54:53 -0800	[thread overview]
Message-ID: <xmqqoab84apu.fsf@gitster.mtv.corp.google.com> (raw)
In-Reply-To: <1456180548-20996-2-git-send-email-sbeller@google.com> (Stefan Beller's message of "Mon, 22 Feb 2016 14:35:47 -0800")

Stefan Beller <sbeller@google.com> writes:

> Junio wrote:
>> To be complete, the rev-list command line should also run with
>> "--objects"; after all, a commit walker fetch may have downloaded
>> commit chain completely but haven't fetched necessary trees and
>> blobs when it was killed, and "rev-list $sha1 --not --all" would not
>> catch such a breakage without "--objects".
>
> By adding the --objects switch to rev-list we make sure to do a complete
> check.

You also need to drop "-n1" for the command to be equivalent to
quickfetch, I think.

>
> Signed-off-by: Stefan Beller <sbeller@google.com>
> ---
>  git-submodule.sh | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/git-submodule.sh b/git-submodule.sh
> index 9bc5c5f..f5d6675 100755
> --- a/git-submodule.sh
> +++ b/git-submodule.sh
> @@ -746,7 +746,7 @@ Maybe you want to use 'update --init'?")"
>  				# Run fetch only if $sha1 isn't present or it
>  				# is not reachable from a ref.
>  				(clear_local_git_env; cd "$sm_path" &&
> -					( (rev=$(git rev-list -n 1 $sha1 --not --all 2>/dev/null) &&
> +					( (rev=$(git rev-list --objects -n 1 $sha1 --not --all 2>/dev/null) &&
>  					 test -z "$rev") || git-fetch)) ||
>  				die "$(eval_gettext "Unable to fetch in submodule path '\$displaypath'")"
>  			fi

  reply	other threads:[~2016-02-22 22:55 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-02-22 22:35 [PATCH 0/2] Submodule harden fetches (WAS: submodule: Fetch the direct sha1 first) Stefan Beller
2016-02-22 22:35 ` [PATCH 1/2] submodule: Include check for objects when fetching Stefan Beller
2016-02-22 22:54   ` Junio C Hamano [this message]
2016-02-22 23:06     ` Junio C Hamano
2016-02-22 23:18       ` Junio C Hamano
2016-02-22 22:35 ` [PATCH 2/2] submodule: Try harder to fetch needed sha1 by direct fetching sha1 Stefan Beller
2016-02-23  0:01   ` Junio C Hamano
2016-02-23  0:28     ` Stefan Beller
2016-02-23  6:38       ` Junio C Hamano
2016-02-24  3:32         ` [PATCH] " Stefan Beller

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

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

  git send-email \
    --in-reply-to=xmqqoab84apu.fsf@gitster.mtv.corp.google.com \
    --to=gitster@pobox.com \
    --cc=Jens.Lehmann@web.de \
    --cc=dborowitz@google.com \
    --cc=git@vger.kernel.org \
    --cc=jacob.keller@gmail.com \
    --cc=sbeller@google.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.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.