aboutsummaryrefslogtreecommitdiffstats
path: root/Documentation
diff options
context:
space:
mode:
authorJunio C Hamano <gitster@pobox.com>2025-07-29 09:28:50 -0700
committerJunio C Hamano <gitster@pobox.com>2025-07-29 09:28:50 -0700
commit393fa4b64b12da3d3fdcefb02739bb1e82291dcc (patch)
tree37d9676a25f69b289f6d738642a43ae68d8b140e /Documentation
parentMerge branch 'ps/config-wo-the-repository' into next (diff)
parentadd-patch: add diff.context command line overrides (diff)
downloadgit-393fa4b64b12da3d3fdcefb02739bb1e82291dcc.tar.gz
git-393fa4b64b12da3d3fdcefb02739bb1e82291dcc.zip
Merge branch 'lm/add-p-context' into next
"git add/etc -p" now honors diff.context configuration variable, and learns to honor -U<n> option. * lm/add-p-context: add-patch: add diff.context command line overrides add-patch: respect diff.context configuration t: use test_config in t4055 t: use test_grep in t3701 and t4055
Diffstat (limited to 'Documentation')
-rw-r--r--Documentation/diff-context-options.adoc10
-rw-r--r--Documentation/git-add.adoc2
-rw-r--r--Documentation/git-checkout.adoc2
-rw-r--r--Documentation/git-commit.adoc2
-rw-r--r--Documentation/git-reset.adoc2
-rw-r--r--Documentation/git-restore.adoc2
-rw-r--r--Documentation/git-stash.adoc2
7 files changed, 22 insertions, 0 deletions
diff --git a/Documentation/diff-context-options.adoc b/Documentation/diff-context-options.adoc
new file mode 100644
index 0000000000..e161260358
--- /dev/null
+++ b/Documentation/diff-context-options.adoc
@@ -0,0 +1,10 @@
+`-U<n>`::
+`--unified=<n>`::
+ Generate diffs with _<n>_ lines of context. Defaults to `diff.context`
+ or 3 if the config option is unset.
+
+`--inter-hunk-context=<n>`::
+ Show the context between diff hunks, up to the specified _<number>_
+ of lines, thereby fusing hunks that are close to each other.
+ Defaults to `diff.interHunkContext` or 0 if the config option
+ is unset.
diff --git a/Documentation/git-add.adoc b/Documentation/git-add.adoc
index eba0b419ce..b7a735824d 100644
--- a/Documentation/git-add.adoc
+++ b/Documentation/git-add.adoc
@@ -104,6 +104,8 @@ This effectively runs `add --interactive`, but bypasses the
initial command menu and directly jumps to the `patch` subcommand.
See ``Interactive mode'' for details.
+include::diff-context-options.adoc[]
+
`-e`::
`--edit`::
Open the diff vs. the index in an editor and let the user
diff --git a/Documentation/git-checkout.adoc b/Documentation/git-checkout.adoc
index ee83b6d9ba..40e02cfd65 100644
--- a/Documentation/git-checkout.adoc
+++ b/Documentation/git-checkout.adoc
@@ -289,6 +289,8 @@ section of linkgit:git-add[1] to learn how to operate the `--patch` mode.
Note that this option uses the no overlay mode by default (see also
`--overlay`), and currently doesn't support overlay mode.
+include::diff-context-options.adoc[]
+
`--ignore-other-worktrees`::
`git checkout` refuses when the wanted branch is already checked
out or otherwise in use by another worktree. This option makes
diff --git a/Documentation/git-commit.adoc b/Documentation/git-commit.adoc
index dc219025f1..ae988a883b 100644
--- a/Documentation/git-commit.adoc
+++ b/Documentation/git-commit.adoc
@@ -76,6 +76,8 @@ OPTIONS
which changes to commit. See linkgit:git-add[1] for
details.
+include::diff-context-options.adoc[]
+
`-C <commit>`::
`--reuse-message=<commit>`::
Take an existing _<commit>_ object, and reuse the log message
diff --git a/Documentation/git-reset.adoc b/Documentation/git-reset.adoc
index 53ab88c545..50e8a0ba6f 100644
--- a/Documentation/git-reset.adoc
+++ b/Documentation/git-reset.adoc
@@ -125,6 +125,8 @@ OPTIONS
separated with _NUL_ character and all other characters are taken
literally (including newlines and quotes).
+include::diff-context-options.adoc[]
+
`--`::
Do not interpret any more arguments as options.
diff --git a/Documentation/git-restore.adoc b/Documentation/git-restore.adoc
index 3763a7f4f4..961eef0137 100644
--- a/Documentation/git-restore.adoc
+++ b/Documentation/git-restore.adoc
@@ -50,6 +50,8 @@ leave out at most one of _<rev-A>__ and _<rev-B>_, in which case it defaults to
Mode" section of linkgit:git-add[1] to learn how to operate
the `--patch` mode.
+include::diff-context-options.adoc[]
+
`-W`::
`--worktree`::
`-S`::
diff --git a/Documentation/git-stash.adoc b/Documentation/git-stash.adoc
index e5e6c9d37f..e2300a19a2 100644
--- a/Documentation/git-stash.adoc
+++ b/Documentation/git-stash.adoc
@@ -222,6 +222,8 @@ to learn how to operate the `--patch` mode.
The `--patch` option implies `--keep-index`. You can use
`--no-keep-index` to override this.
+include::diff-context-options.adoc[]
+
-S::
--staged::
This option is only valid for `push` and `save` commands.