[git] confusion setting moduler-boost to 'master'
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. So I try: git reset --hard master git submodule foreach --recursive git reset --hard master But still the end result is that git has marked each submodule as 'dirty' and needing to commit. Anybody have any ideas how I straighten out this mess ?
On 11 August 2014 19:37, Edward Diener
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.
So I try:
git reset --hard master git submodule foreach --recursive git reset --hard master
I expect that's your local master branch which is probably out of date, not master from the server.
But still the end result is that git has marked each submodule as 'dirty' and needing to commit.
Anybody have any ideas how I straighten out this mess ?
git submodule update --init
On 8/11/2014 2:44 PM, Daniel James wrote:
On 11 August 2014 19:37, Edward Diener
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.
So I try:
git reset --hard master git submodule foreach --recursive git reset --hard master
I expect that's your local master branch which is probably out of date, not master from the server.
But still the end result is that git has marked each submodule as 'dirty' and needing to commit.
Anybody have any ideas how I straighten out this mess ?
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) # modified: libs/assign (untracked content) # modified: libs/bimap (untracked content) # modified: libs/bind (untracked content) # modified: libs/chrono (untracked content) # modified: libs/config (untracked content) # modified: libs/container (untracked content) # modified: libs/conversion (untracked content) # modified: libs/flyweight (untracked content) # modified: libs/foreach (untracked content) # modified: libs/function (untracked content) # modified: libs/function_types (untracked content) # modified: libs/functional (untracked content) # modified: libs/fusion (untracked content) # modified: libs/geometry (untracked content) # modified: libs/gil (untracked content) # modified: libs/graph (untracked content) # modified: libs/interprocess (untracked content) # modified: libs/intrusive (untracked content) # modified: libs/iostreams (untracked content) # modified: libs/lambda (untracked content) # modified: libs/local_function (untracked content) # modified: libs/log (untracked content) # modified: libs/mpl (untracked content) # modified: libs/msm (untracked content) # modified: libs/multi_index (untracked content) # modified: libs/numeric/conversion (untracked content) # modified: libs/parameter (untracked content) # modified: libs/phoenix (untracked content) # modified: libs/polygon (untracked content) # modified: libs/preprocessor (untracked content) # modified: libs/proto (untracked content) # modified: libs/python (untracked content) # modified: libs/range (untracked content) # modified: libs/regex (untracked content) # modified: libs/scope_exit (untracked content) # modified: libs/serialization (untracked content) # modified: libs/signals2 (untracked content) # modified: libs/spirit (untracked content) # modified: libs/test (untracked content) # modified: libs/thread (untracked content) # modified: libs/tti (untracked content) # modified: libs/type_erasure (untracked content) # modified: libs/type_traits (untracked content) # modified: libs/typeof (untracked content) # modified: libs/units (untracked content) # modified: libs/unordered (untracked content) # modified: libs/utility (untracked content) # modified: libs/variant (untracked content) # modified: libs/wave (untracked content) # modified: libs/xpressive (untracked content) # modified: tools/auto_index (untracked content) # modified: tools/boostdep (untracked content) # modified: tools/build (untracked content) # # Untracked files: # (use "git add <file>..." to include in what will be committed) # # b2.exe # bjam.exe # doc/pdf/Jamfile.v2~ # doc/pdf/bout.txt # libs/convert/ # libs/dist/ # libs/fiber/ # libs/gitdiffvd.txt # libs/hana/ # libs/is_begin_parens.hpp # libs/is_functional/ # libs/pimpl/ # libs/preshell/ # libs/property/ # libs/sqlpp11/ # libs/sync/ # libs/vmd/ # libs/xtra/ # sh.exe.stackdump no changes added to commit (use "git add" and/or "git commit -a")
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. Am I missing something here or does git actually assume changes have been made merely because untracked files exist in a working directory folder. I thought I understood git ( mostly ) but now I do not think I will ever really understand git <g>. C++ is so much easier <g><g>.
On 11 August 2014 21:54, Edward Diener
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. Am I missing something here or does git actually assume changes have been made merely because untracked files exist in a working directory folder.
It normally does that, probably under the assumption that any differences could be important. You can use 'git status --ignore-submodules=untracked' to stop it doing that. And to set it permanently you can use 'git config --global diff.ignoreSubmodules untracked'. I don't know what the equivalent is for Tortoise Git.
"Edward Diener"
On 8/11/2014 2:44 PM, Daniel James wrote:
On 11 August 2014 19:37, Edward Diener
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
participants (3)
-
Daniel James
-
Edward Diener
-
Niklas Angare