Skip to content

Non interactive already_run logic? #656

Open
@samogot

Description

@samogot

I have a script that regularly (a cron job) filters a repo into a slimed version with public information only and pushes such filtered commits. Recently it stopped working and fails all the time because "Already Run" logic triggers and expect an input from stdin, which is not present at all. I tried removing the filter-repo/alread_run file in the script before running the filter-repo command, but for some reason it doesn't seem to work. I now added an echo N | git filter-repo ... and will see how it works next time, but even if it works - it does feel risky. What if there will be another unrelated interactive prompt, and I blindly enter N to it.

Can there be a non-interactive way to chose the decision for already run? Like a flag or env variable.

Also, I honestly don't know what should be the correct choice in my case. I've written this script several years ago and don't remember the details of how it works any more (or for example why did I have two separate filter-repo commands). For the refference, the relevant part of my script is:

# rm -f .git/modules/public_data/filter-repo/already_ran || true
echo N | git filter-repo --force --source . --target ../public_data --refs public..master --replace-refs update-and-add "${filter_repo_path_args[@]}"
git branch -f public
cd ../public_data
git filter-repo --partial --replace-refs update-and-add
git push origin master

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions