Jens Lehmann <Jens.Lehmann@xxxxxx> writes: > Don't record a commit in the first place, following a branch is not bound > to a special commit, so pretending to do that might do more harm than good. > Just putting the 0-hash there might be the solution. Ugh. Even though I understand that in some scenarios you would want to say "I don't care what commit is used for this submodule---just use the tip of the branch 'fred'", I don't think you want to use 0{40} in the superproject. I think it would be Ok to add such a note to .gitmodules in the superproject, but I also think we should still record which _exact_ commit was used to test and validate such a commit in the superproject when it was made. If you clone a superproject that contains such a submodule from an upstream, keeping them up-to-date while working on your own change, it is perfectly fine to choose to use whatever random commit that happens to be at the tip of 'fred' branch in a submodule (and needless to say, that commit might be your own commit that nobody else has, if you have been actively working in that submodule, that you haven't published), that is different from what the person who created the commit in the superproject had. But at least you would need to be able to tell that the result of a build from such a state is different from what the superproject had. Recording 0{40} would make the information contained in the superproject tree meaningless. Wouldn't it be enough to say --ignore-submodules for your day-to-day work, without lying in the gitlink entry in the superproject tree? An entry "submodule.foo.branch = fred" in your .gitmodules will still tell your local git to update the submodule worktree to work on 'fred' branch. At least, an arrangement like that would allow the build infrastructure to use --no-ignore-submodules when running its equivalent of GIT-VERSION-GEN to notice that what you are building is using something different from what the superproject specified to use in the submodule, while not bugging you with differences you do not care about (or you already know about and are irrelevant to the change you are working on). -- To unsubscribe from this list: send the line "unsubscribe git" in the body of a message to majordomo@xxxxxxxxxxxxxxx More majordomo info at http://vger.kernel.org/majordomo-info.html