warren830 commented on code in PR #3062:
URL: https://github.com/apache/incubator-devlake/pull/3062#discussion_r971496518
##########
plugins/gitextractor/parser/repo.go:
##########
@@ -329,15 +332,20 @@ func (r *GitRepo) storeCommitFilesFromDiff(commitSha
string, diff *git.Diff, com
commitFile = new(code.CommitFile)
commitFile.CommitSha = commitSha
commitFile.FilePath = file.NewFile.Path
- commitFile.Id = commitSha + ":" + file.NewFile.Path
+
+ // use commitSha and the sha256 of FilePath to create id
+ shaFilePath := sha256.New()
+ shaFilePath.Write([]byte(file.NewFile.Path))
+ commitFile.Id = commitSha + ":" +
hex.EncodeToString(shaFilePath.Sum(nil))
Review Comment:
please add `With some long path,the varchar(255) was not enough both ID and
file_path
So we use the hash to compress the path in ID and add length of file_path.`
to code
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]