aboutsummaryrefslogtreecommitdiffstats
path: root/Documentation/git-stash.txt
diff options
context:
space:
mode:
authorAaron M Watson <watsona4@gmail.com>2016-10-24 19:40:13 -0400
committerJunio C Hamano <gitster@pobox.com>2016-10-26 09:58:10 -0700
commita56c8f5aab5a6ffdd687de5134883df60cc4c919 (patch)
tree7a068256143229f9287f7fda9fded15b8d57bc50 /Documentation/git-stash.txt
parent659889482ac63411daea38b2c3d127842ea04e4d (diff)
downloadgit-a56c8f5aab5a6ffdd687de5134883df60cc4c919.tar.gz
stash: allow stashes to be referenced by index only
Instead of referencing "stash@{n}" explicitly, make it possible to simply reference as "n". Most users only reference stashes by their position in the stash stack (what I refer to as the "index" here). The syntax for the typical stash (stash@{n}) is slightly annoying and easy to forget, and sometimes difficult to escape properly in a script. Because of this the capability to do things with the stash by simply referencing the index is desirable. This patch includes the superior implementation provided by Ă˜sse Walle (thanks for that), with a slight change to fix a broken test in the test suite. I also merged the test scripts as suggested by Jeff King, and un-wrapped the documentation as suggested by Junio Hamano. Signed-off-by: Aaron M Watson <watsona4@gmail.com> Reviewed-by: Jeff King <peff@peff.net>
Diffstat (limited to 'Documentation/git-stash.txt')
-rw-r--r--Documentation/git-stash.txt3
1 files changed, 2 insertions, 1 deletions
diff --git a/Documentation/git-stash.txt b/Documentation/git-stash.txt
index 92df596e5f..2e9cef06e6 100644
--- a/Documentation/git-stash.txt
+++ b/Documentation/git-stash.txt
@@ -39,7 +39,8 @@ The latest stash you created is stored in `refs/stash`; older
stashes are found in the reflog of this reference and can be named using
the usual reflog syntax (e.g. `stash@{0}` is the most recently
created stash, `stash@{1}` is the one before it, `stash@{2.hours.ago}`
-is also possible).
+is also possible). Stashes may also be referenced by specifying just the
+stash index (e.g. the integer `n` is equivalent to `stash@{n}`).
OPTIONS
-------