* should git-subtree ignore submodules?
@ 2016-11-01 19:41 Kirill Katsnelson
2017-03-29 7:05 ` David Aguilar
0 siblings, 1 reply; 2+ messages in thread
From: Kirill Katsnelson @ 2016-11-01 19:41 UTC (permalink / raw)
To: git, apenwarr
"git-subtree add" fails to add the subtree into a repository with
submodules, reporting that the worktree is not clean, while `git status`
says that everything is clean (including submodules). I tracked the
problem down to the command "git index HEAD" returning all submodules as
having the M status:
$ git diff-index HEAD
:160000 160000 d3812c9318c4d0336897fd2d666be908fa1a7953
d3812c9318c4d0336897fd2d666be908fa1a7953 M ext/grpc
<snip more submodules>
$ git --version
git version 2.9.2.windows.1
I worked around the problem in my local copy of git-subtree shell script
by adding "--ignore-submodules=all" to the two invocations of `git
diff-index` in the ensure_clean() function (direct link
<https://github.com/git/git/blob/next/contrib/subtree/git-subtree.sh#L586>).
I am wondering, is this a defect in git-subtree? To my understanding,
the command should not care about submodules more than ensuring their
worktree is not in the way of new prefix, and that's a separate check.
So *even if* the submodule is modified, this should not be a show
stopper for "git-subtree add". Or am I missing some subtleties?
-kkm
^ permalink raw reply [flat|nested] 2+ messages in thread
* Re: should git-subtree ignore submodules?
2016-11-01 19:41 should git-subtree ignore submodules? Kirill Katsnelson
@ 2017-03-29 7:05 ` David Aguilar
0 siblings, 0 replies; 2+ messages in thread
From: David Aguilar @ 2017-03-29 7:05 UTC (permalink / raw)
To: Kirill Katsnelson; +Cc: git, apenwarr
On Tue, Nov 01, 2016 at 12:41:50PM -0700, Kirill Katsnelson wrote:
> "git-subtree add" fails to add the subtree into a repository with
> submodules, reporting that the worktree is not clean, while `git status`
> says that everything is clean (including submodules). I tracked the problem
> down to the command "git index HEAD" returning all submodules as having the
> M status:
>
> $ git diff-index HEAD
> :160000 160000 d3812c9318c4d0336897fd2d666be908fa1a7953
> d3812c9318c4d0336897fd2d666be908fa1a7953 M ext/grpc
> <snip more submodules>
> $ git --version
> git version 2.9.2.windows.1
>
> I worked around the problem in my local copy of git-subtree shell script by
> adding "--ignore-submodules=all" to the two invocations of `git diff-index`
> in the ensure_clean() function (direct link
> <https://github.com/git/git/blob/next/contrib/subtree/git-subtree.sh#L586>).
>
> I am wondering, is this a defect in git-subtree? To my understanding, the
> command should not care about submodules more than ensuring their worktree
> is not in the way of new prefix, and that's a separate check. So *even if*
> the submodule is modified, this should not be a show stopper for
> "git-subtree add". Or am I missing some subtleties?
That sounds correct to me; subtree should ignore submodules.
--
David
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2017-03-29 7:05 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2016-11-01 19:41 should git-subtree ignore submodules? Kirill Katsnelson
2017-03-29 7:05 ` David Aguilar
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).