Implement "git stash branch <newbranch> <stash>"

Restores the stashed state on a new branch rooted at the commit on which
the stash was originally created, so that conflicts caused by subsequent
changes on the original branch can be dealt with.

(Thanks to Junio for this nice idea.)

Signed-off-by: Abhijit Menon-Sen <ams@toroid.org>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2 files changed
tree: 2ad9d58711dd3dc3bd5def98ccfa017f949ed102
  1. arm/
  2. compat/
  3. contrib/
  4. Documentation/
  5. git-gui/
  6. gitk-git/
  7. gitweb/
  8. mozilla-sha1/
  9. perl/
  10. ppc/
  11. t/
  12. templates/
  13. xdiff/
  14. .gitattributes
  15. .gitignore
  16. .mailmap
  17. abspath.c
  18. alias.c
  19. alloc.c
  20. archive-tar.c
  21. archive-zip.c
  22. archive.c
  23. archive.h
  24. attr.c
  25. attr.h
  26. base85.c
  27. blob.c
  28. blob.h
  29. branch.c
  30. branch.h
  31. builtin-add.c
  32. builtin-annotate.c
  33. builtin-apply.c
  34. builtin-archive.c
  35. builtin-blame.c
  36. builtin-branch.c
  37. builtin-bundle.c
  38. builtin-cat-file.c
  39. builtin-check-attr.c
  40. builtin-check-ref-format.c
  41. builtin-checkout-index.c
  42. builtin-checkout.c
  43. builtin-clean.c
  44. builtin-clone.c
  45. builtin-commit-tree.c
  46. builtin-commit.c
  47. builtin-config.c
  48. builtin-count-objects.c
  49. builtin-describe.c
  50. builtin-diff-files.c
  51. builtin-diff-index.c
  52. builtin-diff-tree.c
  53. builtin-diff.c
  54. builtin-fast-export.c
  55. builtin-fetch--tool.c
  56. builtin-fetch-pack.c
  57. builtin-fetch.c
  58. builtin-fmt-merge-msg.c
  59. builtin-for-each-ref.c
  60. builtin-fsck.c
  61. builtin-gc.c
  62. builtin-grep.c
  63. builtin-http-fetch.c
  64. builtin-init-db.c
  65. builtin-log.c
  66. builtin-ls-files.c
  67. builtin-ls-remote.c
  68. builtin-ls-tree.c
  69. builtin-mailinfo.c
  70. builtin-mailsplit.c
  71. builtin-merge-base.c
  72. builtin-merge-file.c
  73. builtin-merge-ours.c
  74. builtin-merge-recursive.c
  75. builtin-mv.c
  76. builtin-name-rev.c
  77. builtin-pack-objects.c
  78. builtin-pack-refs.c
  79. builtin-prune-packed.c
  80. builtin-prune.c
  81. builtin-push.c
  82. builtin-read-tree.c
  83. builtin-reflog.c
  84. builtin-remote.c
  85. builtin-rerere.c
  86. builtin-reset.c
  87. builtin-rev-list.c
  88. builtin-rev-parse.c
  89. builtin-revert.c
  90. builtin-rm.c
  91. builtin-send-pack.c
  92. builtin-shortlog.c
  93. builtin-show-branch.c
  94. builtin-show-ref.c
  95. builtin-stripspace.c
  96. builtin-symbolic-ref.c
  97. builtin-tag.c
  98. builtin-tar-tree.c
  99. builtin-unpack-objects.c
  100. builtin-update-index.c
  101. builtin-update-ref.c
  102. builtin-upload-archive.c
  103. builtin-verify-pack.c
  104. builtin-verify-tag.c
  105. builtin-write-tree.c
  106. builtin.h
  107. bundle.c
  108. bundle.h
  109. cache-tree.c
  110. cache-tree.h
  111. cache.h
  112. check-builtins.sh
  113. check-racy.c
  114. check_bindir
  115. color.c
  116. color.h
  117. combine-diff.c
  118. command-list.txt
  119. commit.c
  120. commit.h
  121. config.c
  122. config.mak.in
  123. configure.ac
  124. connect.c
  125. convert.c
  126. copy.c
  127. COPYING
  128. csum-file.c
  129. csum-file.h
  130. ctype.c
  131. daemon.c
  132. date.c
  133. decorate.c
  134. decorate.h
  135. delta.h
  136. diff-delta.c
  137. diff-lib.c
  138. diff-no-index.c
  139. diff.c
  140. diff.h
  141. diffcore-break.c
  142. diffcore-delta.c
  143. diffcore-order.c
  144. diffcore-pickaxe.c
  145. diffcore-rename.c
  146. diffcore.h
  147. dir.c
  148. dir.h
  149. dump-cache-tree.c
  150. entry.c
  151. environment.c
  152. exec_cmd.c
  153. exec_cmd.h
  154. fast-import.c
  155. fetch-pack.h
  156. fixup-builtins
  157. fsck.c
  158. fsck.h
  159. generate-cmdlist.sh
  160. git-add--interactive.perl
  161. git-am.sh
  162. git-archimport.perl
  163. git-bisect.sh
  164. git-compat-util.h
  165. git-cvsexportcommit.perl
  166. git-cvsimport.perl
  167. git-cvsserver.perl
  168. git-filter-branch.sh
  169. git-instaweb.sh
  170. git-lost-found.sh
  171. git-merge-octopus.sh
  172. git-merge-one-file.sh
  173. git-merge-resolve.sh
  174. git-merge-stupid.sh
  175. git-merge.sh
  176. git-mergetool.sh
  177. git-parse-remote.sh
  178. git-pull.sh
  179. git-quiltimport.sh
  180. git-rebase--interactive.sh
  181. git-rebase.sh
  182. git-relink.perl
  183. git-repack.sh
  184. git-request-pull.sh
  185. git-send-email.perl
  186. git-sh-setup.sh
  187. git-stash.sh
  188. git-submodule.sh
  189. git-svn.perl
  190. GIT-VERSION-GEN
  191. git-web--browse.sh
  192. git.c
  193. git.spec.in
  194. graph.c
  195. graph.h
  196. grep.c
  197. grep.h
  198. hash-object.c
  199. hash.c
  200. hash.h
  201. help.c
  202. http-push.c
  203. http-walker.c
  204. http.c
  205. http.h
  206. ident.c
  207. imap-send.c
  208. index-pack.c
  209. INSTALL
  210. interpolate.c
  211. interpolate.h
  212. list-objects.c
  213. list-objects.h
  214. ll-merge.c
  215. ll-merge.h
  216. lockfile.c
  217. log-tree.c
  218. log-tree.h
  219. mailmap.c
  220. mailmap.h
  221. Makefile
  222. match-trees.c
  223. merge-file.c
  224. merge-index.c
  225. merge-recursive.h
  226. merge-tree.c
  227. mktag.c
  228. mktree.c
  229. name-hash.c
  230. object.c
  231. object.h
  232. pack-check.c
  233. pack-redundant.c
  234. pack-refs.c
  235. pack-refs.h
  236. pack-revindex.c
  237. pack-revindex.h
  238. pack-write.c
  239. pack.h
  240. pager.c
  241. parse-options.c
  242. parse-options.h
  243. patch-delta.c
  244. patch-id.c
  245. patch-ids.c
  246. patch-ids.h
  247. path-list.c
  248. path-list.h
  249. path.c
  250. pkt-line.c
  251. pkt-line.h
  252. pretty.c
  253. progress.c
  254. progress.h
  255. quote.c
  256. quote.h
  257. reachable.c
  258. reachable.h
  259. read-cache.c
  260. README
  261. receive-pack.c
  262. reflog-walk.c
  263. reflog-walk.h
  264. refs.c
  265. refs.h
  266. remote.c
  267. remote.h
  268. revision.c
  269. revision.h
  270. run-command.c
  271. run-command.h
  272. send-pack.h
  273. server-info.c
  274. setup.c
  275. sha1-lookup.c
  276. sha1-lookup.h
  277. sha1_file.c
  278. sha1_name.c
  279. shallow.c
  280. shell.c
  281. shortlog.h
  282. show-index.c
  283. sideband.c
  284. sideband.h
  285. strbuf.c
  286. strbuf.h
  287. symlinks.c
  288. tag.c
  289. tag.h
  290. tar.h
  291. test-absolute-path.c
  292. test-chmtime.c
  293. test-date.c
  294. test-delta.c
  295. test-genrandom.c
  296. test-match-trees.c
  297. test-parse-options.c
  298. test-sha1.c
  299. test-sha1.sh
  300. thread-utils.c
  301. thread-utils.h
  302. trace.c
  303. transport.c
  304. transport.h
  305. tree-diff.c
  306. tree-walk.c
  307. tree-walk.h
  308. tree.c
  309. tree.h
  310. unpack-file.c
  311. unpack-trees.c
  312. unpack-trees.h
  313. update-server-info.c
  314. upload-pack.c
  315. usage.c
  316. utf8.c
  317. utf8.h
  318. var.c
  319. walker.c
  320. walker.h
  321. wrapper.c
  322. write_or_die.c
  323. ws.c
  324. wt-status.c
  325. wt-status.h
  326. xdiff-interface.c
  327. xdiff-interface.h