-
-
Notifications
You must be signed in to change notification settings - Fork 139
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Modified files are not fetched for merge commits #89
Comments
Hi @greninja! Thank you for opening the issue!
This is because when using
In this case, what do you think was modified in What do you think GitHub will show? Why pydriller doesn't show it?Because if you analyse the history of a project, you'll see something like:
So So, which files are modified in the merge commit?The so called "conflicts". Those are the files that, when merging 2 commits, you actually have to modify (and resolve the conflict) before committing. Why pydriller is not presenting them?Because I can't find a way to parse them. If you notice, the output of a combined diff is a bit different than a unified diff. There are N columns (where N=#parents), each one of them showing what is different from the other branches. For example, you can see that there are these kind of lines:
so "- " means deleted from the left branch, " +" added in the right branch, "--" deleted in both", etc.. So, until someone will build a parser for combined diffs, Pydriller will just ignore merge conflicts. I hope I was clear enough for you to understand! |
Hey @ishepard, that was a really lucid explanation! thanks! |
I had this problem too, but I may have found a solution:
For me this shows all the files affected by a merge commit, I don't know the internals of pydriller well enough but I wonder if this might be usable. If this is an easy first PR I'm happy to contribute. |
Describe the bug
I fetched all the commits from a repository using the standard
commits = list(RepositoryMining(repo_path).traverse_commits())
. It returns 2061 commits (as expected). Out of these, 331 commits are merged commits (for whichcommit.merge
is true). For these 331 merged commits, PyDriller returns an empty list of modified files, even though there are many files modified in those commits.To Reproduce
Eg: Commit number 115 (hash
13104b2651bed37c1eb238eacd09e05e5906534a
) in the above mentioned repository is a merged commit. And it has 14 modified files (with 556 additions and 176 deletions), but none of them show up incommit.modifications
.OS Version:
Linux Ubuntu 18.04
The text was updated successfully, but these errors were encountered: