As discussed here [*1*], this allows `git status` to show the number of
entries currently stashed away.
I also tried to update the related parts of the documentation to use
'stash entry' instead of 'stash' as we agreed that it was a bit better.
*1*
https://public-inbox.org/git/ca+b9myhrahtd+fdgzk5ahxw+hq_y_czmx9x6mxybcr9wspe...@mail.gmail.com/
Liam Beguin (3):
stash: update documentation to use 'stash entry'
status: add optional stash count information
glossary: define 'stash entry'
Documentation/config.txt | 11 +--
Documentation/git-pull.txt | 2 +-
Documentation/git-rebase.txt | 2 +-
Documentation/git-stash.txt| 60 --
Documentation/git-status.txt | 3 ++
Documentation/gitcli.txt | 2 +-
Documentation/glossary-content.txt | 4 +++
builtin/commit.c | 6
git-stash.sh | 6 ++--
t/t7508-status.sh | 32
wt-status.c| 24 +++
wt-status.h| 1 +
12 files changed, 115 insertions(+), 38 deletions(-)
Base-commit: 97e2ff464302565877a00b8a9aa6a2d85bd1445e
Changes since v1:
- update commit messages to be more consistent
- improve Documentation based on feedback
- move config lookup to `git_status_config()`
- add '--show-stash' command line option to `git-status`
- add tests for now option
Interdiff:
diff --git a/Documentation/git-stash.txt b/Documentation/git-stash.txt
index 59979ad31dfe..00f95fee1faf 100644
--- a/Documentation/git-stash.txt
+++ b/Documentation/git-stash.txt
@@ -58,7 +58,7 @@ push [-p|--patch] [-k|--[no-]keep-index]
[-u|--include-untracked] [-a|--all] [-q
+
For quickly making a snapshot, you can omit "push". In this mode,
non-option arguments are not allowed to prevent a misspelled
-subcommand from making an unwanted entry. The two exceptions to this
+subcommand from making an unwanted stash entry. The two exceptions to this
are `stash -p` which acts as alias for `stash push -p` and pathspecs,
which are allowed after a double hyphen `--` for disambiguation.
+
@@ -106,10 +106,11 @@ command to control what is shown and how. See
linkgit:git-log[1].
show []::
Show the changes recorded in the stash entry as a diff between the
- stashed entry and its original parent. When no `` is given, it
- shows the latest one. By default, the command shows the diffstat, but
- it will accept any format known to 'git diff' (e.g., `git stash show
- -p stash@{1}` to view the second most recent entry in patch form).
+ stashed contents and the commit back when the stash entry was first
+ created. When no `` is given, it shows the latest one.
+ By default, the command shows the diffstat, but it will accept any
+ format known to 'git diff' (e.g., `git stash show -p stash@{1}`
+ to view the second most recent entry in patch form).
You can use stash.showStat and/or stash.showPatch config variables
to change the default behavior.
@@ -150,20 +151,20 @@ branch []::
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 entry is applied on top of the commit that was HEAD at the
-time `git stash` was run, it restores the originally stashed entry
+time `git stash` was run, it restores the originally stashed state
with no conflicts.
clear::
- Remove all the stashed entries. Note that those entries will then
+ Remove all the stash entries. Note that those entries will then
be subject to pruning, and may be impossible to recover (see
'Examples' below for a possible strategy).
drop [-q|--quiet] []::
- Remove a single stashed entry from the stash list. When no ``
- is given, it removes the latest one. i.e. `stash@{0}`, otherwise
- `` must be a valid stash log reference of the form
- `stash@{}`.
+ Remove a single stash entry from the list of stash entries.
+ When no `` is given, it removes the latest one.
+ i.e. `stash@{0}`, otherwise `` must be a valid stash
+ log reference of the form `stash@{}`.
create::
diff --git a/Documentation/git-status.txt b/Documentation/git-status.txt
index d70abc6afe3a..d47f198f15cd 100644
--- a/Documentation/git-status.txt
+++ b/Documentation/git-status.txt
@@ -32,6 +32,9 @@ OPTIONS
--branch::
Show the branch and tracking info even in short-format.
+--show-stash::
+ Show the number of entries currently stashed away.
+
--porcelain[=]::
Give the output in an easy-to-parse format for scripts.
This is similar to the short output, but will remain stable
diff --git a/Documentation/glossary-content.txt
b/Documentation/glossary-content.txt
index 026f66e7240a..b71b943b12ed 100644
--- a/Documentation/glossary-content.txt
+++ b/Documentation/glossary-content.t