我正在處理父級過濾器,並且需要(可能)重寫當前修訂版本父級的修訂版本ID。我這個人的網頁上看到,有一個地圖功能可用,可以採取照顧:git filter-branch:如何使用map函數?
A map function is available that takes an "original sha1 id" argument and outputs a "rewritten sha1 id" if the commit has been already rewritten, and "original sha1 id" otherwise; the map function can return several ids on separate lines if your commit filter emitted multiple commits.
然而,當我嘗試使用它在我父過濾腳本(一bash-基於腳本)的功能不可用:
我在我的代碼有這樣的:
echo Finding mapping of revision $i >&2
map $i >&2
echo done >&2
結果時處理:
Finding mapping of revision e73bf9db5c4ce2fb1970c90e3a24a2ff004ec3fe
rewrite_svn_parent.sh: line 44: map: command not found
done
理想情況下,我會這樣做:NEW_ID=$(map $i)
但只要功能不是可用,不能做太多。
https://git-scm.com/docs/git-filter-branch