Documentation fixes for v2.27.0-rc0
cover Documentation fixes for v2.27.0-rc0
I've gone through
doc-diff v2.26.0 v2.27.0-rc0
and identified a few misrenderings. Here's my attempt to address them.
Working on this, I also got to look at the new features in the upcoming release from another angle -- looking good!
Martin Ågren (7):
date-formats.txt: fix list continuation
git-bugreport.txt: fix reference to strftime(3)
git-commit-graph.txt: fix grammo
git-commit-graph.txt: fix list rendering
git-credential.txt: use list continuation
git-sparse-checkout.txt: add missing '
rev-list-options.txt
Documentation/date-formats.txt | 3 +-- Documentation/git-bugreport.txt | 2 +- Documentation/git-commit-graph.txt | 3 ++- Documentation/git-credential.txt | 16 +++++------ Documentation/git-sparse-checkout.txt | 2 +- Documentation/rev-list-options.txt | 38 +++++++++++++-------------- 6 files changed, 32 insertions(+), 32 deletions(-)
Signature · 1 line
2.27.0.rc0
PATCH 1/7 date-formats.txt: fix list continuation
The blank line before the lone "+" means it isn't detected as a list continuation, but instead renders literally, at least with AsciiDoc. Drop the empty line and, while at it, add a closing period to the preceding paragraph.
--- Documentation/date-formats.txt | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-)
Documentation/date-formats.txt +1 -2
@@ -22,8 +22,7 @@ ISO 8601:: `2005-04-07T22:13:13`. The parser accepts a space instead of the `T` character as well. Fractional parts of a second will be ignored, for example `2005-04-07T22:13:13.019` will be treated as - `2005-04-07T22:13:13` - + `2005-04-07T22:13:13`. + NOTE: In addition, the date part is accepted in the following formats: `YYYY.MM.DD`, `MM/DD/YYYY` and `DD.MM.YYYY`.
Signature · 1 line
2.27.0.rc0
PATCH 2/7 git-bugreport.txt: fix reference to strftime(3)
In reply to Martin ÅgrenWhen we say "link:strftime[3]", it ends up rendered as "3[1]" and we produce a footnote referring to the non-existing file:///.../git-doc/strftime. Make sure we use gitlink, not link, to get the effect we're after.
--- Documentation/git-bugreport.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
Documentation/git-bugreport.txt +1 -1
@@ -46,7 +46,7 @@ OPTIONS --suffix <format>:: Specify an alternate suffix for the bugreport name, to create a file named 'git-bugreport-<formatted suffix>'. This should take the form of a - link:strftime[3] format string; the current local time will be used. + linkgit:strftime[3] format string; the current local time will be used. GIT ---
Signature · 1 line
2.27.0.rc0
Re: [PATCH 2/7] git-bugreport.txt: fix reference to strftime(3)
Quoted 3 lines · Martin Ågren
When we say "link:strftime[3]", it ends up rendered as "3[1]" and we produce a footnote referring to the non-existing file:///.../git-doc/strftime. Make sure we use gitlink, not link, to get
s/gitlink/linkgit/
Quoted 3 lines
the effect we're after.
Signed-off-by Martin Ågren <[email protected]>
Re: [PATCH 2/7] git-bugreport.txt: fix reference to strftime(3)
Quoted 7 lines · Eric Sunshine
Quoted 3 lines · Martin Ågren
When we say "link:strftime[3]", it ends up rendered as "3[1]" and we produce a footnote referring to the non-existing file:///.../git-doc/strftime. Make sure we use gitlink, not link, to get
s/gitlink/linkgit/
Oops, thanks! At least the diff is correct.
Martin
Re: [PATCH 2/7] git-bugreport.txt: fix reference to strftime(3)
Quoted 9 lines · Eric Sunshine
Quoted 5 lines · Eric Sunshine
Quoted 3 lines · Martin Ågren
When we say "link:strftime[3]", it ends up rendered as "3[1]" and we produce a footnote referring to the non-existing file:///.../git-doc/strftime. Make sure we use gitlink, not link, to get
s/gitlink/linkgit/
Oops, thanks! At least the diff is correct.
Martin
Not even sure of that: strftime is not an internal manpage, so for html target, we will end up with a hyperlink to an non-existing file strftime.html. So I would keep it as simple text.
JN
Re: [PATCH 2/7] git-bugreport.txt: fix reference to strftime(3)
Quoted 7 lines · Jean-Noël Avila
Quoted 5 lines · Eric Sunshine
Quoted 4 lines · Eric Sunshine
Quoted 3 lines · Martin Ågren
When we say "link:strftime[3]", it ends up rendered as "3[1]" and we produce a footnote referring to the non-existing file:///.../git-doc/strftime. Make sure we use gitlink, not link, to get
Quoted 7 lines
Quoted 3 lines
Quoted 1 line
s/gitlink/linkgit/
Oops, thanks! At least the diff is correct.
Not even sure of that: strftime is not an internal manpage, so for html target, we will end up with a hyperlink to an non-existing file strftime.html. So I would keep it as simple text.
That's a good point. I don't use the HTML versions myself, so I haven't thought about the *linking* nature much -- I just see the formatting. But you're right. Grepping around, we only seem to use linkgit to refer to our own docs. So this should probably just be "strftime(3)" as you say.
Thanks,
Martin
PATCH 3/7 git-commit-graph.txt: fix grammo
In reply to Martin ÅgrenIt's easy to mix up the possessive "its" and "it's" ("it is"). Correct an instance of this.
--- Documentation/git-commit-graph.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
Documentation/git-commit-graph.txt +1 -1
@@ -58,7 +58,7 @@ With the `--append` option, include all commits that are present in the existing commit-graph file. + With the `--changed-paths` option, compute and write information about the -paths changed between a commit and it's first parent. This operation can +paths changed between a commit and its first parent. This operation can take a while on large repositories. It provides significant performance gains for getting history of a directory or a file with `git log -- <path>`. +
Signature · 1 line
2.27.0.rc0
Re: [PATCH 3/7] git-commit-graph.txt: fix grammo
Quoted 2 lines · Martin Ågren
It's easy to mix up the possessive "its" and "it's" ("it is"). Correct an instance of this.
Good catch. Thanks!
-Stolee
PATCH 4/7 git-commit-graph.txt: fix list rendering
In reply to Martin ÅgrenThe first list item follows immediately on the paragraph where we introduce the list. This makes the "*" render literally as part of one huge paragraph. (With AsciiDoc, everything is fine after that, but with Asciidoctor, we get some minor follow-on errors.) Add an empty line -- with a list continuation ("+") -- to make the first list item render ok.
--- Documentation/git-commit-graph.txt | 1 + 1 file changed, 1 insertion(+)
Documentation/git-commit-graph.txt +1 -0
@@ -68,6 +68,7 @@ chain of multiple commit-graph files stored in strategy and other splitting options. The new commits not already in the commit-graph are added in a new "tip" file. This file is merged with the existing file if the following merge conditions are met: ++ * If `--split=no-merge` is specified, a merge is never performed, and the remaining options are ignored. `--split=replace` overwrites the existing chain with a new one. A bare `--split` defers to the remaining
Signature · 1 line
2.27.0.rc0
PATCH 5/7 git-credential.txt: use list continuation
In reply to Martin ÅgrenUse list continuation to avoid the second and third paragraphs rendering with a different indentation from the first one where we describe the "url" attribute.
--- Documentation/git-credential.txt | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-)
Documentation/git-credential.txt +8 -8
@@ -151,11 +151,11 @@ Git understands the following attributes: were read (e.g., `url=https://example.com` would behave as if `protocol=https` and `host=example.com` had been provided). This can help callers avoid parsing URLs themselves. - - Note that specifying a protocol is mandatory and if the URL - doesn't specify a hostname (e.g., "cert:///path/to/file") the - credential will contain a hostname attribute whose value is an - empty string. - - Components which are missing from the URL (e.g., there is no - username in the example above) will be left unset. ++ +Note that specifying a protocol is mandatory and if the URL +doesn't specify a hostname (e.g., "cert:///path/to/file") the +credential will contain a hostname attribute whose value is an +empty string. ++ +Components which are missing from the URL (e.g., there is no +username in the example above) will be left unset.
Signature · 1 line
2.27.0.rc0
Re: [PATCH 5/7] git-credential.txt: use list continuation
PATCH 6/7 git-sparse-checkout.txt: add missing '
In reply to Martin ÅgrenWhere we explain the 'reapply' command, we don't properly wrap it in single quote marks like we do with the other commands: We omit the closing mark ("'reapply") and this ends up being rendered literally as "'reapply". Add the missing "'".
--- Documentation/git-sparse-checkout.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
Documentation/git-sparse-checkout.txt +1 -1
@@ -70,7 +70,7 @@ C-style quoted strings. `core.sparseCheckoutCone` is enabled, the given patterns are interpreted as directory names as in the 'set' subcommand. -'reapply:: +'reapply':: Reapply the sparsity pattern rules to paths in the working tree. Commands like merge or rebase can materialize paths to do their work (e.g. in order to show you a conflict), and other
Signature · 1 line
2.27.0.rc0
Re: [PATCH 6/7] git-sparse-checkout.txt: add missing '
Quoted 15 lines · Martin Ågren
Where we explain the 'reapply' command, we don't properly wrap it in single quote marks like we do with the other commands: We omit the closing mark ("'reapply") and this ends up being rendered literally as "'reapply". Add the missing "'".
Signed-off-by Martin Ågren <[email protected]>--- Documentation/git-sparse-checkout.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)Documentation/git-sparse-checkout.txt +0
-0
Documentation/git-sparse-checkout.txt C-style quoted strings. · line 73
Quoted 5 lines
Documentation/git-sparse-checkout.txt +1
-1@@ -70,7 +70,7 @@ C-style quoted strings. `core.sparseCheckoutCone` is enabled, the given patterns are interpreted as directory names as in the 'set' subcommand. -'reapply:: +'reapply'::
Subtle! But good catch. Thanks!
-Stolee
PATCH 7/7 rev-list-options.txt
In reply to Martin ÅgrenThe explanation of the --show-pulls option added in commit 8d049e182e ("revision: --show-pulls adds helpful merges", 2020-04-10) consists of several paragraphs and we use "+" throughout to tie them together in one long chain of list continuations. Only thing is, we're not in any kind of list, so these pluses end up being rendered literally.
The preceding few paragraphs describe --ancestry-path and there we *do* have a list, since we've started one with --ancestry-path::. But we don't have a similar list running here. We could tie all our paragraphs from 8d049e182e to that list, but that doesn't make much
sense: We aim to describe another option entirely.
We could start a new list item:
--show-pulls:
Before discussing another option, --show-pulls, we need to create a new example history.
+
...
That reads somewhat awkwardly to me. Not to mention that the chain of paragraphs that follows is fairly long, introducing a new example history and discussing it in quite some detail. Let's make this run along without any kind of indentation. It effectively means that we're treating "Before discussing..." as a paragraph on the same level as "There is another simplification mode available:" which precedes the --ancestry-path:: list.
If we really want a --show-pulls:: list somewhere, we could perhaps let it begin around "The --show-pulls option helps with both of these issues ..." further down. But for now, let's just focus on getting rid of those literal pluses.
--- Documentation/rev-list-options.txt | 38 +++++++++++++++--------------- 1 file changed, 19 insertions(+), 19 deletions(-)
Documentation/rev-list-options.txt +19 -19
@@ -581,12 +581,12 @@ option does. Applied to the 'D..M' range, it results in: Before discussing another option, `--show-pulls`, we need to create a new example history. -+ + A common problem users face when looking at simplified history is that a commit they know changed a file somehow does not appear in the file's simplified history. Let's demonstrate a new example and show how options such as `--full-history` and `--simplify-merges` works in that case: -+ + ----------------------------------------------------------------------- .-A---M-----C--N---O---P / / \ \ \/ / /
@@ -595,7 +595,7 @@ such as `--full-history` and `--simplify-merges` works in that case: \ / /\ / `---X--' `---Y--' ----------------------------------------------------------------------- -+ + For this example, suppose `I` created `file.txt` which was modified by `A`, `B`, and `X` in different ways. The single-parent commits `C`, `Z`, and `Y` do not change `file.txt`. The merge commit `M` was created by
@@ -607,19 +607,19 @@ the contents of `file.txt` at `X`. Hence, `R` is TREESAME to `X` but not contents of `file.txt` at `R`, so `N` is TREESAME to `R` but not `C`. The merge commits `O` and `P` are TREESAME to their first parents, but not to their second parents, `Z` and `Y` respectively. -+ + When using the default mode, `N` and `R` both have a TREESAME parent, so those edges are walked and the others are ignored. The resulting history graph is: -+ + ----------------------------------------------------------------------- I---X ----------------------------------------------------------------------- -+ + When using `--full-history`, Git walks every edge. This will discover the commits `A` and `B` and the merge `M`, but also will reveal the merge commits `O` and `P`. With parent rewriting, the resulting graph is: -+ + ----------------------------------------------------------------------- .-A---M--------N---O---P / / \ \ \/ / /
@@ -628,21 +628,21 @@ merge commits `O` and `P`. With parent rewriting, the resulting graph is: \ / /\ / `---X--' `------' ----------------------------------------------------------------------- -+ + Here, the merge commits `O` and `P` contribute extra noise, as they did not actually contribute a change to `file.txt`. They only merged a topic that was based on an older version of `file.txt`. This is a common issue in repositories using a workflow where many contributors work in parallel and merge their topic branches along a single trunk: manu unrelated merges appear in the `--full-history` results. -+ + When using the `--simplify-merges` option, the commits `O` and `P` disappear from the results. This is because the rewritten second parents of `O` and `P` are reachable from their first parents. Those edges are removed and then the commits look like single-parent commits that are TREESAME to their parent. This also happens to the commit `N`, resulting in a history view as follows: -+ + ----------------------------------------------------------------------- .-A---M--. / / \
@@ -651,18 +651,18 @@ in a history view as follows: \ / / `---X--' ----------------------------------------------------------------------- -+ + In this view, we see all of the important single-parent changes from `A`, `B`, and `X`. We also see the carefully-resolved merge `M` and the not-so-carefully-resolved merge `R`. This is usually enough information to determine why the commits `A` and `B` "disappeared" from history in the default view. However, there are a few issues with this approach. -+ + The first issue is performance. Unlike any previous option, the `--simplify-merges` option requires walking the entire commit history before returning a single result. This can make the option difficult to use for very large repositories. -+ + The second issue is one of auditing. When many contributors are working on the same repository, it is important which merge commits introduced a change into an important branch. The problematic merge `R` above is
@@ -671,26 +671,26 @@ important branch. Instead, the merge `N` was used to merge `R` and `X` into the important branch. This commit may have information about why the change `X` came to override the changes from `A` and `B` in its commit message. -+ + The `--show-pulls` option helps with both of these issues by adding more merge commits to the history results. If a merge is not TREESAME to its first parent but is TREESAME to a later parent, then that merge is treated as if it "pulled" the change from another branch. When using `--show-pulls` on this example (and no other options) the resulting graph is: -+ + ----------------------------------------------------------------------- I---X---R---N ----------------------------------------------------------------------- -+ + Here, the merge commits `R` and `N` are included because they pulled the commits `X` and `R` into the base branch, respectively. These merges are the reason the commits `A` and `B` do not appear in the default history. -+ + When `--show-pulls` is paired with `--simplify-merges`, the graph includes all of the necessary information: -+ + ----------------------------------------------------------------------- .-A---M--. N / / \ /
@@ -699,7 +699,7 @@ graph includes all of the necessary information: \ / / `---X--' ----------------------------------------------------------------------- -+ + Notice that since `M` is reachable from `R`, the edge from `N` to `M` was simplified away. However, `N` still appears in the history as an important commit because it "pulled" the change `R` into the main
Signature · 1 line
2.27.0.rc0
Re: [PATCH 7/7] rev-list-options.txt
Quoted 28 lines · Martin Ågren
The explanation of the
--show-pullsoption added in commit8d049e182e("revision: --show-pulls adds helpful merges", 2020-04-10) consists of several paragraphs and we use "+" throughout to tie them together in one long chain of list continuations. Only thing is, we're not in any kind of list, so these pluses end up being rendered literally.The preceding few paragraphs describe
--ancestry-pathand there we *do* have a list, since we've started one with--ancestry-path::. But we don't have a similar list running here. We could tie all our paragraphs from8d049e182eto that list, but that doesn't make much
sense: We aim to describe another option entirely.We could start a new list item:
--show-pulls:
Before discussing another option,--show-pulls, we need to create a new example history.
+...That reads somewhat awkwardly to me. Not to mention that the chain of paragraphs that follows is fairly long, introducing a new example history and discussing it in quite some detail. Let's make this run along without any kind of indentation. It effectively means that we're treating "Before discussing..." as a paragraph on the same level as "There is another simplification mode available:" which precedes the
--ancestry-path::list.
Quoted 4 lines
If we really want a
--show-pulls::list somewhere, we could perhaps let it begin around "The--show-pullsoption helps with both of these issues ..." further down. But for now, let's just focus on getting rid of those literal pluses.
I think the way you adjusted the preamble is good. It matches this prior work before --ancestry-path:
Finally, there is a fifth simplification mode available: --ancestry-path:: (description) + (example) + ...
And you're right, we do drop the "--show-pulls::" itemization. Will that make it hard to link to that exact option? Probably.
What about the fixup below, to create this list item?
Thanks,
-Stolee
-- >8 --
From 6416bbc14fbdb21868c6f3b609f66e5fe5607265 Mon Sep 17 00:00:00 2001
From: Derrick Stolee <[email protected]>
Date: Mon, 18 May 2020 10:55:59 -0400
Subject: [PATCH] fixup! rev-list-options.txt
--- Documentation/rev-list-options.txt | 19 +++++++++++-------- 1 file changed, 11 insertions(+), 8 deletions(-)
Documentation/rev-list-options.txt +11 -8
@@ -672,25 +672,28 @@ into the important branch. This commit may have information about why the change `X` came to override the changes from `A` and `B` in its commit message. -The `--show-pulls` option helps with both of these issues by adding more -merge commits to the history results. If a merge is not TREESAME to its -first parent but is TREESAME to a later parent, then that merge is +--show-pulls:: + In addition to the commits shown in the default history, show + each merge commit that is not TREESAME to its first parent but + is TREESAME to a later parent. ++ +When a merge commit is included by `--show-pulls`, the merge is treated as if it "pulled" the change from another branch. When using `--show-pulls` on this example (and no other options) the resulting graph is: - ++ ----------------------------------------------------------------------- I---X---R---N ----------------------------------------------------------------------- - ++ Here, the merge commits `R` and `N` are included because they pulled the commits `X` and `R` into the base branch, respectively. These merges are the reason the commits `A` and `B` do not appear in the default history. - ++ When `--show-pulls` is paired with `--simplify-merges`, the graph includes all of the necessary information: - ++ ----------------------------------------------------------------------- .-A---M--. N / / \ /
@@ -699,7 +702,7 @@ graph includes all of the necessary information: \ / / `---X--' ----------------------------------------------------------------------- - ++ Notice that since `M` is reachable from `R`, the edge from `N` to `M` was simplified away. However, `N` still appears in the history as an important commit because it "pulled" the change `R` into the main
Signature · 1 line
2.27.0.rc0
Re: [PATCH 7/7] rev-list-options.txt
Hi Stolee,
(I realize now that the subject/oneliner of this patch is completely broken. Hmpf.)
Quoted 19 lines · Derrick Stolee
Quoted 4 lines · Martin Ågren
If we really want a
--show-pulls::list somewhere, we could perhaps let it begin around "The--show-pullsoption helps with both of these issues ..." further down. But for now, let's just focus on getting rid of those literal pluses.I think the way you adjusted the preamble is good. It matches this prior work before --ancestry-path:
Finally, there is a fifth simplification mode available: --ancestry-path:: (description) + (example) + ...
Quoted 4 lines
And you're right, we do drop the "--show-pulls::" itemization. Will that make it hard to link to that exact option? Probably.
What about the fixup below, to create this list item?
I considered creating the list item, but like you, I figured it required more surgery to the text than I felt like pursuing. Thanks for making a concrete suggestion.
Documentation/rev-list-options.txt into the important branch. This commit may have information about why · line 683
Quoted 12 lines
Documentation/rev-list-options.txt +6
-3-The `--show-pulls` option helps with both of these issues by adding more -merge commits to the history results. If a merge is not TREESAME to its -first parent but is TREESAME to a later parent, then that merge is +--show-pulls:: + In addition to the commits shown in the default history, show + each merge commit that is not TREESAME to its first parent but + is TREESAME to a later parent. ++ +When a merge commit is included by `--show-pulls`, the merge is treated as if it "pulled" the change from another branch. When using `--show-pulls` on this example (and no other options) the resulting graph is:
I currently have the commit message below for my patch plus your fixup.
Thanks,
Martin
rev-list-options.txt: start a list for show-pulls
The explanation of the --show-pulls option added in commit 8d049e182e ("revision: --show-pulls adds helpful merges", 2020-04-10) consists of several paragraphs and we use "+" throughout to tie them together in one long chain of list continuations. Only thing is, we're not in any kind of list, so these pluses end up being rendered literally.
The preceding few paragraphs describe --ancestry-path and there we *do* have a list, since we've started one with --ancestry-path::. In fact, we have several such lists for all the various history-simplifying options we're discussing earlier in this file.
Thus, we're missing a list both from a consistency point of view and from a practical rendering standpoint.
Let's start a list for --show-pulls where we start actually discussing the option, and keep the paragraphs preceding it out of that list. That is, drop all those pluses before the new list we're adding here.
Re: [PATCH 7/7] rev-list-options.txt
Quoted 2 lines · Martin Ågren
I currently have the commit message below for my patch plus your fixup.
...
I've queued 1, 3, 4, 5, and 6 in the meantime. Todd gave us a replacement for 2, which I also took.
Thanks.
PATCH v2 1/1 rev-list-options.txt: start a list for `show-pulls`
Quoted 10 lines · Junio C Hamano
Quoted 2 lines · Martin Ågren
I currently have the commit message below for my patch plus your fixup.
...I've queued 1, 3, 4, 5, and 6 in the meantime. Todd gave us a replacement for 2, which I also took.
Thanks.
A long weekend offline passes and it's already a week later...
Here is my original patch 7/7 plus Stolee's fixup, with the rephrased commit message from upthread. I've tried to test it from all angles I can think of -- AsciiDoc/Asciidoctor, man/html, doc-diff, ... It should be low-risk and does avoid beginning ~20 paragraphs with a literal "+" in the rendered docs for this new option.
Martin
-- >8 --
The explanation of the --show-pulls option added in commit 8d049e182e ("revision: --show-pulls adds helpful merges", 2020-04-10) consists of several paragraphs and we use "+" throughout to tie them together in one long chain of list continuations. Only thing is, we're not in any kind of list, so these pluses end up being rendered literally.
The preceding few paragraphs describe --ancestry-path and there we *do* have a list, since we've started one with --ancestry-path::. In fact, we have several such lists for all the various history-simplifying options we're discussing earlier in this file.
Thus, we're missing a list both from a consistency point of view and from a practical rendering standpoint.
Let's start a list for --show-pulls where we start actually discussing the option, and keep the paragraphs preceding it out of that list. That is, drop all those pluses before the new list we're adding here.
--- Documentation/rev-list-options.txt | 35 ++++++++++++++++-------------- 1 file changed, 19 insertions(+), 16 deletions(-)
Documentation/rev-list-options.txt +19 -16
@@ -581,12 +581,12 @@ option does. Applied to the 'D..M' range, it results in: Before discussing another option, `--show-pulls`, we need to create a new example history. -+ + A common problem users face when looking at simplified history is that a commit they know changed a file somehow does not appear in the file's simplified history. Let's demonstrate a new example and show how options such as `--full-history` and `--simplify-merges` works in that case: -+ + ----------------------------------------------------------------------- .-A---M-----C--N---O---P / / \ \ \/ / /
@@ -595,7 +595,7 @@ such as `--full-history` and `--simplify-merges` works in that case: \ / /\ / `---X--' `---Y--' ----------------------------------------------------------------------- -+ + For this example, suppose `I` created `file.txt` which was modified by `A`, `B`, and `X` in different ways. The single-parent commits `C`, `Z`, and `Y` do not change `file.txt`. The merge commit `M` was created by
@@ -607,19 +607,19 @@ the contents of `file.txt` at `X`. Hence, `R` is TREESAME to `X` but not contents of `file.txt` at `R`, so `N` is TREESAME to `R` but not `C`. The merge commits `O` and `P` are TREESAME to their first parents, but not to their second parents, `Z` and `Y` respectively. -+ + When using the default mode, `N` and `R` both have a TREESAME parent, so those edges are walked and the others are ignored. The resulting history graph is: -+ + ----------------------------------------------------------------------- I---X ----------------------------------------------------------------------- -+ + When using `--full-history`, Git walks every edge. This will discover the commits `A` and `B` and the merge `M`, but also will reveal the merge commits `O` and `P`. With parent rewriting, the resulting graph is: -+ + ----------------------------------------------------------------------- .-A---M--------N---O---P / / \ \ \/ / /
@@ -628,21 +628,21 @@ merge commits `O` and `P`. With parent rewriting, the resulting graph is: \ / /\ / `---X--' `------' ----------------------------------------------------------------------- -+ + Here, the merge commits `O` and `P` contribute extra noise, as they did not actually contribute a change to `file.txt`. They only merged a topic that was based on an older version of `file.txt`. This is a common issue in repositories using a workflow where many contributors work in parallel and merge their topic branches along a single trunk: manu unrelated merges appear in the `--full-history` results. -+ + When using the `--simplify-merges` option, the commits `O` and `P` disappear from the results. This is because the rewritten second parents of `O` and `P` are reachable from their first parents. Those edges are removed and then the commits look like single-parent commits that are TREESAME to their parent. This also happens to the commit `N`, resulting in a history view as follows: -+ + ----------------------------------------------------------------------- .-A---M--. / / \
@@ -651,18 +651,18 @@ in a history view as follows: \ / / `---X--' ----------------------------------------------------------------------- -+ + In this view, we see all of the important single-parent changes from `A`, `B`, and `X`. We also see the carefully-resolved merge `M` and the not-so-carefully-resolved merge `R`. This is usually enough information to determine why the commits `A` and `B` "disappeared" from history in the default view. However, there are a few issues with this approach. -+ + The first issue is performance. Unlike any previous option, the `--simplify-merges` option requires walking the entire commit history before returning a single result. This can make the option difficult to use for very large repositories. -+ + The second issue is one of auditing. When many contributors are working on the same repository, it is important which merge commits introduced a change into an important branch. The problematic merge `R` above is
@@ -671,10 +671,13 @@ important branch. Instead, the merge `N` was used to merge `R` and `X` into the important branch. This commit may have information about why the change `X` came to override the changes from `A` and `B` in its commit message. + +--show-pulls:: + In addition to the commits shown in the default history, show + each merge commit that is not TREESAME to its first parent but + is TREESAME to a later parent. + -The `--show-pulls` option helps with both of these issues by adding more -merge commits to the history results. If a merge is not TREESAME to its -first parent but is TREESAME to a later parent, then that merge is +When a merge commit is included by `--show-pulls`, the merge is treated as if it "pulled" the change from another branch. When using `--show-pulls` on this example (and no other options) the resulting graph is:
Signature · 1 line
2.27.0.rc0
Re: [PATCH v2] rev-list-options.txt: start a list for `show-pulls`
Documentation/rev-list-options.txt important branch. Instead, the merge `N` was used to merge `R` and `X` · line 675
Quoted 12 lines · Martin Ågren
On Mon, 18 May 2020 at 22:22, Junio C Hamano <[email protected]> wrote:
Documentation/rev-list-options.txt +5
-1@@ -671,10 +671,13 @@ important branch. Instead, the merge `N` was used to merge `R` and `X` into the important branch. This commit may have information about why the change `X` came to override the changes from `A` and `B` in its commit message. + +--show-pulls:: + In addition to the commits shown in the default history, show + each merge commit that is not TREESAME to its first parent but + is TREESAME to a later parent. + -The `--show-pulls` option helps with both of these issues by adding more
I like how you found a way to add the list item without needing to make a huge shift in the surrounding prose. LGTM.
Thanks,
-Stolee
Re: [PATCH v2] rev-list-options.txt: start a list for `show-pulls`
Hi Stolee,
Quoted 17 lines · Derrick Stolee
Documentation/rev-list-options.txt important branch. Instead, the merge `N` was used to merge `R` and `X` · line 675
Quoted 12 lines · Martin Ågren
On Mon, 18 May 2020 at 22:22, Junio C Hamano <[email protected]> wrote:
Documentation/rev-list-options.txt +5
-1@@ -671,10 +671,13 @@ important branch. Instead, the merge `N` was used to merge `R` and `X` into the important branch. This commit may have information about why the change `X` came to override the changes from `A` and `B` in its commit message. + +--show-pulls:: + In addition to the commits shown in the default history, show + each merge commit that is not TREESAME to its first parent but + is TREESAME to a later parent. + -The `--show-pulls` option helps with both of these issues by adding moreI like how you found a way to add the list item without needing to make a huge shift in the surrounding prose. LGTM.
Actually, I didn't see how to do it, but luckily, you did. [1] So I take this to mean that even on re-reading your proposed text some time later, you like it. ;-)
Martin
Re: [PATCH v2] rev-list-options.txt: start a list for `show-pulls`
In reply to Martin ÅgrenQuoted 3 lines · Martin Ågren
Let's start a list for
--show-pullswhere we start actually discussing the option, and keep the paragraphs preceding it out of that list. That is, drop all those pluses before the new list we're adding here.
The way the "History Simplification" section is organized is somewhat peculiar in that it begins with a short list of what's available, followed by mixture of detailed explanation in prose. I agree with you two that the result of this patch fits very well to the surrounding text.
This is not a new issue introduced by this patch, but ...
Documentation/rev-list-options.txt important branch. Instead, the merge `N` was used to merge `R` and `X` · line 683
Quoted 9 lines
+--show-pulls::
Documentation/rev-list-options.txt +4
-0+ In addition to the commits shown in the default history, show + each merge commit that is not TREESAME to its first parent but + is TREESAME to a later parent. + +When a merge commit is included by `--show-pulls`, the merge is treated as if it "pulled" the change from another branch. When using `--show-pulls` on this example (and no other options) the resulting graph is:
... "is treated AS IF" somewhat made me go "huh?"; with or without the option, the merge did pull the change from another branch, didn't it? The only effect the option has is to make that fact stand out in the output.
But rewording it is another topic totally different from "we should render this section correctly" fix we have here, and should be done (if it needs to be done in the first place) separately after this change lands.
Thanks, both.
Re: [PATCH v2] rev-list-options.txt: start a list for `show-pulls`
Quoted 14 lines · Junio C Hamano
Quoted 3 lines · Martin Ågren
Let's start a list for
--show-pullswhere we start actually discussing the option, and keep the paragraphs preceding it out of that list. That is, drop all those pluses before the new list we're adding here.The way the "History Simplification" section is organized is somewhat peculiar in that it begins with a short list of what's available, followed by mixture of detailed explanation in prose. I agree with you two that the result of this patch fits very well to the surrounding text.
This is not a new issue introduced by this patch, but ...
Quoted 14 lines
Documentation/rev-list-options.txt important branch. Instead, the merge `N` was used to merge `R` and `X` · line 683
Quoted 9 lines
+--show-pulls::
Documentation/rev-list-options.txt +4
-0+ In addition to the commits shown in the default history, show + each merge commit that is not TREESAME to its first parent but + is TREESAME to a later parent. + +When a merge commit is included by `--show-pulls`, the merge is treated as if it "pulled" the change from another branch. When using `--show-pulls` on this example (and no other options) the resulting graph is:... "is treated AS IF" somewhat made me go "huh?"; with or without the option, the merge did pull the change from another branch, didn't it? The only effect the option has is to make that fact stand out in the output.
I guess the 'as if it "pulled" the change from another branch' sentence is literally talking about the "git pull" command, as opposed to the "git merge" command, or creating the merge upon completion of a pull request on a Git service (which is almost always using libgit2 to generate a merge commit).
Perhaps there is no semantic difference between "pulling" and "merging" and then this could be reworded to be less awkward.
Thanks,
-Stolee
Re: [PATCH v2] rev-list-options.txt: start a list for `show-pulls`
Quoted 21 lines · Derrick Stolee
Quoted 14 lines · Junio C Hamano
Martin Ågren <[email protected]> writes:
This is not a new issue introduced by this patch, but ...
Documentation/rev-list-options.txt important branch. Instead, the merge `N` was used to merge `R` and `X` · line 683
Quoted 9 lines
+--show-pulls::
Documentation/rev-list-options.txt +4
-0+ In addition to the commits shown in the default history, show + each merge commit that is not TREESAME to its first parent but + is TREESAME to a later parent. + +When a merge commit is included by `--show-pulls`, the merge is treated as if it "pulled" the change from another branch. When using `--show-pulls` on this example (and no other options) the resulting graph is:Quoted 4 lines
... "is treated AS IF" somewhat made me go "huh?"; with or without the option, the merge did pull the change from another branch, didn't it? The only effect the option has is to make that fact stand out in the output.
Quoted 8 lines
I guess the 'as if it "pulled" the change from another branch' sentence is literally talking about the "git pull" command, as opposed to the "git merge" command, or creating the merge upon completion of a pull request on a Git service (which is almost always using libgit2 to generate a merge commit).
Perhaps there is no semantic difference between "pulling" and "merging" and then this could be reworded to be less awkward.
Agreed on the awkwardness as it stands (before or after this proposed patch). I don't have any concrete thoughts to offer though.
Martin