diff options
author | Junio C Hamano <gitster@pobox.com> | 2007-07-03 07:52:14 +0200 |
---|---|---|
committer | Junio C Hamano <gitster@pobox.com> | 2007-07-03 07:52:14 +0200 |
commit | 5be60078c935ed08ee8eb5a32680bdfb6bb5bdf3 (patch) | |
tree | 9f68d81a31f8dfe7af6096e7beac2dc0997c143a /git-filter-branch.sh | |
parent | Start deprecating "git-command" in favor of "git command" (diff) | |
download | git-5be60078c935ed08ee8eb5a32680bdfb6bb5bdf3.tar.xz git-5be60078c935ed08ee8eb5a32680bdfb6bb5bdf3.zip |
Rewrite "git-frotz" to "git frotz"
This uses the remove-dashes target to replace "git-frotz" to "git frotz".
Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 'git-filter-branch.sh')
-rw-r--r-- | git-filter-branch.sh | 50 |
1 files changed, 25 insertions, 25 deletions
diff --git a/git-filter-branch.sh b/git-filter-branch.sh index e9907598e5..3772951aa7 100644 --- a/git-filter-branch.sh +++ b/git-filter-branch.sh @@ -81,7 +81,7 @@ # This is the filter for rewriting the commit's parent list. # It will receive the parent string on stdin and shall output # the new parent string on stdout. The parent string is in -# format accepted by `git-commit-tree`: empty for initial +# format accepted by `git commit-tree`: empty for initial # commit, "-p parent" for a normal commit and "-p parent1 # -p parent2 -p parent3 ..." for a merge commit. # @@ -93,7 +93,7 @@ # # --commit-filter COMMAND:: The filter for performing the commit # If this filter is passed, it will be called instead of the -# `git-commit-tree` command, with those arguments: +# `git commit-tree` command, with those arguments: # # TREE_ID [-p PARENT_COMMIT_ID]... # @@ -132,7 +132,7 @@ # # A significantly faster version: # -# git-filter-branch --index-filter 'git-update-index --remove filename' newbranch +# git-filter-branch --index-filter 'git update-index --remove filename' newbranch # # Now, you will get the rewritten history saved in the branch 'newbranch' # (your current branch is left untouched). @@ -151,7 +151,7 @@ # # To remove commits authored by "Darl McBribe" from the history: # -# git-filter-branch --commit-filter 'if [ "$GIT_AUTHOR_NAME" = "Darl McBribe" ]; then shift; while [ -n "$1" ]; do shift; echo "$1"; shift; done; else git-commit-tree "$@"; fi' newbranch +# git-filter-branch --commit-filter 'if [ "$GIT_AUTHOR_NAME" = "Darl McBribe" ]; then shift; while [ -n "$1" ]; do shift; echo "$1"; shift; done; else git commit-tree "$@"; fi' newbranch # # (the shift magic first throws away the tree id and then the -p # parameters). Note that this handles merges properly! In case Darl @@ -182,9 +182,9 @@ # To move the whole tree into a subdirectory, or remove it from there: # # git-filter-branch --index-filter \ -# 'git-ls-files -s | sed "s-\t-&newsubdir/-" | +# 'git ls-files -s | sed "s-\t-&newsubdir/-" | # GIT_INDEX_FILE=$GIT_INDEX_FILE.new \ -# git-update-index --index-info && +# git update-index --index-info && # mv $GIT_INDEX_FILE.new $GIT_INDEX_FILE' directorymoved # Testsuite: TODO @@ -240,7 +240,7 @@ filter_tree= filter_index= filter_parent= filter_msg=cat -filter_commit='git-commit-tree "$@"' +filter_commit='git commit-tree "$@"' filter_tag_name= filter_subdir= while case "$#" in 0) usage;; esac @@ -300,7 +300,7 @@ done dstbranch="$1" shift test -n "$dstbranch" || die "missing branch name" -git-show-ref "refs/heads/$dstbranch" 2> /dev/null && +git show-ref "refs/heads/$dstbranch" 2> /dev/null && die "branch $dstbranch already exists" test ! -e "$tempdir" || die "$tempdir already exists, please remove it" @@ -318,7 +318,7 @@ esac export GIT_DIR GIT_WORK_TREE=. export GIT_INDEX_FILE="$(pwd)/../index" -git-read-tree # seed the index file +git read-tree # seed the index file ret=0 @@ -327,11 +327,11 @@ mkdir ../map # map old->new commit ids for rewriting parents case "$filter_subdir" in "") - git-rev-list --reverse --topo-order --default HEAD \ + git rev-list --reverse --topo-order --default HEAD \ --parents "$@" ;; *) - git-rev-list --reverse --topo-order --default HEAD \ + git rev-list --reverse --topo-order --default HEAD \ --parents --full-history "$@" -- "$filter_subdir" esac > ../revs commits=$(cat ../revs | wc -l | tr -d " ") @@ -345,29 +345,29 @@ while read commit parents; do case "$filter_subdir" in "") - git-read-tree -i -m $commit + git read-tree -i -m $commit ;; *) - git-read-tree -i -m $commit:"$filter_subdir" + git read-tree -i -m $commit:"$filter_subdir" esac export GIT_COMMIT=$commit - git-cat-file commit "$commit" >../commit + git cat-file commit "$commit" >../commit eval "$(set_ident AUTHOR <../commit)" eval "$(set_ident COMMITTER <../commit)" eval "$filter_env" < /dev/null if [ "$filter_tree" ]; then - git-checkout-index -f -u -a + git checkout-index -f -u -a # files that $commit removed are now still in the working tree; # remove them, else they would be added again - git-ls-files -z --others | xargs -0 rm -f + git ls-files -z --others | xargs -0 rm -f eval "$filter_tree" < /dev/null - git-diff-index -r $commit | cut -f 2- | tr '\n' '\0' | \ - xargs -0 git-update-index --add --replace --remove - git-ls-files -z --others | \ - xargs -0 git-update-index --add --replace --remove + git diff-index -r $commit | cut -f 2- | tr '\n' '\0' | \ + xargs -0 git update-index --add --replace --remove + git ls-files -z --others | \ + xargs -0 git update-index --add --replace --remove fi eval "$filter_index" < /dev/null @@ -384,7 +384,7 @@ while read commit parents; do sed -e '1,/^$/d' <../commit | \ eval "$filter_msg" | \ - sh -c "$filter_commit" "git-commit-tree" $(git-write-tree) $parentstr | \ + sh -c "$filter_commit" "git commit-tree" $(git write-tree) $parentstr | \ tee ../map/$commit done <../revs @@ -395,7 +395,7 @@ case "$target_head" in echo Nothing rewritten ;; *) - git-update-ref refs/heads/"$dstbranch" $target_head + git update-ref refs/heads/"$dstbranch" $target_head if [ $(cat ../map/$src_head | wc -l) -gt 1 ]; then echo "WARNING: Your commit filter caused the head commit to expand to several rewritten commits. Only the first such commit was recorded as the current $dstbranch head but you will need to resolve the situation now (probably by manually merging the other commits). These are all the commits:" >&2 sed 's/^/ /' ../map/$src_head >&2 @@ -405,7 +405,7 @@ case "$target_head" in esac if [ "$filter_tag_name" ]; then - git-for-each-ref --format='%(objectname) %(objecttype) %(refname)' refs/tags | + git for-each-ref --format='%(objectname) %(objecttype) %(refname)' refs/tags | while read sha1 type ref; do ref="${ref#refs/tags/}" # XXX: Rewrite tagged trees as well? @@ -416,7 +416,7 @@ if [ "$filter_tag_name" ]; then if [ "$type" = "tag" ]; then # Dereference to a commit sha1t="$sha1" - sha1="$(git-rev-parse "$sha1"^{commit} 2>/dev/null)" || continue + sha1="$(git rev-parse "$sha1"^{commit} 2>/dev/null)" || continue fi [ -f "../map/$sha1" ] || continue @@ -431,7 +431,7 @@ if [ "$filter_tag_name" ]; then warn "unreferencing tag object $sha1t" fi - git-update-ref "refs/tags/$new_ref" "$new_sha1" + git update-ref "refs/tags/$new_ref" "$new_sha1" done fi |