-
Notifications
You must be signed in to change notification settings - Fork 839
Open
Description
Version: 2.47.0 (pip install into venv)
OS: Ubuntu 22.04.5 LTS
Python 3.10.12
git version 2.34.1
file: callback.py
def commit_callback(c):
with open("bananas.txt", "a") as f:
f.write("BANANA!\n")
git clone --mirror ...
git filter-repo --commit-callback ./callback.py --force
Output:
Parsed 837 commits
New history written in 0.01 seconds; now repacking/cleaning...
Repacking your repo and cleaning out old unneeded objects
[...]
Completely finished after 0.06 seconds.
But no "bananas.txt" at all. If I just do this:
def commit_callback(c):
raise "AAAA!"
Still the same "clean" output: parsed NNN commits etc. OK, let's do exactly as documentation says:
git filter-repo --commit-callback 'raise Exception("banana")'
Traceback (most recent call last):
[...]
self._commit_callback(commit, self.callback_metadata(aux_info))
File "<string>", line 2, in callback
Exception: banana
OK, we're getting somewhere. How about this:
git filter-repo --commit-callback 'def commit_callback(c): open("bananas.txt", "a").write("BANANA!\n")' --force
Parsed 837 commits
New history written in 0.01 seconds; now repacking/cleaning...
Repacking your repo and cleaning out old unneeded objects
[...]
Completely finished after 0.06 seconds.
OK, I give up, this just makes zero sense to me.
- What I am doing wrong?
- Why this tool crashes/ignores silently and doesn't say anything with regard of given python script?
- How to define
commit_callback
so I can change the commit data (can't find doc, BTW)?
Metadata
Metadata
Assignees
Labels
No labels