newren/git-filter-repo

Document that --refs parameters cannot start with a hyphen

Open

#469 opened on May 20, 2023

View on GitHub
 (6 comments) (0 reactions) (0 assignees)Python (674 forks)batch import
docsgood first issue

Repository metrics

Stars
 (6,745 stars)
PR merge metrics
 (Avg merge 44d 2h) (1 merged PR in 30d)

Description

Found beside another issue: https://github.com/newren/git-filter-repo/issues/468

If use --refs as range parameter just like in the git filter-branch:

git-filter-repo-replace-text.sh:

function call()
{
  local IFS=$' \t'
  echo ">$*"
  "$@"
}

expressions_text="$1"

TEMP_OUTPUT_FILE=`mktemp -t git_filter_repo_update_file_text.XXXXXXXXXX`

# cleanup on return
trap "rm -rf \"$TEMP_OUTPUT_FILE\" 2> /dev/null; trap - RETURN" RETURN

call git-filter-repo-replace-text --replace-text "$TEMP_OUTPUT_FILE" "${@:2}"
git-filter-repo-replace-text "<p/>==></p>" --refs master --not t1^@
>git filter-repo --replace-text /tmp/git_filter_repo_update_file_text.wSOPH7Vu7j --refs master --not t1^@
git-filter-repo: error: unrecognized arguments: --not t1^@

I know it has to be a bit corrected:

git-filter-repo-replace-text.sh "<p/>==></p>" --refs master ^t1^@

But nevertheless --refs is not completely compatible with the git rev-list format.

Contributor guide