"git cancel" may not be named correctly for this job, but it does almost
everything you'd need for switching between one branch and another
within a repository, so...

Signed-Off-By: Matthias Urlichs <[EMAIL PROTECTED]>

--- f29be8140c5f1175052ec96ad2fa2b2901fd6ba5/git  (mode:100755 
+++ 42a073eb6b5bb397a3e8768a032463a7fa02e6b9/git  (mode:100755 
@@ -28,7 +28,7 @@
        add             FILE...
        addremote       RNAME RSYNC_URL
        apply                           < patch on stdin
-       cancel
+       cancel          [NAME]
        ci, commit      [FILE]...       < log message on stdin
        diff            [-p] [-r FROM_ID[:TO_ID]] [FILE]...
        export          DESTDIR [TREE_ID]
Index: gitcancel.sh
--- f29be8140c5f1175052ec96ad2fa2b2901fd6ba5/gitcancel.sh  (mode:100755 
+++ 42a073eb6b5bb397a3e8768a032463a7fa02e6b9/gitcancel.sh  (mode:100755 
@@ -9,6 +9,9 @@
 # Basically, this is the opposite of git commit in some sense.
 # Takes no arguments and the evil changes from the tree.
+# ... actually, if you do give it an argument, it'll switch the HEAD to
+# that branch -- or create a new one.
 [ -s ".git/add-queue" ] && rm $(cat .git/add-queue)
 rm -f .git/add-queue .git/rm-queue
@@ -29,6 +32,11 @@
+if [ "$1" ] ; then
+       test -f .git/heads/$1 || cp .git/HEAD .git/heads/$1
+       ln -sf "heads/$1" .git/HEAD
 rm -f .git/blocked .git/merging .git/merging-sym .git/merge-base
 read-tree $(tree-id)
To unsubscribe from this list: send the line "unsubscribe git" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Reply via email to