Boost logo

Boost :

Subject: Re: [boost] [git] confusion setting moduler-boost to 'master'
From: Niklas Angare (li51ckf02_at_[hidden])
Date: 2014-08-13 12:25:03


"Edward Diener" <eldiener_at_[hidden]> wrote:
> On 8/11/2014 2:44 PM, Daniel James wrote:
>> On 11 August 2014 19:37, Edward Diener <eldiener_at_[hidden]> wrote:
>>> Somehow my local modular-boost is confused. I have set the top-level to
>>> 'master' and each of the sub-modules to 'master'. Yet git still shows it
>>> wants to commit each of the submodules at the library level as all are
>>> marked dirty.

Each commit of the main repository points to a commit in each of the
submodules. Branches in the submodules are ignored. If you make each
submodule HEAD point to the most recent commit on a particular branch in
each respective submodule, there's a chance that it's not the same commit
that the HEAD of the main repository points to. The command to make the HEAD
of each submodule point to the commit that the main HEAD points to is 'git
submodule update'.

>>> So I try:
>>>
>>> git reset --hard master
>>> git submodule foreach --recursive git reset --hard master

These commands change the current branch to point to the latest commit on
the given branch (as well as your intended action of discarding changes in
the working tree and index). That's quite dangerous and not what you want.

Since you may have ruined your local branches with 'git reset --hard
<branch>', you may need to fix them. Run 'git reflog <branch>' on all your
local branches to check. Any lines with 'reset: moving to xxx' indicate it's
happened. If you care about your local branches in submodules you would have
to check them individually as well.

>> git submodule update --init
>
> Did not solve anything. It could be a Tortoise Git problem. I tried 'git
> status':
>
>> # On branch master
>> # Changes not staged for commit:
>> # (use "git add <file>..." to update what will be committed)
>> # (use "git checkout -- <file>..." to discard changes in working
>> directory)
>> # (commit or discard the untracked or modified content in submodules)
>> #
>> # modified: libs/accumulators (untracked content)
>> # modified: libs/algorithm (untracked content)
...
> Is this normal ? It looks like git is saying that the submodules are
> modified because they have untracked content. I thought that if you have
> untracked files in a working directory git does not act like you have
> modified anything since the untracked files are not part of the local
> repository.

'git status' will show you untracked files that it's not been told to ignore
by the .gitignore files. In the case of Boost it may be that the .gitignore
files are incomplete. You can get more details for the submodules with 'git
submodule foreach "git status"'.

To clean untracked and unignored files from all submodules, run 'git
submodule foreach "git clean -f"'. Don't run this if you've added but not
committed files yourself.

Regards,

Niklas Angare
 


Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk