All of lore.kernel.org
 help / color / mirror / Atom feed
From: Junio C Hamano <gitster@pobox.com>
To: Stefan Beller <sbeller@google.com>
Cc: Andrew J <andj2223@gmail.com>,
	"git\@vger.kernel.org" <git@vger.kernel.org>
Subject: Re: Strangeness with git-add and nested repositories
Date: Thu, 28 Apr 2016 19:51:34 -0700	[thread overview]
Message-ID: <xmqqd1p92kll.fsf@gitster.mtv.corp.google.com> (raw)
In-Reply-To: <xmqq1t5p7kmp.fsf@gitster.mtv.corp.google.com> (Junio C. Hamano's message of "Thu, 28 Apr 2016 09:39:42 -0700")

Junio C Hamano <gitster@pobox.com> writes:

> My undertanding of what _should_ happen in the world order as
> currently defined (not necessarily implemented) is:
>
>  * "git add -- A B" must work the same way as "git add -- B A" and
>    "git add -- A; git add -- B"
>
>  * "git add -- path/to/subdir/file", when any of path/, path/to/,
>    path/to/subdir/ is a Git repository that is different from the
>    current Git repository, must fail.
>
> IOW, if 'path' is a repository (whether it is known as a submodule
> to the repository whose working tree contains it, or it is an
> untracked directory from the containing repository's point of view),
> the index of the containing repository cannot get path/$anything in
> it.  If you managed to do so, you found a bug [*1*].
>
> path/.git/index can of course have "to/subdir/file" in it, and from
> that point of view, "git -C path/to/subdir add file" may one day
> become an improved world order.  It is just we haven't discussed
> that possibility or reached concensus that it is a good idea.

A cursory bisection suggests that this used to work up to at least
v2.7.4; this must be a recent regression.

  parent reply	other threads:[~2016-04-29  2:51 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-04-27  8:31 Strangeness with git-add and nested repositories Andrew J
2016-04-27 16:08 ` Stefan Beller
2016-04-28  6:10   ` Andrew J
2016-04-28 16:35     ` Stefan Beller
2016-04-28 16:39   ` Junio C Hamano
2016-04-28 16:48     ` Junio C Hamano
2016-04-29  2:11       ` Andrew J
2016-04-28 16:54     ` Stefan Beller
2016-04-29  2:51     ` Junio C Hamano [this message]
2016-04-29  2:54       ` Junio C Hamano

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=xmqqd1p92kll.fsf@gitster.mtv.corp.google.com \
    --to=gitster@pobox.com \
    --cc=andj2223@gmail.com \
    --cc=git@vger.kernel.org \
    --cc=sbeller@google.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.
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.