# Problem with submodules

2 messages from 2009-05-29 to 2009-05-29. Participants: Andrew Neil.
Thread: https://gitlist.dev/t/19574

## Andrew Neil, 2009-05-29 11:44

Subject: Problem with submodules
Message-ID: <77493F66-6FBF-46E8-AD5B-702DC245AA43@googlemail.com>
URL: https://gitlist.dev/e/77493F66-6FBF-46E8-AD5B-702DC245AA43%40googlemail.com

```
I am having trouble with submodules on one of my machines. When I run
`git submodule init`, then `git submodule update`, it looks as though
everything is going fine, then it crashes out with an error:
"pathspec '665a3c' did not match any file known to git.".
(The full output is pasted below).

According to this article: http://book.git-scm.com/5_submodules.html
under the heading "Pitfalls with submodules", this error is expected
to occur if you don't publish changes to a submodule. This doesn't
seem to be the problem in my case. I have tried installing the same
git repository on 2 other machines, and the submodule init/update
commands worked fine on both of them. So it looks as though there is
something on one of my machines that is interfering with this process.

I discovered that if I run the `git submodule update` command as sudo,
the problem goes away. However, this has the side-effect that the
submodule directories are created with root as the owner.

Can anyone help with this problem?

Much appreciated,
Drew


Here is the full output of the init/update commands, with my faulty
machine:

$ git submodule init
Submodule 'vendor/plugins/dataset' (git://github.com/jgarber/ 
dataset.git) registered for path 'vendor/plugins/dataset'
Submodule 'vendor/plugins/simply_versioned' (git://github.com/mmower/ 
simply_versioned.git) registered for path 'vendor/plugins/ 
simply_versioned'
$ git submodule update
Initialized empty Git repository in /Users/drew/web/extensions/ 
chronicle/vendor/plugins/dataset/.git/
remote: Counting objects: 899, done.
remote: Compressing objects: 100% (692/692), done.
remote: Total 899 (delta 539), reused 250 (delta 158)
Receiving objects: 100% (899/899), 141.93 KiB | 42 KiB/s, done.
Resolving deltas: 100% (539/539), done.
error: pathspec '665a3c03f6a65a586839b8de437c60f98177dd78' did not  
match any file(s) known to git.
Unable to checkout '665a3c03f6a65a586839b8de437c60f98177dd78' in  
submodule path 'vendor/plugins/dataset'

```

## Andrew Neil, 2009-05-29 13:38

Subject: Re: Problem with submodules
Message-ID: <7FD6E590-8C6F-4DC6-8F64-A52FFCA92515@googlemail.com>
URL: https://gitlist.dev/e/7FD6E590-8C6F-4DC6-8F64-A52FFCA92515%40googlemail.com
In-Reply-To: <77493F66-6FBF-46E8-AD5B-702DC245AA43@googlemail.com>

```
I found a solution to this here:

	http://www.websideattractions.com/2008/10/21/no-color-for-git/

Turns out that the following line in my .profile was messing things up:

	GREP_OPTIONS="--color=always"; export GREP_OPTIONS

I changed --color=always to auto, and everything works fine now.

Cheers,
Drew


On 29 May 2009, at 12:44, Andrew Neil wrote:

> I am having trouble with submodules on one of my machines. When I run
> `git submodule init`, then `git submodule update`, it looks as though
> everything is going fine, then it crashes out with an error:
> "pathspec '665a3c' did not match any file known to git.".
> (The full output is pasted below).
>
> According to this article: http://book.git-scm.com/5_submodules.html
> under the heading "Pitfalls with submodules", this error is expected
> to occur if you don't publish changes to a submodule. This doesn't
> seem to be the problem in my case. I have tried installing the same
> git repository on 2 other machines, and the submodule init/update
> commands worked fine on both of them. So it looks as though there is
> something on one of my machines that is interfering with this process.
>
> I discovered that if I run the `git submodule update` command as sudo,
> the problem goes away. However, this has the side-effect that the
> submodule directories are created with root as the owner.
>
> Can anyone help with this problem?
>
> Much appreciated,
> Drew
>
>
> Here is the full output of the init/update commands, with my faulty
> machine:
>
> $ git submodule init
> Submodule 'vendor/plugins/dataset' (git://github.com/jgarber/ 
> dataset.git) registered for path 'vendor/plugins/dataset'
> Submodule 'vendor/plugins/simply_versioned' (git://github.com/mmower/ 
> simply_versioned.git) registered for path 'vendor/plugins/ 
> simply_versioned'
> $ git submodule update
> Initialized empty Git repository in /Users/drew/web/extensions/ 
> chronicle/vendor/plugins/dataset/.git/
> remote: Counting objects: 899, done.
> remote: Compressing objects: 100% (692/692), done.
> remote: Total 899 (delta 539), reused 250 (delta 158)
> Receiving objects: 100% (899/899), 141.93 KiB | 42 KiB/s, done.
> Resolving deltas: 100% (539/539), done.
> error: pathspec '665a3c03f6a65a586839b8de437c60f98177dd78' did not  
> match any file(s) known to git.
> Unable to checkout '665a3c03f6a65a586839b8de437c60f98177dd78' in  
> submodule path 'vendor/plugins/dataset'
>

```
