My first thought: since darcs are simpler than git (i.e. there are no branches and consoles), instead you just use directories and URLs, and it is your task to manage them), the dark submodule will not give you more what you can achieve with standard things like subdirectories or files inside you darcs repo.
If you need a submodule to fix the specific state of the source of the library you are using, you could just put a copy of the repo in the library as a subdir and add it to the darcs project. Compared to git, this will have the disadvantage of inflating data transfer when someone gets your repo.
If you need a submodule to tell those who receive your repo where to get the updated library source (without inflating the size of your repo), you can simply put the URL and instruction in a README file, or script, or something else. Compared to git, the disadvantage is that the state of the library source, as it was when you used it, will not be recorded in your commit, so people can get a different version of the library and the compilation will not work, and it would not be clear why.
So, the really interesting goal of the submodule can be not only to tell people where to get the source of the library from (as you write in the question), but also to record the state of the subproject that you actually used to compile your project, rather than inflate your repo for those who donβt wants to get the source of the subproject.
Perhaps this goal can also be achieved by storing more complex metadata about the state of the subproject and a more complex hook to get exactly that state (or, optionally, another state) of the subproject. AFAIK from documents, for such submodules there is no built-in mechanism.
Update (found on darcs website):
So the darks will notice another darcs reporter in your work, and he will not touch it. Therefore, the first method that I suggested above is closed (if you leave darcs metadata there).
The second method is similar to that proposed in one of the sections of the last link. (They offer an "uglu" script for something like this.)
Another (3rd) idea
Import the fixes from the repo that you intend to use as a submodule, but first move all the files to the subdirectory. If you could just apply such a movable special patch once, and if it was effective for all patches, you import from the repo intended as a submodule, but not for the patches that you import from the "branch", the main repo ...
... well, it could be a special version of the pull
command (say import
) and the push
command (say export
), which will additionally translate the paths accordingly.
imz - Ivan Zakharyaschev
source share