git@vger.kernel.org mailing list mirror (one of many)
 help / color / mirror / code / Atom feed
From: vi0oss <vi0oss@gmail.com>
To: Stefan Beller <sbeller@google.com>
Cc: "git@vger.kernel.org" <git@vger.kernel.org>,
	Stefan Beller <stefanbeller@gmail.com>
Subject: Re: [PATCH] submodule--helper: set alternateLocation for cloned submodules
Date: Thu, 8 Dec 2016 00:24:07 +0300	[thread overview]
Message-ID: <9493435c-16e5-d8af-9455-ec3f3cba390d@gmail.com> (raw)
In-Reply-To: <CAGZ79kY3LR2KA69b4iDJb164EhJLb3JuVSRRcN0-4-kp-eryog@mail.gmail.com>

On 12/07/2016 11:09 PM, Stefan Beller wrote:
>> As submodule's alternate target does not end in .git/objects
>> (rather .git/modules/qqqqqq/objects), this alternate target
>> path restriction for in add_possible_reference_from_superproject
>> relates from "*.git/objects" to just */objects".
> I wonder if this check is too weak and we actually have to check for
> either .git/objects or modules/<name/possibly/having/slashes>/objects.
> When writing the referenced commit I assumed we'd need a stronger check
> to be safer and not add some random location as a possible alternate.
>
1. Do we really need to check that it is named ".git"? Although
"git clone --mirror --recursive" is not (directly) supported
now, user may create one bare repository with [remnants of]
submodules by converting reqular repository into bare one.
Why not take advantage of additional information available locally
in this case?

2. Is the check need to be strict because of we need to traverse
one directory level up? Normally this "/objects" part is added by
Git, so just one "../" seems to be OK. User can't specify "--reference
somerepo/.git/objects", a strange reference can appear only if user
manually creates alternates. Maybe better to document this case
instead of restricting the feature?

3. If nonetheless check for ".git/*/objects", then
a. What functions should be used in Git codebase for such checks?
b. Should we handle tricks like "smth/.git/../../objects" and so on?

4. Should we print (or print in verbose mode) each used alternate,
to inform operator what his or her new clone will depend on?

P.S. Actually I discovered the --recursive --reference feature when tried to
put reference to a mega-repo with all possible submodules added as remotes.
I expected --reference to just get though across all submodules, but it 
complained
to missing "/modules/..." instead (the check went though becase the 
repository
was named like "megarepo.git", so it did ended in ".git/objects").

  parent reply	other threads:[~2016-12-07 21:24 UTC|newest]

Thread overview: 19+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-12-07 18:42 [PATCH] submodule--helper: set alternateLocation for cloned submodules vi0oss
2016-12-07 20:09 ` Stefan Beller
2016-12-07 20:18   ` Junio C Hamano
2016-12-07 20:26     ` Stefan Beller
2016-12-07 20:28       ` Junio C Hamano
2016-12-07 21:24   ` vi0oss [this message]
2016-12-07 22:09     ` Stefan Beller
  -- strict thread matches above, loose matches on Subject: below --
2016-12-08  0:39 vi0oss
2016-12-08  1:22 ` Stefan Beller
2016-12-08 17:46   ` Jeff King
2016-12-08 18:04     ` Stefan Beller
2016-12-08 18:04     ` vi0oss
2016-12-08 18:21       ` Stefan Beller
2016-12-08 18:53       ` Jeff King
2016-12-08  1:38 vi0oss
2016-12-10 13:41 ` vi0oss
2016-12-12  5:35   ` Stefan Beller
2016-12-12 18:00     ` Junio C Hamano
2016-12-12  2:45 vi0oss

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

  List information: http://vger.kernel.org/majordomo-info.html

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

  git send-email \
    --in-reply-to=9493435c-16e5-d8af-9455-ec3f3cba390d@gmail.com \
    --to=vi0oss@gmail.com \
    --cc=git@vger.kernel.org \
    --cc=sbeller@google.com \
    --cc=stefanbeller@gmail.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.
Code repositories for project(s) associated with this public inbox

	https://80x24.org/mirrors/git.git

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 read-only IMAP folder(s) and NNTP newsgroup(s).