git-changelog-lib
git-changelog-lib copied to clipboard
Submodule support
Hello, this is for #52
I'm not too sure how to correctly support submodules, to be honest, but this seems to be working for my use case: pushing tags on each build for the parent repository and its submodules, in other words, we rely on tags being the same across the repository.
What do you think?
I have also added a simple check for when toRef and fromRef are the same, #62 - in this case we return an empty list of tags.
I'll put this on my todo-list.
I have a better idea on how to handle submodules. Instead of relying on specified refs to exist in all submodules, how about simply returning the diff between the current and the previous submodule hashes?
E.g. in the parent repo, we have commits A, B, C And in a submodule we have commits D, E and F A -> D B -> D C -> F
When diffing between A and C, we will also show the diff between D and F for commit C
Sounds good!
Great, I'll update the pull request once I have it working.
How does this look? I've opted out of having submodule changes per commit, as it makes the changelog too noisy, especially when mulitiple commits reference the same changes in submodules, e.g. via branch merges.
Instead, I diff submodules between the earliest and the latest commit mentioned in the parent repository for any given diffset.
This is on my todo-list. Will have a look later.
This might work, but I have very limited time right now so need to be more complete. Needs test cases. The stuff that is added to GitRepo
can probably be refactored out of there with a describing name for it.
Hi @tomasbjerre , I have added a couple of test cases.
The stuff that is added to GitRepo can probably be refactored out of there with a describing name for it.
Something like GitRepoWithSubmodules class that inherits from GitRepo? Or is there an easier way to get access to repository and revWalk class members from GitRepo, as submodule functionality makes use of those?