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...
This commit is contained in:
Junio C Hamano 2011-05-11 11:38:06 -07:00
Родитель f3b173daf4 6086ff65df
Коммит 0c529e44d3
5 изменённых файлов: 21 добавлений и 13 удалений

Просмотреть файл

@ -1309,8 +1309,9 @@ instaweb.port::
interactive.singlekey::
In interactive commands, allow the user to provide one-letter
input with a single key (i.e., without hitting enter).
Currently this is used only by the `\--patch` mode of
linkgit:git-add[1]. Note that this setting is silently
Currently this is used by the `\--patch` mode of
linkgit:git-add[1], linkgit:git-reset[1], linkgit:git-stash[1] and
linkgit:git-checkout[1]. Note that this setting is silently
ignored if portable keystroke input is not available.
log.date::

Просмотреть файл

@ -274,7 +274,8 @@ patch::
This lets you choose one path out of a 'status' like selection.
After choosing the path, it presents the diff between the index
and the working tree file and asks you if you want to stage
the change of each hunk. You can say:
the change of each hunk. You can select one of the following
options and type return:
y - stage this hunk
n - do not stage this hunk
@ -293,6 +294,9 @@ patch::
+
After deciding the fate for all hunks, if there is any hunk
that was chosen, the index is updated with the selected hunks.
+
You can omit having to type return here, by setting the configuration
variable `interactive.singlekey` to `true`.
diff::

Просмотреть файл

@ -12,7 +12,7 @@ SYNOPSIS
'git checkout' [-q] [-f] [-m] [--detach] [<commit>]
'git checkout' [-q] [-f] [-m] [[-b|-B|--orphan] <new_branch>] [<start_point>]
'git checkout' [-f|--ours|--theirs|-m|--conflict=<style>] [<tree-ish>] [--] <paths>...
'git checkout' --patch [<tree-ish>] [--] [<paths>...]
'git checkout' [-p|--patch] [<tree-ish>] [--] [<paths>...]
DESCRIPTION
-----------
@ -45,7 +45,7 @@ $ git checkout <branch>
that is to say, the branch is not reset/created unless "git checkout" is
successful.
'git checkout' [--patch] [<tree-ish>] [--] <pathspec>...::
'git checkout' [-p|--patch] [<tree-ish>] [--] <pathspec>...::
When <paths> or `--patch` are given, 'git checkout' does *not*
switch branches. It updates the named paths in the working tree
@ -183,7 +183,8 @@ the conflicted merge in the specified paths.
working tree (and if a <tree-ish> was specified, the index).
+
This means that you can use `git checkout -p` to selectively discard
edits from your current working tree.
edits from your current working tree. See the ``Interactive Mode''
section of linkgit:git-add[1] to learn how to operate the `\--patch` mode.
<branch>::
Branch to checkout; if it refers to a branch (i.e., a name that,

Просмотреть файл

@ -9,7 +9,7 @@ SYNOPSIS
--------
[verse]
'git reset' [-q] [<commit>] [--] <paths>...
'git reset' --patch [<commit>] [--] [<paths>...]
'git reset' [--patch|-p] [<commit>] [--] [<paths>...]
'git reset' [--soft | --mixed | --hard | --merge | --keep] [-q] [<commit>]
DESCRIPTION
@ -39,8 +39,9 @@ working tree in one go.
and <commit> (defaults to HEAD). The chosen hunks are applied
in reverse to the index.
+
This means that `git reset -p` is the opposite of `git add -p` (see
linkgit:git-add[1]).
This means that `git reset -p` is the opposite of `git add -p`, i.e.
you can use it to selectively reset hunks. See the ``Interactive Mode''
section of linkgit:git-add[1] to learn how to operate the `\--patch` mode.
'git reset' [--<mode>] [<commit>]::
This form resets the current branch head to <commit> and

Просмотреть файл

@ -13,7 +13,7 @@ SYNOPSIS
'git stash' drop [-q|--quiet] [<stash>]
'git stash' ( pop | apply ) [--index] [-q|--quiet] [<stash>]
'git stash' branch <branchname> [<stash>]
'git stash' [save [--patch] [-k|--[no-]keep-index] [-q|--quiet] [<message>]]
'git stash' [save [-p|--patch] [-k|--[no-]keep-index] [-q|--quiet] [<message>]]
'git stash' clear
'git stash' create
@ -42,7 +42,7 @@ is also possible).
OPTIONS
-------
save [--patch] [--[no-]keep-index] [-q|--quiet] [<message>]::
save [-p|--patch] [--[no-]keep-index] [-q|--quiet] [<message>]::
Save your local modifications to a new 'stash', and run `git reset
--hard` to revert them. The <message> part is optional and gives
@ -54,12 +54,13 @@ save [--patch] [--[no-]keep-index] [-q|--quiet] [<message>]::
If the `--keep-index` option is used, all changes already added to the
index are left intact.
+
With `--patch`, you can interactively select hunks from in the diff
With `--patch`, you can interactively select hunks from the diff
between HEAD and the working tree to be stashed. The stash entry is
constructed such that its index state is the same as the index state
of your repository, and its worktree contains only the changes you
selected interactively. The selected changes are then rolled back
from your worktree.
from your worktree. See the ``Interactive Mode'' section of
linkgit:git-add[1] to learn how to operate the `\--patch` mode.
+
The `--patch` option implies `--keep-index`. You can use
`--no-keep-index` to override this.