git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Yaroslav Halchenko <yoh@onerussian.com>
To: Git Gurus hangout <git@vger.kernel.org>
Cc: Benjamin Poldrack <benjaminpoldrack@gmail.com>,
	Joey Hess <id@joeyh.name>
Subject: problems serving non-bare repos with submodules over http
Date: Wed, 20 Apr 2016 11:22:09 -0400	[thread overview]
Message-ID: <20160420152209.GH23764@onerussian.com> (raw)

Dear Git Folks,

I do realize that the situation is quite uncommon, partially I guess due
to git submodules mechanism flexibility and power on one hand and
under-use (imho) on the other, which leads to discovery of regressions
[e.g. 1] and corner cases as mine.

[1] http://thread.gmane.org/gmane.comp.version-control.git/288064
[2] http://www.onerussian.com/tmp/git-web-submodules.sh

My use case:  We are trying to serve a git repository with submodules
specified with relative paths over http from a simple web server.  With a demo
case and submodule specification [complete script to reproduce including the
webserver using python is at 2] such as

(git)hopa:/tmp/gitxxmsxYFO[master]git
$> tree
.
├── f1
└── sub1
    └── f2

$> cat .gitmodules
[submodule "sub1"]
    path = sub1
    url = ./sub1


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.

2. If I serve the clone [2 demos that too] itself, there is no easy remedy at
   all since sub1/.git is not a directory but a gitlink.

N.B. I haven't approached nested submodules case yet in [2]

I wondered

a. could 'git clone' (probably actually some relevant helper used by fetch
   etc) acquire ability to sense for URL/.git if URL itself doesn't point to a
   usable git repository?

    I think this could provide complete remedy for 1 since then relative urls
    would be properly assembled, with similar 'sensing' for /.git for the final urls

    I guess we could do it with rewrites/forwards on the "server side",
    but it wouldn't be generally acceptable solution.

b. is there a better or already existing way to remedy my situation?

c. shouldn't "git clone" (or the relevant helper) be aware of remote
   /.git possibly being a gitlink file within submodule?


Thank you in advance for your thoughts and feedback on this case.

P.S. Please maintain the CC list in replies.
-- 
Yaroslav O. Halchenko
Center for Open Neuroscience     http://centerforopenneuroscience.org
Dartmouth College, 419 Moore Hall, Hinman Box 6207, Hanover, NH 03755
Phone: +1 (603) 646-9834                       Fax: +1 (603) 646-1419
WWW:   http://www.linkedin.com/in/yarik        

             reply	other threads:[~2016-04-20 15:51 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-04-20 15:22 Yaroslav Halchenko [this message]
2016-04-20 16:14 ` problems serving non-bare repos with submodules over http Stefan Beller
2016-04-20 19:45   ` Yaroslav Halchenko
2016-04-20 19:51   ` Junio C Hamano
2016-04-20 21:05     ` Stefan Beller
2016-04-20 21:27       ` Junio C Hamano
2016-04-20 23:05         ` Stefan Beller
2016-04-21  3:14           ` Yaroslav Halchenko
2016-04-21 17:11             ` Stefan Beller
2016-04-21 17:45               ` Junio C Hamano
2016-04-21 17:48                 ` Stefan Beller
2016-04-21 22:42                   ` Jacob Keller

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=20160420152209.GH23764@onerussian.com \
    --to=yoh@onerussian.com \
    --cc=benjaminpoldrack@gmail.com \
    --cc=git@vger.kernel.org \
    --cc=id@joeyh.name \
    /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).