All of lore.kernel.org
 help / color / mirror / Atom feed
From: "Shawn O. Pearce" <spearce@spearce.org>
To: Johan Herland <johan@herland.net>
Cc: git@vger.kernel.org, David Aguilar <davvid@gmail.com>,
	Junio C Hamano <gitster@pobox.com>,
	Mark Levedahl <mdl123@verizon.net>
Subject: Re: [PATCH] Fix submodule sync with relative submodule URLs
Date: Wed, 24 Sep 2008 09:19:02 -0700	[thread overview]
Message-ID: <20080924161902.GT3669@spearce.org> (raw)
In-Reply-To: <200809241131.16327.johan@herland.net>

Johan Herland <johan@herland.net> wrote:
> On Wednesday 24 September 2008, David Aguilar wrote:
> > Instead of just doing an "|| exit" shouldn't it report an explanation
> > of the error?
> > Other than that, it looks good to me.
> 
> Fixed. Thanks.

OK, time for the drive-by patch commenting.  I've largely stayed
out of git-submodule related code, but I just looked at in the
context of applying this patch.

There are three callers to resolve_relative_url in master and next.
All three callers just "|| exit" when resolve_relative_url fails.

The only reason resolve_relative_url can fail is when there is no
remote.$remote.url configuration option set for the current default
remote ("origin"?).

I guess I'm unclear about why cmd_sync is different from the
existing callers.

> diff --git a/git-submodule.sh b/git-submodule.sh
> index 1c39b59..f89bdbe 100755
> --- a/git-submodule.sh
> +++ b/git-submodule.sh
> @@ -634,6 +634,15 @@ cmd_sync()
>  	do
>  		name=$(module_name "$path")
>  		url=$(git config -f .gitmodules --get submodule."$name".url)
> +
> +		# Possibly a url relative to parent
> +		case "$url" in
> +		./*|../*)
> +			url=$(resolve_relative_url "$url") ||
> +				die "failed to resolve relative submodule url for '$name'"
> +			;;
> +		esac
> +
>  		if test -e "$path"/.git
>  		then
>  		(

-- 
Shawn.

  reply	other threads:[~2008-09-24 16:20 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-09-22 16:08 [PATCH] Fix submodule sync with relative submodule URLs Johan Herland
2008-09-24  7:29 ` David Aguilar
2008-09-24  9:31   ` Johan Herland
2008-09-24 16:19     ` Shawn O. Pearce [this message]
2008-09-24 16:41       ` Johan Herland
2008-09-25 11:38       ` David Aguilar
2008-09-25 11:21 ` [PATCH] git-submodule: remove unnecessary exits when calling resolve_relative_url David Aguilar
2008-09-25 12:19   ` Johannes Sixt
2008-09-25 14:54     ` Shawn O. Pearce
2008-09-25 14:58       ` Johan Herland

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=20080924161902.GT3669@spearce.org \
    --to=spearce@spearce.org \
    --cc=davvid@gmail.com \
    --cc=git@vger.kernel.org \
    --cc=gitster@pobox.com \
    --cc=johan@herland.net \
    --cc=mdl123@verizon.net \
    /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.