Hacker News new | past | comments | ask | show | jobs | submit login

Great release. Submodules are bad practice riddled with problems, I think it wouldn't be bad to remove this feature at all, that way no-one will be have an option to use it.



I use submodules and they work fine. What is so bad about them that I shouldn't be using them?


Here's some good posts about submodules and alternatives, so you can make up your own mind:

http://blogs.atlassian.com/2013/05/alternatives-to-git-submo...

https://codingkilledthecat.wordpress.com/2012/04/28/why-your...


From what I've gathered skimming the numerous blog posts venting about submodules, it seems that people have trouble with submodules because they are trying to integrate them into a workflow they work poorly in (i.e., rapidly changing modules). There seems to be room for improvement for that type of usage, given what people are saying, but I wonder if there have been any changes to submodules since those posts (many of them are dated around 2011-2012).

My own positive experience with submodules involves dependencies that only occasionally change; I can always point to a specific tag that should be used.


Yes.

One should avoid to extract a component from the repo as a submodule too early, i.e when the interface of the component is not mostly stabilized.

If each commit in your "main" module is paired with a commit in your submodules, then you might be missing the point of module separation.


Even if the interface is stabilized, when you update implementation of a submodule you will still have to recursively update all submodules from main down to the changed module.


How do you point to a specific tag? Do you set branch : (tag)?


I've used submodules in multiple projects and haven't had any problems beyond standard git annoyances.


How do you share code between projects/teams then? How do you work on several branches simultaneously, each of them requiring a different version of their dependencies?


How do you handle submodules having the same version of their dependencies (diamond dependencies)? You will get tons of, not just redundant, but also conflicting duplicates. In many environments include dirs and such dont follow the file system hierarchy.

Git is not a package manager, don't make the mistake of trying to use it as one.




Consider applying for YC's Spring batch! Applications are open till Feb 11.

Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: