Skip to content

Commit 0c529e4

Browse files
committed
Merge branch 'vh/config-interactive-singlekey-doc'
* vh/config-interactive-singlekey-doc: git-reset.txt: better docs for '--patch' git-checkout.txt: better docs for '--patch' git-stash.txt: better docs for '--patch' git-add.txt: document 'interactive.singlekey' config.txt: 'interactive.singlekey; is used by...
2 parents f3b173d + 6086ff6 commit 0c529e4

File tree

5 files changed

+21
-13
lines changed

5 files changed

+21
-13
lines changed

Documentation/config.txt

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1309,8 +1309,9 @@ instaweb.port::
13091309
interactive.singlekey::
13101310
In interactive commands, allow the user to provide one-letter
13111311
input with a single key (i.e., without hitting enter).
1312-
Currently this is used only by the `\--patch` mode of
1313-
linkgit:git-add[1]. Note that this setting is silently
1312+
Currently this is used by the `\--patch` mode of
1313+
linkgit:git-add[1], linkgit:git-reset[1], linkgit:git-stash[1] and
1314+
linkgit:git-checkout[1]. Note that this setting is silently
13141315
ignored if portable keystroke input is not available.
13151316

13161317
log.date::

Documentation/git-add.txt

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -274,7 +274,8 @@ patch::
274274
This lets you choose one path out of a 'status' like selection.
275275
After choosing the path, it presents the diff between the index
276276
and the working tree file and asks you if you want to stage
277-
the change of each hunk. You can say:
277+
the change of each hunk. You can select one of the following
278+
options and type return:
278279

279280
y - stage this hunk
280281
n - do not stage this hunk
@@ -293,6 +294,9 @@ patch::
293294
+
294295
After deciding the fate for all hunks, if there is any hunk
295296
that was chosen, the index is updated with the selected hunks.
297+
+
298+
You can omit having to type return here, by setting the configuration
299+
variable `interactive.singlekey` to `true`.
296300

297301
diff::
298302

Documentation/git-checkout.txt

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ SYNOPSIS
1212
'git checkout' [-q] [-f] [-m] [--detach] [<commit>]
1313
'git checkout' [-q] [-f] [-m] [[-b|-B|--orphan] <new_branch>] [<start_point>]
1414
'git checkout' [-f|--ours|--theirs|-m|--conflict=<style>] [<tree-ish>] [--] <paths>...
15-
'git checkout' --patch [<tree-ish>] [--] [<paths>...]
15+
'git checkout' [-p|--patch] [<tree-ish>] [--] [<paths>...]
1616

1717
DESCRIPTION
1818
-----------
@@ -45,7 +45,7 @@ $ git checkout <branch>
4545
that is to say, the branch is not reset/created unless "git checkout" is
4646
successful.
4747

48-
'git checkout' [--patch] [<tree-ish>] [--] <pathspec>...::
48+
'git checkout' [-p|--patch] [<tree-ish>] [--] <pathspec>...::
4949

5050
When <paths> or `--patch` are given, 'git checkout' does *not*
5151
switch branches. It updates the named paths in the working tree
@@ -183,7 +183,8 @@ the conflicted merge in the specified paths.
183183
working tree (and if a <tree-ish> was specified, the index).
184184
+
185185
This means that you can use `git checkout -p` to selectively discard
186-
edits from your current working tree.
186+
edits from your current working tree. See the ``Interactive Mode''
187+
section of linkgit:git-add[1] to learn how to operate the `\--patch` mode.
187188

188189
<branch>::
189190
Branch to checkout; if it refers to a branch (i.e., a name that,

Documentation/git-reset.txt

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ SYNOPSIS
99
--------
1010
[verse]
1111
'git reset' [-q] [<commit>] [--] <paths>...
12-
'git reset' --patch [<commit>] [--] [<paths>...]
12+
'git reset' [--patch|-p] [<commit>] [--] [<paths>...]
1313
'git reset' [--soft | --mixed | --hard | --merge | --keep] [-q] [<commit>]
1414

1515
DESCRIPTION
@@ -39,8 +39,9 @@ working tree in one go.
3939
and <commit> (defaults to HEAD). The chosen hunks are applied
4040
in reverse to the index.
4141
+
42-
This means that `git reset -p` is the opposite of `git add -p` (see
43-
linkgit:git-add[1]).
42+
This means that `git reset -p` is the opposite of `git add -p`, i.e.
43+
you can use it to selectively reset hunks. See the ``Interactive Mode''
44+
section of linkgit:git-add[1] to learn how to operate the `\--patch` mode.
4445

4546
'git reset' [--<mode>] [<commit>]::
4647
This form resets the current branch head to <commit> and

Documentation/git-stash.txt

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ SYNOPSIS
1313
'git stash' drop [-q|--quiet] [<stash>]
1414
'git stash' ( pop | apply ) [--index] [-q|--quiet] [<stash>]
1515
'git stash' branch <branchname> [<stash>]
16-
'git stash' [save [--patch] [-k|--[no-]keep-index] [-q|--quiet] [<message>]]
16+
'git stash' [save [-p|--patch] [-k|--[no-]keep-index] [-q|--quiet] [<message>]]
1717
'git stash' clear
1818
'git stash' create
1919

@@ -42,7 +42,7 @@ is also possible).
4242
OPTIONS
4343
-------
4444

45-
save [--patch] [--[no-]keep-index] [-q|--quiet] [<message>]::
45+
save [-p|--patch] [--[no-]keep-index] [-q|--quiet] [<message>]::
4646

4747
Save your local modifications to a new 'stash', and run `git reset
4848
--hard` to revert them. The <message> part is optional and gives
@@ -54,12 +54,13 @@ save [--patch] [--[no-]keep-index] [-q|--quiet] [<message>]::
5454
If the `--keep-index` option is used, all changes already added to the
5555
index are left intact.
5656
+
57-
With `--patch`, you can interactively select hunks from in the diff
57+
With `--patch`, you can interactively select hunks from the diff
5858
between HEAD and the working tree to be stashed. The stash entry is
5959
constructed such that its index state is the same as the index state
6060
of your repository, and its worktree contains only the changes you
6161
selected interactively. The selected changes are then rolled back
62-
from your worktree.
62+
from your worktree. See the ``Interactive Mode'' section of
63+
linkgit:git-add[1] to learn how to operate the `\--patch` mode.
6364
+
6465
The `--patch` option implies `--keep-index`. You can use
6566
`--no-keep-index` to override this.

0 commit comments

Comments
 (0)