aspiers / git-deps

git commit dependency analysis tool
GNU General Public License v2.0
298 stars 47 forks source link

CLI: exclude-commits functionality broken #34

Closed sbromling closed 9 years ago

sbromling commented 9 years ago

The -e/--exclude-commits functionality depends on branch_contains().

branch_contains unconditionally truncates sha1 to an 8 character prefix. This is potentially problematic by itself.

However, the more problematic issue in the function comes in the following test: "result = out == sha1". Here, 'out' comes from git-merge-base, which will give a complete sha1. This could be fixed by testing whether 'sha1' is a prefix of 'out', though given the potential issues inherent in chopping 'sha1' at 8 characters, it would probably be better to remove the "[:8]" from the start of the function.