tdurieux / anonymous_github

Anonymous Github is a proxy server to support anonymous browsing of Github repositories for open-science code and data.
https://anonymous.4open.science/
GNU General Public License v3.0
1.38k stars 55 forks source link

Custom anonymization output per search term #285

Open Mnaukal opened 4 months ago

Mnaukal commented 4 months ago

It would be useful to be able to customize the anonymization output (XXXX-[Line Number]) per search term. The desired output should be set from the user interface when anonymizing a repo.

For example, if I want to replace two terms: Anonymous and GitHub, they currently get replaced with XXXX-1 and XXXX-2, respectively. I would like to be able to set that Anonymous should be replaced with XXX, and GitHub should be replaced with ABC.

This would be useful because it would make the alignment of the repo and the paper easier. If I want to use the same anonymized terms in the repo and the paper, I currently need to use XXXX-[Line Number] in both, which can be confusing and hard to read in the text of the paper. I would prefer something simpler, like ABC and XYZ in the text of the paper. Another disadvantage of the current XXXX-[Line Number] replacement output is that it contains a hyphen, which can break source code as the hyphen is usually not a valid character in a variable name.

Thank you very much for considering this suggestion. Your tool is great and makes it easy to anonymize a repo.

tdurieux commented 4 months ago

Good idea, unfortunately, it will require quite a lot of rework on the service to be able to allow this. I am not sure when I will be able to implement this. If you have time to implement it please do a PR.

tobiaswjohn commented 1 month ago

I just had the issue that the hyphen in the anonymization output breaks my source code. So for me, it would already be helpful to specify the string before [Line Number]. Maybe this is simpler to implement and it would already help in some instances.