You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Replacing shas in raw text fields based on the first 7 chars #9
Currently, all comparisons are done against the full text of the sha in the json objects vs the old sha in the commit-map. While this is valid for specified sha json object fields, there are certain raw text fields in GitHub that will reference short shas. An example would be in the body of an issue where the author can specify the full sha 7b72e8e the short sha 7b72e8e or anything in between 7b72e8e and GitHub will link to that commit. Anything less than 7 chars is considered not unique enough, and won't be linked 7b72. I would propose:
Identify raw text fields in the metadata files (ex: issue body text) that should be replaced
Add an optional bool flag --replace-text, -r defaulted to false that would give users the option whether to replace shas in these fields
Change the comparison to only compare the first 7 chars of a metadata sha field with the first 7 chars of the commit-map sha field, and replace the value equal to the length of metadata sha with the equivalent length of the old sha
Split the metadata text fields (probably on non-hex characters?) and compare the first 7 chars of each value with the first 7 of the old sha and replace the value equal to the length of metadata sha with the equivalent length of the old sha
changed the title [-]Compare the first 7 characters of the SHA in other fields[/-][+]Replacing shas in raw text fields based on the first 7 chars[/+]on Sep 6, 2024
Activity
[-]Compare the first 7 characters of the SHA in other fields[/-][+]Replacing shas in raw text fields based on the first 7 chars[/+]