Skip to content

Adds AnonGit to Developer Utilities#482

Open
radioactively wants to merge 1 commit into
lissy93:mainfrom
radioactively:anon-git
Open

Adds AnonGit to Developer Utilities#482
radioactively wants to merge 1 commit into
lissy93:mainfrom
radioactively:anon-git

Conversation

@radioactively
Copy link
Copy Markdown

Type

Addition.

Changes

Adds AnonGit to Developer Utilities.

Supporting Material

Source Code.

Affiliation

Author.

Checklist

  • I have read the Contributing guide, and confirmed my PR aligns with the requirements
  • I have performed a self-review (valid Markdown formatting, spelling, and grammar)
  • I have indicated whether I have any affiliation with any software / services added
  • I agree to follow the repositories Contributor Covenant Code of Conduct

@liss-bot
Copy link
Copy Markdown
Collaborator

liss-bot commented Apr 5, 2026

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:

  • Do not edit the README directly. This file is auto-generated from the content in awesome-privacy.yml, and so your changes will be overridden! Instead, only modify the YAML file, and be sure to follow our Contributing Guidelines.

🤖 I am a bot, and sometimes make mistakes. If you feel that any info here is incorrect or inaccurate, feel free to add a comment below with any corrections or justifications. This bot does not use AI, and just runs preliminary validation checks against submission requirements. Human review is still needed.

For full details, please see workflow run 24008505092

@radioactively
Copy link
Copy Markdown
Author

Ok, got it, will fix

Copy link
Copy Markdown
Owner

@lissy93 lissy93 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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-history is actually only rewriting the current HEAD and not the repos history.
    • Lot's of the status messages are backwards (like if [[ -n "$KEEPUSER_ARG" ]]; then does the opposite)
    • examples in the help text are wrong (like after should be git long op of --after)
    • date offset is wrong (offset_seconds // 60 gives minutes not hours)
    • file ends in .sh but examples don't include extension
    • Some flags do different to the help text (like --keep-year says "do not change commit year" but it actually forces month=1, day=1)
    • Puts illegal characters like colon into branch ref
    • Don't use date as a variable name in bash, it's usually a command
    • Some actions ocour before the confirmation (like branches get made before the confirmation)

@lissy93
Copy link
Copy Markdown
Owner

lissy93 commented Apr 7, 2026

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 .git/config's too. The benefit and disadvantage of this approach is that it doesn't re-write git history. So it's a slightly different use case to what AnonGit is trying to solve (historical commits), but is a lot safer and easier for ongoing work.

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"'

@radioactively
Copy link
Copy Markdown
Author

radioactively commented Apr 18, 2026

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants