bearlike / remove-git-email-leak

Find and remove publicly accessible git commit email addresses.
https://thekrishna.in/remove-git-email-leak/
MIT License
11 stars 1 forks source link

The email_fix Script does not runs on Windows #1

Closed FirePlank closed 2 years ago

FirePlank commented 2 years ago

Hey! Great project but when I try to run email_fix.py, it says this:

!! User must have write permissions for the repositories !!
!! Works only on parent branch !!
!! Commit hashes can be changed !!
1 out of 12 (FirePlank/Abstract-Art-Generator) ....
Cloning into 'Abstract-Art-Generator'...
remote: Enumerating objects: 38, done.
remote: Counting objects: 100% (38/38), done.
remote: Compressing objects: 100% (29/29), done.
remote: Total 38 (delta 16), reused 21 (delta 8), pack-reused 0
Receiving objects: 100% (38/38), 143.38 KiB | 1.00 MiB/s, done.
Resolving deltas: 100% (16/16), done.
Rewrite fb500f47c0614cb458f4526d310a3a34c128dba0 (1/7) (0 seconds passed, remaining 0 predicted)
C:/Program Files/Git/mingw64/libexec/git-core\git-filter-branch: eval: line 419: unexpected EOF while looking for matching ''
C:/Program Files/Git/mingw64/libexec/git-core\git-filter-branch: eval: line 420: syntax error: unexpected end of file
Traceback (most recent call last):
  File "[REDACTED]\find-fix-git-email-leak\email_fix.py", line 81, in <module>
    main()
  File "[REDACTED]\find-fix-git-email-leak\email_fix.py", line 76, in main
    rmtree(repo[0].split("/")[1])
  File "C:\Program Files\Python310\lib\shutil.py", line 739, in rmtree
    return _rmtree_unsafe(path, onerror)
  File "C:\Program Files\Python310\lib\shutil.py", line 612, in _rmtree_unsafe
    _rmtree_unsafe(fullname, onerror)
  File "C:\Program Files\Python310\lib\shutil.py", line 612, in _rmtree_unsafe
    _rmtree_unsafe(fullname, onerror)
  File "C:\Program Files\Python310\lib\shutil.py", line 612, in _rmtree_unsafe
    _rmtree_unsafe(fullname, onerror)
  File "C:\Program Files\Python310\lib\shutil.py", line 617, in _rmtree_unsafe
    onerror(os.unlink, fullname, sys.exc_info())
  File "C:\Program Files\Python310\lib\shutil.py", line 615, in _rmtree_unsafe
    os.unlink(fullname)
PermissionError: [WinError 5] Access is denied: 'Abstract-Art-Generator\\.git\\objects\\pack\\pack-0e6a925233ee98cb1c09e465f01973918bcc4bb4.idx'

I tried to run the python script as admin as well but the output did not change. How can I fix this?

FirePlank commented 2 years ago

Also I tried to edit the pack files outside of python and even transfered the file ownership but could not edit it.

bearlike commented 2 years ago

@FirePlank The Python script needs to run on a Linux system since we evaluate the bash command. If you're using Windows 10 and above, I recommend running Ubuntu via WSL. You can follow the documentation from Microsoft to install WSL. I'll update the repository to reflect the same.