new_ref=$(echo "next-$d" | git commit-tree 'HEAD^{tree}' -p history -p HEAD)
git update-ref -m "next-$d" refs/heads/history $new_ref
+# Create a patch to remove the localversion-next file
+cat >../nolocalversion-$d.patch <<EOF
+diff --git a/localversion-next b/localversion-next
+deleted file mode 100644
+index d795256..0000000
+--- a/localversion-next
++++ /dev/null
+@@ -1 +0,0 @@
+--next-$d
+EOF
+
exit 0