newren/git-filter-repo

Document that --refs parameters cannot start with a hyphen

Open

#469 aperta il 20 mag 2023

Vedi su GitHub
 (6 commenti) (0 reazioni) (0 assegnatari)Python (674 fork)batch import
docsgood first issue

Metriche repository

Star
 (6745 star)
Metriche merge PR
 (Merge medio 44g 2h) (1 PR mergiata in 30 g)

Descrizione

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.

Guida contributor