git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Heiko Voigt <hvoigt@hvoigt.net>
To: Jeff King <peff@peff.net>
Cc: "Jeffrey S. Haemer" <jeffrey.haemer@gmail.com>,
	Jens Lehmann <Jens.Lehmann@web.de>,
	Git Issues <git@vger.kernel.org>
Subject: Re: git commit/push can fail silently when clone omits ".git"
Date: Fri, 9 Nov 2012 19:42:27 +0100	[thread overview]
Message-ID: <20121109184225.GA1190@book.hvoigt.net> (raw)
In-Reply-To: <20121108185643.GN15560@sigill.intra.peff.net>

Hi,

On Thu, Nov 08, 2012 at 01:56:43PM -0500, Jeff King wrote:
> Unfortunately, the patch below which does that seems to make t7407 very
> unhappy. It looks like the submodule test uses "git clone ." and
> "git-submodule add" expects the "/." to still be at the end of the
> configured URL when processing relative submodule paths. I'm not sure if
> that is important, or an unnecessary brittleness in the submodule code.
> 
> Jens, Heiko?

After some analysis it seems to me that the test deviates from the
expected behavior. For relative urls we have documented that if we have
a remote in the superproject a relative submodule path is relative to that
remotes url.

In the test super has been cloned from ".". So the tests root directory
should be the directory the submodule path is relative to. That would
be ./submodule (since submodule is also in the root directory) and not
../submodule.

Before your patch a "/." was added to the origin of super and "/." is
currently counted as a path component.

So we have another corner case here: When your superproject was cloned
from "." the urls you currently have to specify with submodule add are
wrong (one ".." to much).

Since this is a change in behaviour I would like to further think about
the implications this brings if we fix this. Not sure how many people
clone from ".". The correct behavior (as documented) is the one you
introduce with your patch. If we decide to fix this we should also correct
the path calculation in git-submodule.sh.

Cheers Heiko

  reply	other threads:[~2012-11-09 18:51 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-11-04 19:50 git commit/push can fail silently when clone omits ".git" Jeffrey S. Haemer
2012-11-08 18:56 ` Jeff King
2012-11-09 18:42   ` Heiko Voigt [this message]
2012-11-13  8:32     ` [PATCH 0/3] fix cloning superprojects from "." Heiko Voigt
2012-11-13  8:34       ` [PATCH 1/3] Fix relative submodule setup of submodule tests Heiko Voigt
2012-11-13  8:35       ` [PATCH 2/3] ensure that relative submodule url needs ./ or ../ Heiko Voigt
2012-11-13  8:35       ` [PATCH 3/3] fix corner case for relative submodule path calculation Heiko Voigt

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=20121109184225.GA1190@book.hvoigt.net \
    --to=hvoigt@hvoigt.net \
    --cc=Jens.Lehmann@web.de \
    --cc=git@vger.kernel.org \
    --cc=jeffrey.haemer@gmail.com \
    --cc=peff@peff.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 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 NNTP newsgroup(s).