scancode-toolkit icon indicating copy to clipboard operation
scancode-toolkit copied to clipboard

Add Git blob sha1 to checksums returned with info

Open pombredanne opened this issue 9 years ago • 7 comments

This can be handy for identification in a Git context

pombredanne avatar May 22 '17 18:05 pombredanne

I would like to take this issue @pombredanne , appart from just including in the final data, do you want me to also take care of all the formats and include git blob sha1 whenever using -i flag

Chaitya62 avatar Jan 26 '18 16:01 Chaitya62

@pombredanne Please review the PR #902 and let me know the changes whenever you can.

Chaitya62 avatar Feb 02 '18 11:02 Chaitya62

Hii @pombredanne sir, I am new to open source, I would like to solve this issue, can you please guide me through how can I help with this issue.

D-lang14 avatar Dec 08 '20 04:12 D-lang14

@D-lang14 sorry for the late reply! The checksum computation is in commncode.hash alright, therefore this would mean adding this in the scan for --info here https://github.com/nexB/scancode-toolkit/blob/cce8cbc64746ed58f2f0a9bf03d6c3500bd7cc1c/src/scancode/api.py#L322 ... plu fixing all the tests

pombredanne avatar Feb 10 '21 09:02 pombredanne

One more motivation to address this is that Software Heritage actually uses Git-blob-style SHA1s, too, also to identify content that was not originally stored in Git!

sschuberth avatar Mar 05 '21 15:03 sschuberth

@AyanSinhaMahapatra we should schedule this in the next release

pombredanne avatar Jun 11 '25 08:06 pombredanne

We already had this functionality in commoncode.hash with https://github.com/aboutcode-org/scancode-toolkit/commit/2c4f3cd7cfc74f93ec6813f161cb1c8e09b8130b, now this is being returned for all the files using --info plugin, along with other checksums we already returned. See https://github.com/aboutcode-org/scancode-toolkit/pull/4425

AyanSinhaMahapatra avatar Jun 11 '25 12:06 AyanSinhaMahapatra