Adds AnonGit to Developer Utilities#482
Conversation
|
Hello @radioactively Thank you for contributing to Awesome Privacy! We will review your submission shortly. In the meantime, please ensure all changes are correct and inline with our Contributing Requirements. Our automated checks detected some issues:
For full details, please see workflow run 24008505092 |
|
Ok, got it, will fix |
There was a problem hiding this comment.
It's looking good @radioactively!
You just need to put this in the right file tho (awesome-privacy.yml), because we generate the readme, website, API, etc from that YAML. So your changes would just get overriden. You can see how to do this in this section of the contributing guidelines.
For transparency, documenting this:
- The project is relatively new (our requirements state it should be 4 months since first stable release). I'm not too concerned here, since it is just one easily readable script - not something which can be rug pulled.
- AnonGit has a lot of dangers involved (messing up your tree), however this is all well documented in the repo, and the script does include basic safety checks.
- The code is, at least partly AI-generated/assisted (as denoted by overly verbose code, heavily sectioned file, long implementation explanations). Likely fine, as it is still human-readable, but author should take a lot of care with maintaining it, as it could very quickly become unmanageable otherwise.
And a few suggestions from the latest version:
- The script requires Python, and so won't work in any systems/containers without Python 3.6+ installed, maybe worth documenting that
- In terms of security, there is room for improvement around sanitizing untrusted input, to prevent it including escape characters and executing arbitury code.
- I think there's a few logic errors:
- Some of the naming and docs is slightly wrong, like
--entire-historyis actually only rewriting the currentHEADand not the repos history. - Lot's of the status messages are backwards (like
if [[ -n "$KEEPUSER_ARG" ]]; thendoes the opposite) - examples in the help text are wrong (like
aftershould be git long op of--after) - date offset is wrong (
offset_seconds // 60gives minutes not hours) - file ends in .sh but examples don't include extension
- Some flags do different to the help text (like
--keep-yearsays "do not change commit year" but it actually forces month=1, day=1) - Puts illegal characters like colon into branch ref
- Don't use
dateas a variable name in bash, it's usually a command - Some actions ocour before the confirmation (like branches get made before the confirmation)
- Some of the naming and docs is slightly wrong, like
|
Writing a fully-featured CLI tool in Bash is hard. It's a very verbose language, and behaves very differently across different shells and user environments. I'm curious why you chose it, when the script already assumes Python is installed? A high-level language could be much easier, shorter, safer and more reliable. But maybe a full script isn't even needed? An alternative approach to AnonGit is to just add a few lines to your gitconfig: [user]
name = anon
email = anon@users.noreply.codeberg.org
signingkey = ABCD1234EF567890
[alias]
canon = "!GIT_AUTHOR_DATE='2008-10-31 00:00:00 +0000' GIT_COMMITTER_DATE=\"$GIT_AUTHOR_DATE\" git commit"Then, when you go to commit, you'd run: git canon -m "my super cool commit"This gives you anon author, GPG support, and custom committer and author dates. And you can have per-project And, if you ever did need a quick 'n dirty way to re-write those previous commits to remove the name/email/timestamp, then you could just write a one-off one-liner, something like: git filter-repo \
--mailmap <(printf 'anon <anon@users.noreply.codeberg.org> <old@example.com>\n') \
--commit-callback 'commit.author_date = b"1225411200 +0000" commit.committer_date = b"1225411200 +0000"' |
|
hi @lissy93 thanks for the answer. Sorry for the late reply I have been extremely busy. Thanks for all the points/recommendations/suggestions you made, I'll reply carefully and appreciate them because they help improve the project. |
Type
Addition.
Changes
Adds AnonGit to Developer Utilities.
Supporting Material
Source Code.
Affiliation
Author.
Checklist