Code

git-merge: add --ff and --no-ff options
[git.git] / git-filter-branch.sh
index 3b041d81efd7e96a49c40eba0e23fc0b18508c82..a12f6c2d4c7ad3c4f69a783f7255b3010224d0c3 100755 (executable)
@@ -23,6 +23,20 @@ map()
        fi
 }
 
+# if you run 'skip_commit "$@"' in a commit filter, it will print
+# the (mapped) parents, effectively skipping the commit.
+
+skip_commit()
+{
+       shift;
+       while [ -n "$1" ];
+       do
+               shift;
+               map "$1";
+               shift;
+       done;
+}
+
 # override die(): this version puts in an extra line break, so that
 # the progress is still visible
 
@@ -91,8 +105,9 @@ filter_tag_name=
 filter_subdir=
 orig_namespace=refs/original/
 force=
-while case "$#" in 0) usage;; esac
+while :
 do
+       test $# = 0 && usage
        case "$1" in
        --)
                shift