>> $ ARRAY=( $(git ls-tree HEAD AUTHORS.rst) ) ; echo ${ARRAY[2]}
>> d89c7ba9918d7fe249875ac44b8c61cb11cac4ac
>>
>> So, this way you not only get the hash before keyword expansion is done, you
>> also get the hash for free since it's already known by the VCS.
>>
>> The downside is that this internal hash is specific to the VCS, so it only
>> helps to identify the same file in other repos of the same VCS. But
>> for other VCS you could go with Philippe's option 2 and calculate the file
>> hash like Git does internally [2].
>
>
>This is an interesting and intriguing approach :) As far as I know this is
>also more or less the approach taken by Stefano "zack" Zacchiroli and
>team for software heritage... [4] [5] But this is practical only for Git and
>Hg OR if you import in Git or Hg, right?
Well, I'm not sure. I guess other systems like SVN would also use some kind of
internal per-file hash for integrtity checks, but they might not expose it via
their tooling like Git does.
Regards,
Sebastian
_______________________________________________
Spdx-tech mailing list
[email protected]
https://lists.spdx.org/mailman/listinfo/spdx-tech