From patchwork Mon Nov 11 16:53:00 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Philippe Blain via GitGitGadget X-Patchwork-Id: 13870978 Received: from mail-wm1-f50.google.com (mail-wm1-f50.google.com [209.85.128.50]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id DB9CC197A7F for ; Mon, 11 Nov 2024 16:53:09 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.128.50 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1731343992; cv=none; b=AeT5qBOPNcEROga+YKbVcVXhw0g0g+3whtYr22pDScCSqqkhGyTJHGylwFvuGdIcxJ4BvbeeF8TuXQrWk4TELQ75WyelNNLIdc4AL9IsYSE7F7VzZZrz/ep0Dl7fLo6MHFUI6H52d1wm/jvwJouRnOv1IsheUCQ/wmALI1lXcOY= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1731343992; c=relaxed/simple; bh=8CZxX9A8aGD4TjCet0IjR75d6alDYO32GOZJybDnd1k=; h=Message-Id:In-Reply-To:References:From:Date:Subject:MIME-Version: Content-Type:To:Cc; b=SuavhqHSFBb3geCSg1d4jzmpzV93lDLoPvGoZrmuaGSgU/ZURQjppeKOGRcd4L7z2nVUTVydcdeOOrvpiaE6ygFLTwgomP1a5gHIZjSQ1xpe82R+MVQQRj425OZG2TpTK//8W/8jODzQky3WW3AuN1icdcXQQOryMa8+MZjsIS4= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com; spf=pass smtp.mailfrom=gmail.com; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b=bsRchj5q; arc=none smtp.client-ip=209.85.128.50 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=gmail.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="bsRchj5q" Received: by mail-wm1-f50.google.com with SMTP id 5b1f17b1804b1-43161e7bb25so38016405e9.2 for ; Mon, 11 Nov 2024 08:53:09 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1731343988; x=1731948788; darn=vger.kernel.org; h=cc:to:fcc:content-transfer-encoding:mime-version:subject:date:from :references:in-reply-to:message-id:from:to:cc:subject:date :message-id:reply-to; bh=JZAzUeGWVJ65lxXDJb2pkrpH2budGcXx557JYcnyIUo=; b=bsRchj5qGhoWKWnM9vieOoHlQrY8p3yM4rR2j1yZkdUu/AcVGqKJpFqJB5I/bDswVV VDjeyLh2a/aLJGr/MyGOs9s7+XVXe9delmTE7kV40aea6vWvbnVNunRxG8k90ErRGIFm PZV7XbymmwbfeRLTkLER3bUHUzDxkrhXw36NYke7nsQB72K6kgbWrI2nTRAbQl+OijZH QuY7NThvuAJ7zPPmEzEPQ6+QjDkbh8YIZoW8FVxhtR98ZeyP9Xk4Ycn8tZCap86skeSm PRHNrP4VN3rx1X/CqaAm5OpsyeDZP7PMBJd8/M7bB6EiUoWxwdbxfVuzmnBFHdccUEZS C3Pw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1731343988; x=1731948788; h=cc:to:fcc:content-transfer-encoding:mime-version:subject:date:from :references:in-reply-to:message-id:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=JZAzUeGWVJ65lxXDJb2pkrpH2budGcXx557JYcnyIUo=; b=ATxuYpwOisxHyvtn9YxofifhDg2gYBL+8sPwUkp5gdJfdtC/CLa2aqSl3XskDSPrUs wjZgq5r0QO/uwJdAPFyJJcLSM+2oW9xkDjbmE9uUyNmR6OjHUv5u394ztZiiGEuT2kaF +q86XsKQZ5QnkRibtfWP2VdpO8GmhLwc6ce4AAFTO+LlgIu96AQZEIUlOqoEutKKxDPm UXSqBE2IfnwfLmtrcSOXuXBmZHUlx90Vld58uFnEYGpLfGYBT4OyyOwLYNnmfcEXu3lp IwmCqv2YTP6wNF5QxaXc2R4zu3gQPPfuUh2nQuHpNCgcyF7uWAfv1zph2JZ1dNrzCLYN S9Aw== X-Gm-Message-State: AOJu0YxEXF0BUK9f3hSeuv6A/jq5qJcmR1/ibsYli6gVn3J4P7Kl5qBN fAgIdbTrm3bM6fEa/esRTh9z+NG4UV4IVg4BFd9ukBqy5zP4fxvscPZVQg== X-Google-Smtp-Source: AGHT+IFgJEqUhSBcJVNQIlULInvNyNo8Oo6raiqWSOTOyfQcWZVbmJMdtPiabD+Bsx2sWE2W2co6Tg== X-Received: by 2002:a05:600c:1911:b0:431:2460:5574 with SMTP id 5b1f17b1804b1-432b751c122mr108926585e9.27.1731343987124; Mon, 11 Nov 2024 08:53:07 -0800 (PST) Received: from [127.0.0.1] ([13.74.141.28]) by smtp.gmail.com with ESMTPSA id ffacd0b85a97d-381ed970fb7sm13199377f8f.21.2024.11.11.08.53.06 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 11 Nov 2024 08:53:06 -0800 (PST) Message-Id: In-Reply-To: References: From: " =?utf-8?q?Jean-No=C3=ABl?= Avila via GitGitGadget" Date: Mon, 11 Nov 2024 16:53:00 +0000 Subject: [PATCH v2 0/5] doc: git diff reformatting Precedence: bulk X-Mailing-List: git@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Fcc: Sent To: git@vger.kernel.org Cc: Johannes Sixt , Patrick Steinhardt , =?utf-8?q?Jean-No=C3=ABl?= Avila This is the continuation of the editing of the manpages to reflect the new formatting rules. Note that this patch makes use of the synopsis paragraph styling and needs to be applied above ja/doc-synopsis-markup. As the dots can be primarily interpreted as a grammar sign for repetition, here the dots which are part of the synopsis are manually forced to verbatim. Jean-Noël Avila (5): doc: git-diff: apply new documentation guidelines doc: git-diff: apply format changes to diff-options doc: git-diff: apply format changes to diff-format doc: git-diff: apply format changes to diff-generate-patch doc: git-diff: apply format changes to config part Documentation/config/diff.txt | 163 +++++----- Documentation/diff-format.txt | 42 +-- Documentation/diff-generate-patch.txt | 44 +-- Documentation/diff-options.txt | 423 +++++++++++++------------- Documentation/git-diff.txt | 103 +++---- 5 files changed, 390 insertions(+), 385 deletions(-) base-commit: facbe4f633e4ad31e641f64617bc88074c659959 Published-As: https://github.com/gitgitgadget/git/releases/tag/pr-1769%2Fjnavila%2Fgit_diff_new-v2 Fetch-It-Via: git fetch https://github.com/gitgitgadget/git pr-1769/jnavila/git_diff_new-v2 Pull-Request: https://github.com/gitgitgadget/git/pull/1769 Range-diff vs v1: 1: 515ddbf1dce ! 1: c104bd50b64 doc: git-diff: apply new documentation guidelines @@ Documentation/git-diff.txt: git-diff - Show changes between commits, commit and +git diff [] [] [--] [...] +git diff [] --cached [--merge-base] [] [--] [...] +git diff [] [--merge-base] [...] [--] [...] -+git diff [] `...` [--] [...] ++git diff [] ... [--] [...] +git diff [] +git diff [] --no-index [--] @@ Documentation/git-diff.txt: between the index and a tree, changes between two tr files on disk. -'git diff' [] [--] [...]:: -+`git diff` [__] [`--`] [__...]:: ++`git diff [] [--] [...]`:: This form is to view the changes you made relative to the index (staging area for the next commit). In other @@ Documentation/git-diff.txt: files on disk. stage these changes by using linkgit:git-add[1]. -'git diff' [] --no-index [--] :: -+`git diff` [__] `--no-index` [`--`] __ __:: ++`git diff [] --no-index [--] `:: This form is to compare the given two paths on the filesystem. You can omit the `--no-index` option when @@ Documentation/git-diff.txt: files on disk. controlled by Git. This form implies `--exit-code`. -'git diff' [] --cached [--merge-base] [] [--] [...]:: -+`git diff` [__] `--cached` [`--merge-base`] [__] [`--`] [__...]:: ++`git diff [] --cached [--merge-base] [] [--] [...]`:: This form is to view the changes you staged for the next - commit relative to the named . Typically you @@ Documentation/git-diff.txt: files on disk. `git diff --cached $(git merge-base A HEAD)`. -'git diff' [] [--merge-base] [--] [...]:: -+`git diff` [__] [`--merge-base`] __ [`--`] [__...]:: ++`git diff [] [--merge-base] [--] [...]`:: This form is to view the changes you have in your - working tree relative to the named . You can @@ Documentation/git-diff.txt: files on disk. `git diff $(git merge-base A HEAD)`. -'git diff' [] [--merge-base] [--] [...]:: -+`git diff` [__] [`--merge-base`] __ __ [`--`] [__...]:: ++`git diff [] [--merge-base] [--] [...]`:: This is to view the changes between two arbitrary - . @@ Documentation/git-diff.txt: files on disk. `git diff $(git merge-base A B) B`. -'git diff' [] ... [--] [...]:: -+`git diff` [__] __ ____++...++____ [`--`] [__...]:: ++`git diff [] ... [--] [...]`:: This form is to view the results of a merge commit. The first - listed must be the merge itself; the remaining two or + listed __ must be the merge itself; the remaining two or more commits should be its parents. Convenient ways to produce - the desired set of revisions are to use the suffixes `^@` and +- the desired set of revisions are to use the suffixes `^@` and - `^!`. If A is a merge commit, then `git diff A A^@`, ++ the desired set of revisions are to use the suffixes `@` and + `^!`. If `A` is a merge commit, then `git diff A A^@`, `git diff A^!` and `git show A` all give the same combined diff. -'git diff' [] .. [--] [...]:: -+`git diff` [__] ____++..++____ [`--`] [__...]:: ++`git diff [] .. [--] [...]`:: This is synonymous to the earlier form (without the `..`) for - viewing the changes between two arbitrary . If on @@ Documentation/git-diff.txt: files on disk. + using `HEAD` instead. -'git diff' [] \... [--] [...]:: -+`git diff` [__] ____++...++____ [`--`] [__...]:: ++`git diff [] ... [--] [...]`:: This form is to view the changes on the branch containing - and up to the second , starting at a common ancestor @@ Documentation/git-diff.txt: files on disk. -and the range notations (`..` and -`...`) do not mean a range as defined in the +However, `diff` is about comparing two _endpoints_, not ranges, -+and the range notations (____++..++____ and -+____++...++____) do not mean a range as defined in the ++and the range notations (`..` and `...`) ++do not mean a range as defined in the "SPECIFYING RANGES" section in linkgit:gitrevisions[7]. -'git diff' [] :: -+`git diff` [__] __ __:: ++`git diff [] `:: This form is to view the differences between the raw contents of two blob objects. 2: c1e7d6afb50 ! 2: 129763c2aae doc: git-diff: apply format changes to diff-options @@ Documentation/diff-options.txt: endif::git-format-patch[] --diff-merges=:: Specify diff format to be used for merge commits. Default is -@@ Documentation/diff-options.txt: ifdef::git-log[] - The following formats are supported: - + - -- --off, none:: -+off:: -+none:: +@@ Documentation/diff-options.txt: The following formats are supported: + off, none:: Disable output of diffs for merge commits. Useful to override implied value. -+ --on, m:: + -+on:: -+m:: + on, m:: Make diff output for merge commits to be shown in the default format. The default format can be changed using `log.diffMerges` configuration variable, whose default value is `separate`. -+ --first-parent, 1:: + -+first-parent:: -+1:: + first-parent, 1:: Show full diff with respect to first parent. This is the same format as `--patch` produces for non-merge commits. -+ @@ Documentation/diff-options.txt: ifdef::git-log[] Show full diff with respect to each of parents. Separate log entry and diff is generated for each parent. -+ --combined, c:: + -+combined:: -+c:: + combined, c:: Show differences from each of the parents to the merge result simultaneously instead of showing pairwise diff between a parent and the result one at a time. Furthermore, it lists only files which were modified from all parents. -+ --dense-combined, cc:: + -+dense-combined:: -+cc:: + dense-combined, cc:: Further compress output produced by `--diff-merges=combined` by omitting uninteresting hunks whose contents in the parents have only two variants and the merge result picks one of them without modification. -+ --remerge, r:: + -+remerge:: -+r:: + remerge, r:: Remerge two-parent merge commits to create a temporary tree object--potentially containing files with conflict markers - and such. A diff is then shown between that temporary tree @@ Documentation/diff-options.txt: documented). -- --combined-all-paths:: - This flag causes combined diffs (used for merge commits) to -+ cause combined diffs (used for merge commits) to ++ Cause combined diffs (used for merge commits) to list the name of the file from all parents. It thus only has effect when `--diff-merges=[dense-]combined` is in use, and is likely only useful if filename changes are detected (i.e. @@ Documentation/diff-options.txt: documented). --U:: ---unified=:: - Generate diffs with lines of context instead of -+++-U++____:: -+++--unified=++____:: ++`-U`:: ++`--unified=`:: + Generate diffs with __ lines of context instead of the usual three. ifndef::git-format-patch[] @@ Documentation/diff-options.txt: documented). endif::git-format-patch[] ---output=:: -- Output to a specific file instead of stdout. -+++--output=++____:: -+ Output to __ instead of stdout. ++`--output=`:: + Output to a specific file instead of stdout. ---output-indicator-new=:: ---output-indicator-old=:: ---output-indicator-context=:: -+++--output-indicator-new=++____:: -+++--output-indicator-old=++____:: -+++--output-indicator-context=++____:: ++`--output-indicator-new=`:: ++`--output-indicator-old=`:: ++`--output-indicator-context=`:: Specify the character used to indicate new, old or context - lines in the generated patch. Normally they are '+', '-' and + lines in the generated patch. Normally they are `+`, `-` and @@ Documentation/diff-options.txt: endif::git-log[] Generate a diff using the "histogram diff" algorithm. ---anchored=:: -+++--anchored=++____:: ++`--anchored=`:: Generate a diff using the "anchored diff" algorithm. + This option may be specified more than once. @@ Documentation/diff-options.txt: endif::git-log[] diff" algorithm internally. ---diff-algorithm={patience|minimal|histogram|myers}:: -+`--diff-algorithm=`(`patience`|`minimal`|`histogram`|`myers`):: ++`--diff-algorithm=(patience|minimal|histogram|myers)`:: Choose a diff algorithm. The variants are as follows: + -- @@ Documentation/diff-options.txt: endif::git-log[] + `histogram`;; This algorithm extends the patience algorithm to "support low-occurrence common elements". ---- --+ -+ - For instance, if you configured the `diff.algorithm` variable to a + -- +@@ Documentation/diff-options.txt: For instance, if you configured the `diff.algorithm` variable to a non-default value and want to use the default one, then you have to use `--diff-algorithm=default` option. -+-- ---stat[=[,[,]]]:: -+`--stat`[++=++____[++,++____[++,++____]]]:: ++`--stat[=[,[,]]]`:: Generate a diffstat. By default, as much space as necessary will be used for the filename part, and the rest for the graph part. Maximum width defaults to terminal width, or 80 columns @@ Documentation/diff-options.txt: endif::git-log[] - `diff.statGraphWidth=`. Using `--stat` or + __. The width of the filename part can be limited by + giving another width __ after a comma or by setting -+ ++diff.statNameWidth=++____. The width of the graph part can be -+ limited by using ++--stat-graph-width=++____ or by setting -+ ++diff.statGraphWidth=++____. Using `--stat` or ++ `diff.statNameWidth=`. The width of the graph part can be ++ limited by using `--stat-graph-width=` or by setting ++ `diff.statGraphWidth=`. Using `--stat` or `--stat-graph-width` affects all commands generating a stat graph, while setting `diff.statNameWidth` or `diff.statGraphWidth` does not affect `git format-patch`. @@ Documentation/diff-options.txt: endif::git-log[] + By giving a third parameter __, you can limit the output to + the first __ lines, followed by `...` if there are more. + --These parameters can also be set individually with `--stat-width=`, --`--stat-name-width=` and `--stat-count=`. -+These parameters can also be set individually with ++--stat-width=++____, -+++--stat-name-width=++____ and ++--stat-count=++____. + These parameters can also be set individually with `--stat-width=`, + `--stat-name-width=` and `--stat-count=`. ---compact-summary:: +`--compact-summary`:: @@ Documentation/diff-options.txt: endif::git-log[] --X[]:: ---dirstat[=]:: -+`-X`[____++,++...]:: -+`--dirstat`[++=++____++,++...]:: ++`-X [,...]`:: ++`--dirstat[=,...]`:: Output the distribution of relative amount of changes for each sub-directory. The behavior of `--dirstat` can be customized by passing it a comma separated list of parameters. @@ Documentation/diff-options.txt: directories with less than 10% of the total amou ---dirstat-by-file[=...]:: - Synonym for --dirstat=files,,... -+`--dirstat-by-file`[++=++____++,++...]:: -+ Synonym for ++--dirstat=files,++____++,++... . ++`--dirstat-by-file[=,...]`:: ++ Synonym for `--dirstat=files,,...`. ---summary:: +`--summary`:: @@ Documentation/diff-options.txt: Without this option, pathnames with "unusual" ch Just like `--name-only` the file names are often encoded in UTF-8. ---submodule[=]:: -+`--submodule`[++=++____]:: ++`--submodule[=]`:: Specify how differences in submodules are shown. When specifying - `--submodule=short` the 'short' format is used. This format just + `--submodule=short` the `short` format is used. This format just @@ Documentation/diff-options.txt: Without this option, pathnames with "unusual" ch if the config option is unset. ---color[=]:: -+`--color`[++=++____]:: ++`--color[=]`:: Show colored diff. - `--color` (i.e. without '=') is the same as `--color=always`. - '' can be one of `always`, `never`, or `auto`. -+ `--color` (i.e. without ++=++____) is the same as `--color=always`. ++ `--color` (i.e. without `=`) is the same as `--color=always`. + __ can be one of `always`, `never`, or `auto`. ifdef::git-diff[] It can be changed by the `color.ui` and `color.diff` @@ Documentation/diff-options.txt: Without this option, pathnames with "unusual" ch It is the same as `--color=never`. ---color-moved[=]:: -+`--color-moved`[++=++____]:: ++`--color-moved[=]`:: Moved lines of code are colored differently. ifdef::git-diff[] It can be changed by the `diff.colorMoved` configuration setting. @@ Documentation/diff-options.txt: Without this option, pathnames with "unusual" ch settings. It is the same as `--color-moved=no`. ---color-moved-ws=:: -+++--color-moved-ws=++____++,++...:: ++`--color-moved-ws=,...`:: This configures how whitespace is ignored when performing the move detection for `--color-moved`. ifdef::git-diff[] @@ Documentation/diff-options.txt: endif::git-diff[] ---word-diff[=]:: - Show a word diff, using the to delimit changed words. -+`--word-diff`[++=++____]:: -+ Show a word diff, using the __ to delimit changed words. ++`--word-diff[=]`:: By default, words are delimited by whitespace; see - `--word-diff-regex` below. The defaults to 'plain', and + `--word-diff-regex` below. The __ defaults to `plain`, and @@ Documentation/diff-options.txt: endif::git-diff[] +`color`:: Highlight changed words using only colors. Implies `--color`. -plain:: +- Show words as `[-removed-]` and `{+added+}`. Makes no +`plain`:: - Show words as `[-removed-]` and `{+added+}`. Makes no ++ Show words as ++[-removed-]++ and ++{+added+}++. Makes no attempts to escape the delimiters if they appear in the input, so the output may be ambiguous. -porcelain:: @@ Documentation/diff-options.txt: endif::git-diff[] ---word-diff-regex=:: - Use to decide what a word is, instead of considering -+++--word-diff-regex=++____:: ++`--word-diff-regex=`:: + Use __ to decide what a word is, instead of considering runs of non-whitespace to be a word. Also implies `--word-diff` unless it was already enabled. @@ Documentation/diff-options.txt: linkgit:gitattributes[5] or linkgit:git-config[1 override configuration settings. ---color-words[=]:: -+`--color-words`[++=++____]:: ++`--color-words[=]`:: Equivalent to `--word-diff=color` plus (if a regex was -- specified) `--word-diff-regex=`. -+ specified) ++--word-diff-regex=++____. + specified) `--word-diff-regex=`. endif::git-format-patch[] ---no-renames:: @@ Documentation/diff-options.txt: linkgit:gitattributes[5] or linkgit:git-config[1 file gives the default to do so. ---[no-]rename-empty:: -+`--`[`no-`]`rename-empty`:: ++`--[no-]rename-empty`:: Whether to use empty blobs as rename source. ifndef::git-format-patch[] @@ Documentation/diff-options.txt: ifndef::git-format-patch[] + with `--exit-code`. ---ws-error-highlight=:: -+++--ws-error-highlight=++____:: ++`--ws-error-highlight=`:: Highlight whitespace errors in the `context`, `old` or `new` lines of the diff. Multiple values are separated by comma, `none` resets previous values, `default` reset the list to @@ Documentation/diff-options.txt: ifndef::git-format-patch[] endif::git-format-patch[] ---abbrev[=]:: -+`--abbrev`[++=++____]:: ++`--abbrev[=]`:: Instead of showing the full 40-byte hexadecimal object name in diff-raw format output and diff-tree header - lines, show the shortest prefix that is at least '' @@ Documentation/diff-options.txt: ifndef::git-format-patch[] In diff-patch output format, `--full-index` takes higher precedence, i.e. if `--full-index` is specified, full blob names will be shown regardless of `--abbrev`. -- Non default number of digits can be specified with `--abbrev=`. -+ Non default number of digits can be specified with ++--abbrev=++____. + Non default number of digits can be specified with `--abbrev=`. --B[][/]:: ---break-rewrites[=[][/]]:: -+`-B`[__][++/++____]:: -+`--break-rewrites`[`=`[__][++/++____]]:: ++`-B[][/]`:: ++`--break-rewrites[=[][/]]`:: Break complete rewrite changes into pairs of delete and create. This serves two purposes: + @@ Documentation/diff-options.txt: It affects the way a change that amounts to a to few lines that happen to match textually as the context, but as a single deletion of everything old followed by a single insertion of -everything new, and the number `m` controls this aspect of the -B -+everything new, and the number __ controls this aspect of the -B ++everything new, and the number __ controls this aspect of the `-B` option (defaults to 60%). `-B/70%` specifies that less than 30% of the original should remain in the result for Git to consider it a total rewrite (i.e. otherwise the resulting patch will be a series of @@ Documentation/diff-options.txt: It affects the way a change that amounts to a to --M[]:: ---find-renames[=]:: -+`-M`[__]:: -+`--find-renames`[++=++____]:: ++`-M[]`:: ++`--find-renames[=]`:: ifndef::git-log[] Detect renames. endif::git-log[] @@ Documentation/diff-options.txt: endif::git-log[] --C[]:: ---find-copies[=]:: -+`-C`[__]:: -+`--find-copies`[++=++____]:: ++`-C[]`:: ++`--find-copies[=]`:: Detect copies as well as renames. See also `--find-copies-harder`. - If `n` is specified, it has the same meaning as for `-M`. -+ If __ is specified, it has the same meaning as for ++-M++____. ++ If __ is specified, it has the same meaning as for `-M`. ---find-copies-harder:: +`--find-copies-harder`:: @@ Documentation/diff-options.txt: endif::git-log[] of a delete/create pair. --l:: -+++-l++____:: ++`-l`:: The `-M` and `-C` options involve some preliminary steps that can detect subsets of renames/copies cheaply, followed by an exhaustive fallback portion that compares all remaining @@ Documentation/diff-options.txt: of a delete/create pair. ifndef::git-format-patch[] ---diff-filter=[(A|C|D|M|R|T|U|X|B)...[*]]:: -+`--diff-filter=`[(`A`|`C`|`D`|`M`|`R`|`T`|`U`|`X`|`B`)...[_*_]]:: ++`--diff-filter=[(A|C|D|M|R|T|U|X|B)...[*]]`:: Select only files that are Added (`A`), Copied (`C`), Deleted (`D`), Modified (`M`), Renamed (`R`), have their type (i.e. regular file, symlink, submodule, ...) changed (`T`), @@ Documentation/diff-options.txt: Also, these upper-case letters can be downcased renamed entries cannot appear if detection for those types is disabled. --S:: -+++-S++____:: ++`-S`:: Look for differences that change the number of occurrences of - the specified string (i.e. addition/deletion) in a file. + the specified __ (i.e. addition/deletion) in a file. @@ Documentation/diff-options.txt: very first version of the block. Binary files are searched as well. --G:: -+++-G++____:: ++`-G`:: Look for differences whose patch text contains added/removed - lines that match . + lines that match __. + -To illustrate the difference between `-S --pickaxe-regex` and --`-G`, consider a commit with the following diff in the same -+To illustrate the difference between ++-S++____ `--pickaxe-regex` and -+++-G++____, consider a commit with the following diff in the same ++To illustrate the difference between `-S` `--pickaxe-regex` and + `-G`, consider a commit with the following diff in the same file: + - ---- @@ Documentation/diff-options.txt: filter will be ignored. See the 'pickaxe' entry in linkgit:gitdiffcore[7] for more information. ---find-object=:: -+++--find-object=++____:: ++`--find-object=`:: Look for differences that change the number of occurrences of the specified object. Similar to `-S`, just the argument is different in that it doesn't search for a specific string but for a specific @@ Documentation/diff-options.txt: information. endif::git-format-patch[] --O:: -+++-O++____:: ++`-O`:: Control the order in which files appear in the output. This overrides the `diff.orderFile` configuration variable (see linkgit:git-config[1]). To cancel `diff.orderFile`, @@ Documentation/diff-options.txt: the normal order. ---skip-to=:: ---rotate-to=:: - Discard the files before the named from the output -+++--skip-to=++____:: -+++--rotate-to=++____:: ++`--skip-to=`:: ++`--rotate-to=`:: + Discard the files before the named __ from the output (i.e. 'skip to'), or move them to the end of the output (i.e. 'rotate to'). These options were invented primarily for the use @@ Documentation/diff-options.txt: the normal order. ---relative[=]:: ---no-relative:: -+`--relative`[++=++____]:: ++`--relative[=]`:: +`--no-relative`:: When run from a subdirectory of the project, it can be told to exclude changes outside the directory and show @@ Documentation/diff-options.txt: the normal order. --I:: ---ignore-matching-lines=:: - Ignore changes whose all lines match . This option may -+++-I++____:: -+++--ignore-matching-lines=++____:: ++ ++`-I`:: ++`--ignore-matching-lines=`:: + Ignore changes whose all lines match __. This option may be specified more than once. ---inter-hunk-context=:: - Show the context between diff hunks, up to the specified number -+++--inter-hunk-context=++____:: ++`--inter-hunk-context=`:: + Show the context between diff hunks, up to the specified __ of lines, thereby fusing hunks that are close to each other. Defaults to `diff.interHunkContext` or 0 if the config option @@ Documentation/diff-options.txt: endif::git-format-patch[] - Ignore changes to submodules in the diff generation. can be - either "none", "untracked", "dirty" or "all", which is the default. - Using "none" will consider the submodule modified when it either contains -+`--ignore-submodules`[++=++____]:: -+ Ignore changes to submodules in the diff generation. __ can be -+ either `none`, `untracked`, `dirty` or `all`, which is the default. +- untracked or modified files or its HEAD differs from the commit recorded ++ ++`--ignore-submodules[=(none|untracked|dirty|all)]`:: ++ Ignore changes to submodules in the diff generation. `all` is the default. + Using `none` will consider the submodule modified when it either contains - untracked or modified files or its HEAD differs from the commit recorded ++ untracked or modified files or its `HEAD` differs from the commit recorded in the superproject and can be used to override any settings of the - 'ignore' option in linkgit:git-config[1] or linkgit:gitmodules[5]. When - "untracked" is used submodules are not considered dirty when they only @@ Documentation/diff-options.txt: endif::git-format-patch[] ---src-prefix=:: - Show the given source prefix instead of "a/". -+++--src-prefix=++____:: ++`--src-prefix=`:: + Show the given source __ instead of "a/". ---dst-prefix=:: - Show the given destination prefix instead of "b/". -+++--dst-prefix=++____:: ++`--dst-prefix=`:: + Show the given destination __ instead of "b/". ---no-prefix:: @@ Documentation/diff-options.txt: endif::git-format-patch[] Use the default source and destination prefixes ("a/" and "b/"). This overrides configuration variables such as `diff.noprefix`, `diff.srcPrefix`, `diff.dstPrefix`, and `diff.mnemonicPrefix` - (see `git-config`(1)). +- (see `git-config`(1)). ++ (see linkgit:git-config[1]). ---line-prefix=:: - Prepend an additional prefix to every line of output. -+++--line-prefix=++____:: ++`--line-prefix=`:: + Prepend an additional __ to every line of output. ---ita-invisible-in-index:: 3: 81b5782d152 ! 3: 8fec37ee174 doc: git-diff: apply format changes to diff-format @@ Metadata Author: Jean-Noël Avila ## Commit message ## - doc: git-diff: apply format changes to diff-format + doc: git-diff: apply format changes to diff-format Signed-off-by: Jean-Noël Avila @@ Documentation/diff-format.txt compared differs: -git-diff-index :: -+`git-diff-index` __:: - compares the and the files on the filesystem. +- compares the and the files on the filesystem. ++`git-diff-index `:: ++ compares the __ and the files on the filesystem. -git-diff-index --cached :: -+`git-diff-index --cached` __:: - compares the and the index. +- compares the and the index. ++`git-diff-index --cached `:: ++ compares the __ and the index. -git-diff-tree [-r] [...]:: -+`git-diff-tree` [`-r`] __ __ [__...]:: ++`git-diff-tree [-r] [...]`:: compares the trees named by the two arguments. -git-diff-files [...]:: -+`git-diff-files` [__...]:: ++`git-diff-files [...]`:: compares the index and the files on the filesystem. -The "git-diff-tree" command begins its output by printing the hash of 4: 3c475a2ee4e ! 4: daed146639d doc: git-diff: apply format changes to diff-generate-patch @@ Metadata Author: Jean-Noël Avila ## Commit message ## - doc: git-diff: apply format changes to diff-generate-patch + doc: git-diff: apply format changes to diff-generate-patch Signed-off-by: Jean-Noël Avila @@ Documentation/diff-generate-patch.txt: or like this (when the `--cc` option is u - mode ,.. - new file mode - deleted file mode , - + --The `mode ,..` line appears only if at least one of --the is different from the rest. Extended headers with +++ +[synopsis] -+index ,`..` ++index ,.. +mode ,`..` +new file mode +deleted file mode , -++ -+The `mode` ____++,++____++..++____ line appears only if at least one of -+the __ is different from the rest. Extended headers with + + + The `mode ,..` line appears only if at least one of + the is different from the rest. Extended headers with information about detected content movement (renames and copying detection) are designed to work with the diff of two - and are not used by combined diff format. 5: acb5bdda904 ! 5: 17a2f028d59 doc: git-diff: apply format changes to config part @@ Metadata Author: Jean-Noël Avila ## Commit message ## - doc: git-diff: apply format changes to config part + doc: git-diff: apply format changes to config part Signed-off-by: Jean-Noël Avila @@ Documentation/config/diff.txt default behavior of the `--dirstat` option to linkgit:git-diff[1] and friends. The defaults can be overridden on the command line - (using `--dirstat=`). The fallback defaults -+ (using ++--dirstat=++____++,++____...). The fallback defaults ++ (using `--dirstat=,...`). The fallback defaults (when not changed by `diff.dirstat`) are `changes,noncumulative,3`. The following parameters are available: + @@ Documentation/config/diff.txt: directories with less than 10% of the total amoun your files, you might want to use linkgit:gitattributes[5] instead. -diff.trustExitCode:: +- If this boolean value is set to true then the +`diff.trustExitCode`:: - If this boolean value is set to true then the ++ If this boolean value is set to `true` then the `diff.external` command is expected to return exit code 0 if it considers the input files to be equal or 1 if it - considers them to be different, like `diff(1)`. @@ Documentation/config/diff.txt: directories with less than 10% of the total amoun this configuration is in effect, reverse diff output also swaps the order of the prefixes: @@ Documentation/config/diff.txt: diff.mnemonicPrefix:: + compares a (c)ommit and the (w)ork tree; + `git diff --cached`;; + compares a (c)ommit and the (i)ndex; +-`git diff HEAD:file1 file2`;; ++`git diff HEAD: `;; + compares an (o)bject and a (w)ork tree entity; `git diff --no-index a b`;; compares two non-git things (1) and (2). @@ Documentation/config/diff.txt: diff.mnemonicPrefix:: characters are *ignorable* whitespace. -diff..command:: -+++diff.++____++.command++:: ++`diff..command`:: The custom diff driver command. See linkgit:gitattributes[5] for details. -diff..trustExitCode:: -+++diff.++____++.trustExitCode++:: ++`diff..trustExitCode`:: If this boolean value is set to true then the -- `diff..command` command is expected to return exit code -+ ++diff.++____++.command++ command is expected to return exit code + `diff..command` command is expected to return exit code 0 if it considers the input files to be equal or 1 if it - considers them to be different, like `diff(1)`. + considers them to be different, like `diff`(1). @@ Documentation/config/diff.txt: diff.mnemonicPrefix:: Any other exit code causes Git to report a fatal error. -diff..xfuncname:: -+++diff.++____++.xfuncname++:: ++`diff..xfuncname`:: The regular expression that the diff driver should use to recognize the hunk header. A built-in pattern may also be used. See linkgit:gitattributes[5] for details. -diff..binary:: - Set this option to true to make the diff driver treat files as -+++diff.++____++.binary++:: ++`diff..binary`:: + Set this option to `true` to make the diff driver treat files as binary. See linkgit:gitattributes[5] for details. -diff..textconv:: -+++diff.++____++.textconv++:: ++`diff..textconv`:: The command that the diff driver should call to generate the text-converted version of a file. The result of the conversion is used to generate a human-readable diff. See linkgit:gitattributes[5] for details. -diff..wordRegex:: -+++diff.++____++.wordRegex++:: ++`diff..wordRegex`:: The regular expression that the diff driver should use to split words in a line. See linkgit:gitattributes[5] for details. -diff..cachetextconv:: -+++diff.++____++.cachetextconv++:: ++`diff..cachetextconv`:: Set this option to true to make the diff driver cache the text conversion outputs. See linkgit:gitattributes[5] for details. @@ Documentation/config/diff.txt: diff.mnemonicPrefix:: Choose a diff algorithm. The variants are as follows: + -- +-`default`, `myers`;; ++`default`;; ++`myers`;; + The basic greedy diff algorithm. Currently, this is the default. + `minimal`;; + Spend extra time to make sure the smallest possible diff is @@ Documentation/config/diff.txt: diff.algorithm:: -- + @@ Documentation/config/diff.txt: diff.algorithm:: Highlight whitespace errors in the `context`, `old` or `new` lines of the diff. Multiple values are separated by comma, `none` resets previous values, `default` reset the list to - `new` and `all` is a shorthand for `old,new,context`. The - whitespace errors are colored with `color.diff.whitespace`. -- The command line option `--ws-error-highlight=` -+ The command line option ++--ws-error-highlight=++____ +@@ Documentation/config/diff.txt: diff.wsErrorHighlight:: + The command line option `--ws-error-highlight=` overrides this setting. -diff.colorMoved:: @@ Documentation/config/diff.txt: diff.algorithm:: When moved lines are colored using e.g. the `diff.colorMoved` setting, - this option controls the `` how spaces are treated. - For details of valid modes see '--color-moved-ws' in linkgit:git-diff[1]. -+ this option controls the __ how spaces are treated. ++ this option controls the mode how spaces are treated. + For details of valid modes see `--color-moved-ws` in linkgit:git-diff[1].