From 389817e529d80f2e375c8bec57eb2f9fa939abba Mon Sep 17 00:00:00 2001 From: Roland Date: Tue, 5 Apr 2011 19:45:05 +0200 Subject: [PATCH] add warning message to git-remove-history.sh --- scripts/git-remove-history.sh | 15 +++++++++++++-- 1 file changed, 13 insertions(+), 2 deletions(-) diff --git a/scripts/git-remove-history.sh b/scripts/git-remove-history.sh index 9db67d2490..5daf35f5c5 100755 --- a/scripts/git-remove-history.sh +++ b/scripts/git-remove-history.sh @@ -1,4 +1,15 @@ #!/bin/bash + +cat <<'EOT' +@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@ +@ This command rewrites GIT history like git-rebase. Beware never to rewrite @ +@ trees which are already published, as that would deeply upset all cloning @ +@ repos. For more details see 'git help rebase'. Tread carefully! @ +@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@ +EOT +read -p "I know what I am doing: " answer +test "$answer" = yes || exit 1 + set -o errexit # Author: David Underhill @@ -7,7 +18,7 @@ set -o errexit # you want to delete, e.g., git-delete-history path1 path2 if [ $# -eq 0 ]; then - exit 0are still + exit 0 fi # make sure we're at the root of git repo @@ -21,4 +32,4 @@ files=$@ git filter-branch --index-filter "git rm -rf --cached --ignore-unmatch $files" HEAD # remove the temporary history git-filter-branch otherwise leaves behind for a long time -rm -rf .git/refs/original/ && git reflog expire --all && git gc --aggressive --prune \ No newline at end of file +rm -rf .git/refs/original/ && git reflog expire --all && git gc --aggressive --prune