Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

value.get_contents_by_identifier in --file-info-callback always return None #628

Closed
xNoga opened this issue Jan 9, 2025 · 3 comments
Closed

Comments

@xNoga
Copy link

xNoga commented Jan 9, 2025

I'm trying out the new --file-info-callback flag since it's exactly what I need.
However, the contents of the files are always None.

Also, when passing the code exactly from the manual, I get an error saying:

File "/usr/local/bin/git-filter-repo", line 2933, in get_contents_by_identifier
    self._cat_file_process.stdin.write(b'contents '+blobhash+b'\n')
TypeError: can't concat int to bytes

This is solved by converting blob_id to a bytestring before passing to value.get_contents_by_identifier, but I'm unsure if this is the reason why contents is always None.

Here's the command I'm running:

git-filter-repo \
    --state-branch _filter_state \
    --source src \
    --target dst \
    --file-info-callback "$(cat file-info-callback.py)" \
    --replace-text replace-text.txt \
    --force \
    --debug \
    --refs main

Any idea what could be causing this?

@xNoga
Copy link
Author

xNoga commented Jan 9, 2025

Ah, it seems that callback only works without the --source and --target flags. Is this to be expected?

@xNoga
Copy link
Author

xNoga commented Jan 10, 2025

It also doesn't work with the --state-branch flag.

@xNoga
Copy link
Author

xNoga commented Jan 29, 2025

I managed to solve my use-case with --blob-callback instead. I don't think --file-info-callback is supposed to work with --state-branch.

@xNoga xNoga closed this as not planned Won't fix, can't repro, duplicate, stale Jan 29, 2025
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

No branches or pull requests

1 participant