Thread (7 messages) flat view 7 messages, 3 authors, 2016-06-15

Re: [PATCH] Implement "git stash branch <newbranch> <stash>"

From: Junio C Hamano <hidden>
Date: 2016-06-15 22:44:53

Possibly related (same subject, not in this thread)

Abhijit Menon-Sen [off-list ref] writes:
+branch <branchname> [<stash>]::
+
+	Creates and checks out a new branch named `<branchname>` starting from
+	the commit at which the `<stash>` was originally created, applies the
+	changes recorded in `<stash>` to the new working tree, and drops the
+	`<stash>` if that completes successfully. When no `<stash>` is given,
+	applies the latest one.
++
+This is useful if the branch on which you ran `git stash save` has
+changed enough that `git stash apply` fails due to conflicts. Since
+the stash is applied on top of the commit that was HEAD at the time
+`git stash` was run, it restores the originally stashed state with
+no conflicts.
Perhaps we would want to replay the stash always with --index for this
application.  By definition this will be conflict-free both in the index
and in the working tree.

I've also toyed with an idea to make <branchname> optional, and detach the
HEAD if <branchname> is not given.  It would be a useful mode of operation
but one problem is that it is _not_ an operation that should be called
"branch" anymore.
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help