From: Junio C Hamano Subject: Re: problems serving non-bare repos with submodules over http Date: Wed, 20 Apr 2016 12:51:23 -0700 Message-ID: References: <20160420152209.GH23764@onerussian.com> Mime-Version: 1.0 Content-Type: text/plain Cc: Yaroslav Halchenko , Git Gurus hangout , Benjamin Poldrack , Joey Hess , Jens Lehmann To: Stefan Beller X-From: git-owner@vger.kernel.org Wed Apr 20 21:51:36 2016 Return-path: Envelope-to: gcvg-git-2@plane.gmane.org Received: from vger.kernel.org ([209.132.180.67]) by plane.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1asy9t-00061B-SA for gcvg-git-2@plane.gmane.org; Wed, 20 Apr 2016 21:51:34 +0200 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752260AbcDTTva (ORCPT ); Wed, 20 Apr 2016 15:51:30 -0400 Received: from pb-smtp2.pobox.com ([64.147.108.71]:50494 "EHLO sasl.smtp.pobox.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1752257AbcDTTv1 (ORCPT ); Wed, 20 Apr 2016 15:51:27 -0400 Received: from sasl.smtp.pobox.com (unknown [127.0.0.1]) by pb-smtp2.pobox.com (Postfix) with ESMTP id D112612640; Wed, 20 Apr 2016 15:51:25 -0400 (EDT) DKIM-Signature: v=1; a=rsa-sha1; c=relaxed; d=pobox.com; h=from:to:cc :subject:references:date:in-reply-to:message-id:mime-version :content-type; s=sasl; bh=RkKt+y+LN0NQ7oiDtMck0pP6XKc=; b=yL14KG xst6kNDUgdN65bU3BMtWh84EXNPdTySYcGaOKOvaKjiKItWi549HS9AF8/+0f4bZ j1J05eexhX6rHgfwXM04v8heBe6gITM4Q/LZKsnOmoOtitCeLwmi4wtg18RcWc/c jBJ/PMGhrfVx5HIYrke78FLyHrxxu1VbMdpLg= DomainKey-Signature: a=rsa-sha1; c=nofws; d=pobox.com; h=from:to:cc :subject:references:date:in-reply-to:message-id:mime-version :content-type; q=dns; s=sasl; b=rSup8jOJDcB3W1HSIb71IAxrLf5Eqnh9 Q3kZXX3KTsFlUJwko96gMdCVaJJoOorIq8wLrWJp/HriGF0pUck4YED0iTNGK/k8 Nm/6Y2OgOsri8lf88UBIe/YLX6uOSUytAYfKScOEx1L6DmZMVXsk6HK9sS3/i6eJ wEiaTUs/JkQ= Received: from pb-smtp2.nyi.icgroup.com (unknown [127.0.0.1]) by pb-smtp2.pobox.com (Postfix) with ESMTP id C5E8C1263F; Wed, 20 Apr 2016 15:51:25 -0400 (EDT) Received: from pobox.com (unknown [104.132.0.95]) (using TLSv1.2 with cipher DHE-RSA-AES128-SHA (128/128 bits)) (No client certificate requested) by pb-smtp2.pobox.com (Postfix) with ESMTPSA id 2606C1263E; Wed, 20 Apr 2016 15:51:25 -0400 (EDT) In-Reply-To: (Stefan Beller's message of "Wed, 20 Apr 2016 09:14:08 -0700") User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/24.3 (gnu/linux) X-Pobox-Relay-ID: 43AE9F8A-0731-11E6-BA39-D05A70183E34-77302942!pb-smtp2.pobox.com Sender: git-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: git@vger.kernel.org Archived-At: Stefan Beller writes: >> 1. After cloning >> >> git clone http://localhost:8080/.git >> >> I cannot 'submodule update' the sub1 in the clone since its url after >> 'submodule init' would be http://localhost:8080/.git/sub1 . If I manually fix >> it up -- it seems to proceed normally since in original repository I have >> sub1/.git/ directory and not the "gitlink" for that submodule. > > So the expected URL would be http://localhost:8080/sub1/.git ? > > I thought you could leave out the .git prefix, i.e. you can type > > git clone http://localhost:8080 > > and Git will recognize the missing .git and try that as well. The relative URL > would then be constructed as http://localhost:8080/sub1, which will use the > same mechanism to find the missing .git ending. I may be missing the subtleties, but if you are serving others from a non-bare repository with submodules, I do not think you would want to expose the in-tree version of the submodule in the first place. These $submodule/.git files point via "gitdir:" to their real repository location, don't they? And I would think that they are what you would want to expose to the outside world. Your in-tree submodules may come and go as you checkout different branches in your working tree, but these copies at their real locations will stay.