threads / patch / 63746

patchdocs: correct mistakes in git-merge

Subject: [PATCH] docs: correct mistakes in git-merge

## tl;dr

3 messages between Jul 5, 2025 and Jul 17, 2025. Diffs are folded; open one to read it.

replies: 2people: 3as markdown or json

Timur Sultanaev via GitGitGadget· Jul 5, 2025, 17:39 UTC · lore
From: Timur Sultanaev <str.write@gmail.com>

Documentation for git-merge incorrectly notes that tip of the current branch on ascii diagram is C , while it is actually G (current branch is master, HEAD on diagram is G).

Additionally diagrams on the page are adjusted to use spaces instead of tabs, so that they align regardless of tab size. This is in line with diagrams on other git documentation pages.

Signed-off-by: Timur Sultanaev <str.write@gmail.com>
---
    Correct mistakes in git-merge documentation
Published-As: https://github.com/gitgitgadget/git/releases/tag/pr-1940%2Fstrowk%2Fmaster-v1
Fetch-It-Via: git fetch https://github.com/gitgitgadget/git pr-1940/strowk/master-v1
Pull-Request: https://github.com/gitgitgadget/git/pull/1940
 Documentation/git-merge.adoc | 10 +++++-----
 1 file changed, 5 insertions(+), 5 deletions(-)
Show changes to Documentation/git-merge.adoc +5 −5
diff --git a/Documentation/git-merge.adoc b/Documentation/git-merge.adoc
index d53923c3b73..a055384ad69 100644
--- a/Documentation/git-merge.adoc
+++ b/Documentation/git-merge.adoc
@@ -28,8 +28,8 @@ Assume the following history exists and the current branch is
 `master`:
 
 ------------
-	  A---B---C topic
-	 /
+          A---B---C topic
+         /
     D---E---F---G master
 ------------
 
@@ -38,11 +38,11 @@ Then `git merge topic` will replay the changes made on the
 its current commit (`C`) on top of `master`, and record the result
 in a new commit along with the names of the two parent commits and
 a log message from the user describing the changes. Before the operation,
-`ORIG_HEAD` is set to the tip of the current branch (`C`).
+`ORIG_HEAD` is set to the tip of the current branch (`G`).
 
 ------------
-	  A---B---C topic
-	 /         \
+          A---B---C topic
+         /         \
     D---E---F---G---H master
 ------------
 

base-commit: 8b6f19ccfc3aefbd0f22f6b7d56ad6a3fc5e4f37
-- 
gitgitgadget
Johannes Schindelin· Jul 17, 2025, 17:12 UTC · re: Timur Sultanaev via GitGitGadget · lore

Re: [PATCH] docs: correct mistakes in git-merge

Hi Tumur,
On Sat, 5 Jul 2025, Timur Sultanaev via GitGitGadget wrote:
Show 11 quoted lines
> From: Timur Sultanaev <str.write@gmail.com>
> 
> Documentation for git-merge incorrectly notes that
> tip of the current branch on ascii diagram is C
> , while it is actually G (current branch is
> master, HEAD on diagram is G).
> 
> Additionally diagrams on the page are adjusted
> to use spaces instead of tabs, so that they align
> regardless of tab size. This is in line with
> diagrams on other git documentation pages.

To be precise, you could add to the commit message that the faulty description was introduced in 0c514d576685 (git-merge.txt: mention 'ORIG_HEAD' in the Description, 2023-01-10). (I Cc:ed Philippe Blain who authored that patch.)

Show 23 quoted lines
> Signed-off-by: Timur Sultanaev <str.write@gmail.com>
> ---
>     Correct mistakes in git-merge documentation
> 
> Published-As: https://github.com/gitgitgadget/git/releases/tag/pr-1940%2Fstrowk%2Fmaster-v1
> Fetch-It-Via: git fetch https://github.com/gitgitgadget/git pr-1940/strowk/master-v1
> Pull-Request: https://github.com/gitgitgadget/git/pull/1940
> 
>  Documentation/git-merge.adoc | 10 +++++-----
>  1 file changed, 5 insertions(+), 5 deletions(-)
> 
> diff --git a/Documentation/git-merge.adoc b/Documentation/git-merge.adoc
> index d53923c3b73..a055384ad69 100644
> --- a/Documentation/git-merge.adoc
> +++ b/Documentation/git-merge.adoc
> @@ -28,8 +28,8 @@ Assume the following history exists and the current branch is
>  `master`:
>  
>  ------------
> -	  A---B---C topic
> -	 /
> +          A---B---C topic
> +         /

This replaces tabs with spaces — though elsewhere in the file, tabs continue to roam free. The change assumes your pager or editor shares Git’s long-standing view that tabs are 8 columns wide (a convention with many loyal followers, even if not universally embraced...). That said, while correcting the description seemed fairly straight-forward, this white-space change appears to tread on more delicate territory. It might deserve its own patch — though I wouldn’t be shocked if it quietly joins the fate of the dodo.

The same applies to the white-space change at the end of this patch.
Show 9 quoted lines
>      D---E---F---G master
>  ------------
>  
> @@ -38,11 +38,11 @@ Then `git merge topic` will replay the changes made on the
>  its current commit (`C`) on top of `master`, and record the result
>  in a new commit along with the names of the two parent commits and
>  a log message from the user describing the changes. Before the operation,
> -`ORIG_HEAD` is set to the tip of the current branch (`C`).
> +`ORIG_HEAD` is set to the tip of the current branch (`G`).
This is obviously a good fix.

Ciao, Johannes

Show 15 quoted lines
>  
>  ------------
> -	  A---B---C topic
> -	 /         \
> +          A---B---C topic
> +         /         \
>      D---E---F---G---H master
>  ------------
>  
> 
> base-commit: 8b6f19ccfc3aefbd0f22f6b7d56ad6a3fc5e4f37
> -- 
> gitgitgadget
> 
> 
Junio C Hamano· Jul 17, 2025, 17:28 UTC · re: Johannes Schindelin · lore

Re: [PATCH] docs: correct mistakes in git-merge

Johannes Schindelin <Johannes.Schindelin@gmx.de> writes:
Show 28 quoted lines
>> Additionally diagrams on the page are adjusted
>> to use spaces instead of tabs, so that they align
>> regardless of tab size. This is in line with
>> diagrams on other git documentation pages.
>
> To be precise, you could add to the commit message that the faulty
> description was introduced in 0c514d576685 (git-merge.txt: mention
> 'ORIG_HEAD' in the Description, 2023-01-10). (I Cc:ed Philippe Blain who
> authored that patch.)
> ...
>>  ------------
>> -	  A---B---C topic
>> -	 /
>> +          A---B---C topic
>> +         /
>
> ... while correcting the description seemed fairly straight-forward, this
> white-space change appears to tread on more delicate territory. It might
> deserve its own patch
> ...
>> @@ -38,11 +38,11 @@ Then `git merge topic` will replay the changes made on the
>>  its current commit (`C`) on top of `master`, and record the result
>>  in a new commit along with the names of the two parent commits and
>>  a log message from the user describing the changes. Before the operation,
>> -`ORIG_HEAD` is set to the tip of the current branch (`C`).
>> +`ORIG_HEAD` is set to the tip of the current branch (`G`).
>
> This is obviously a good fix.

All comments are good ones for contributors to keep in mind for their next attempt.

For this particular one, which is already in 'master', there is no point in polishing and resending the patch, though ;-)

Thanks.

← back to recent threads