Add Git (or other) commit ID and remote URL to raw files metadata
When raw files (eg. source files) are stored, the associated version-control metadata should be stored alongside.
In insert_source_files.js, a document is stored as follows in the RawSourcecode collection:
var document = { "filename": val, "filecontent": content_string };
Additional attributes should be added, for example as follows:
var document = { "filename": val, "remoteUrl": url, "commitId": commitHash, "filecontent": content_string };
Remote URL can be obtained as follows (on a GIT repository):
$ git remote get-url origin
https://gitlab.ow2.org/gibello/decoder.git
Commit Hash can be obtained as follows (on a GIT repository):
$ git log -n 1 --pretty=format:%H -- src/main/java/eu/decoder/java8lexer/OW2JavaConverter.java
d6df2dfc58cf5f9672dde95f94ef51cc4b0db68f
These commands can be added to insert_source_files script in order to fill in corresponding parameter values for insert_source_files.js ? At least, if "git remote" returns something, then git metadata could be added by default.