From 31be5d87a2aa2c40f021f37d9a5408e59804fd7f Mon Sep 17 00:00:00 2001 From: Valentin Haenel Date: Mon, 2 May 2011 15:44:28 +0200 Subject: config.txt: 'interactive.singlekey; is used by... The config variable 'interactive.singlekey' influences also '--patch' mode of git-add, git-reset, and git-checkout. Helped-by: Jeff King Signed-off-by: Valentin Haenel Signed-off-by: Junio C Hamano --- Documentation/config.txt | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'Documentation') diff --git a/Documentation/config.txt b/Documentation/config.txt index 750c86d4f5..1b1d80d84a 100644 --- a/Documentation/config.txt +++ b/Documentation/config.txt @@ -1349,8 +1349,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:: -- cgit v1.2.3 From c105356ed4636167b96526cd41e2cbaca051432c Mon Sep 17 00:00:00 2001 From: Valentin Haenel Date: Thu, 5 May 2011 20:48:45 +0200 Subject: git-add.txt: document 'interactive.singlekey' This is documented in the section about the 'Interactive Mode', rather than for the option '--patch', since this is the section is where people go to learn about '--patch'. Helped-by: Jeff King Mentored-by: Junio C Hamano Signed-off-by: Valentin Haenel Signed-off-by: Junio C Hamano --- Documentation/git-add.txt | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) (limited to 'Documentation') diff --git a/Documentation/git-add.txt b/Documentation/git-add.txt index 7eebbefe7b..f072b5964d 100644 --- a/Documentation/git-add.txt +++ b/Documentation/git-add.txt @@ -272,7 +272,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 @@ -291,6 +292,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:: -- cgit v1.2.3 From f2808a50a62755739a775ed008f01a9a5a053938 Mon Sep 17 00:00:00 2001 From: Valentin Haenel Date: Thu, 5 May 2011 20:48:47 +0200 Subject: git-stash.txt: better docs for '--patch' Describe '-p' as a short form of '--patch' in synopsis and options. Also refer the reader to the patch mode description of git-add documentation. Helped-by: Jeff King Mentored-by: Junio C Hamano Signed-off-by: Valentin Haenel Signed-off-by: Junio C Hamano --- Documentation/git-stash.txt | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) (limited to 'Documentation') diff --git a/Documentation/git-stash.txt b/Documentation/git-stash.txt index 79abc38e50..15f051fa44 100644 --- a/Documentation/git-stash.txt +++ b/Documentation/git-stash.txt @@ -13,7 +13,7 @@ SYNOPSIS 'git stash' drop [-q|--quiet] [] 'git stash' ( pop | apply ) [--index] [-q|--quiet] [] 'git stash' branch [] -'git stash' [save [--patch] [-k|--[no-]keep-index] [-q|--quiet] []] +'git stash' [save [-p|--patch] [-k|--[no-]keep-index] [-q|--quiet] []] 'git stash' clear 'git stash' create @@ -42,7 +42,7 @@ is also possible). OPTIONS ------- -save [--patch] [--[no-]keep-index] [-q|--quiet] []:: +save [-p|--patch] [--[no-]keep-index] [-q|--quiet] []:: Save your local modifications to a new 'stash', and run `git reset --hard` to revert them. The part is optional and gives @@ -54,12 +54,13 @@ save [--patch] [--[no-]keep-index] [-q|--quiet] []:: 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. -- cgit v1.2.3 From a31538e273bbca23951fa70a0324ac49214d0f10 Mon Sep 17 00:00:00 2001 From: Valentin Haenel Date: Thu, 5 May 2011 20:48:48 +0200 Subject: git-checkout.txt: better docs for '--patch' Describe '-p' as a short form of '--patch' in synopsis and options. Also refer the reader to the patch mode description of git-add documentation. Helped-by: Jeff King Mentored-by: Junio C Hamano Signed-off-by: Valentin Haenel Signed-off-by: Junio C Hamano --- Documentation/git-checkout.txt | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) (limited to 'Documentation') diff --git a/Documentation/git-checkout.txt b/Documentation/git-checkout.txt index 1063f69023..c0a96e6c1e 100644 --- a/Documentation/git-checkout.txt +++ b/Documentation/git-checkout.txt @@ -12,7 +12,7 @@ SYNOPSIS 'git checkout' [-q] [-f] [-m] [--detach] [] 'git checkout' [-q] [-f] [-m] [[-b|-B|--orphan] ] [] 'git checkout' [-f|--ours|--theirs|-m|--conflict=