[PATCH 0/6] git-merge: a few documentation improvements
From: Sergey OrganovSergey Organov (6): git-merge: clarify "usage" by adding "-m " Documentation/git-merge.txt: remove list of options from SYNOPSIS Documentation/git-merge.txt: fix SYNOPSIS of obsolete form to include options Documentation/git-merge.txt: improve short description in NAME Documentation/git-merge.txt: improve short description in DESCRIPTION Documentation/git-merge.txt: get rid of irrelevant references to git-pull Documentation/git-merge.txt | 63 ++--- builtin/merge.c | 2 +- 2 files changed, 32 insertions(+), 33 deletions(-) -- 2.10.0.1.g57b01a3
[PATCH 2/6] Documentation/git-merge.txt: remove list of options from SYNOPSIS
From: Sergey OrganovThis partial list of option is confusing as it lacks a lot of available options. It also clutters the SYNOPSIS making differences between forms of invocation less clear. Signed-off-by: Sergey Organov --- Documentation/git-merge.txt | 5 + 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/Documentation/git-merge.txt b/Documentation/git-merge.txt index b758d55..90342eb 100644 --- a/Documentation/git-merge.txt +++ b/Documentation/git-merge.txt @@ -9,10 +9,7 @@ git-merge - Join two or more development histories together SYNOPSIS [verse] -'git merge' [-n] [--stat] [--no-commit] [--squash] [--[no-]edit] - [-s ] [-X ] [-S[]] - [--[no-]allow-unrelated-histories] - [--[no-]rerere-autoupdate] [-m ] [...] +'git merge' [options] [-m ] [...] 'git merge' HEAD ... 'git merge' --abort -- 2.10.0.1.g57b01a3
[PATCH 1/6] git-merge: clarify "usage" by adding "-m "
From: Sergey Organov"-m " is one of essential distinctions between obsolete invocation form and the recent one. Add it to the "usage" returned by 'git merge -h' for more clarity. Signed-off-by: Sergey Organov --- builtin/merge.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/builtin/merge.c b/builtin/merge.c index a8b57c7..0e367ba 100644 --- a/builtin/merge.c +++ b/builtin/merge.c @@ -43,7 +43,7 @@ struct strategy { }; static const char * const builtin_merge_usage[] = { - N_("git merge [] [...]"), + N_("git merge [] [-m ] [...]"), N_("git merge [] HEAD "), N_("git merge --abort"), NULL -- 2.10.0.1.g57b01a3
[PATCH 4/6] Documentation/git-merge.txt: improve short description in NAME
From: Sergey OrganovOld description not only raised the question of why the tool is called git-merge rather than git-join, but "join histories" also sounds like very simple operation, something like what "git-merge -s ours" does. Signed-off-by: Sergey Organov --- Documentation/git-merge.txt | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/Documentation/git-merge.txt b/Documentation/git-merge.txt index 216d2f4..cc0329d 100644 --- a/Documentation/git-merge.txt +++ b/Documentation/git-merge.txt @@ -3,7 +3,8 @@ git-merge(1) NAME -git-merge - Join two or more development histories together + +git-merge - Merge one or more branches to the current branch SYNOPSIS -- 2.10.0.1.g57b01a3
[PATCH 6/6] Documentation/git-merge.txt: get rid of irrelevant references to git-pull
From: Sergey OrganovNo awareness of git-pull is required to understand git-merge operation, so leave reference to git-pull only where it actually makes sense, in the description of fast-forward merges, and only as clarification of when this merging behaviour is mostly useful. Other references to git-pull are likely just a historical leftover that are now neither required nor clarify anything. Besides, git-pull may use rebase rather than merge, so it's also technically wrong to say, unconditionally, that git-pull uses git-merge. Overall, let git-pull description refer to git-merge where appropriate, and not vice versa. Signed-off-by: Sergey Organov --- Documentation/git-merge.txt | 36 1 file changed, 16 insertions(+), 20 deletions(-) diff --git a/Documentation/git-merge.txt b/Documentation/git-merge.txt index 351b8fc..ba5fb0a 100644 --- a/Documentation/git-merge.txt +++ b/Documentation/git-merge.txt @@ -23,10 +23,6 @@ named commits and the current branch, called "merge base", is calculated, and then net changes taken from the merge base to the named commits are applied. -This command is used by 'git pull' to incorporate changes from another -repository, and can be used by hand to merge changes from one branch -into another. - Assume the following history exists and the current branch is "`master`": @@ -119,18 +115,17 @@ of `git fetch` for merging are merged to the current branch. PRE-MERGE CHECKS -Before applying outside changes, you should get your own work in -good shape and committed locally, so it will not be clobbered if -there are conflicts. See also linkgit:git-stash[1]. -'git pull' and 'git merge' will stop without doing anything when -local uncommitted changes overlap with files that 'git pull'/'git -merge' may need to update. +Before applying outside changes, you should get your own work in good +shape and committed locally, so it will not be clobbered if there are +conflicts. See also linkgit:git-stash[1]. 'git merge' will stop +without doing anything when local uncommitted changes overlap with +files that 'git merge' may need to update. -To avoid recording unrelated changes in the merge commit, -'git pull' and 'git merge' will also abort if there are any changes -registered in the index relative to the `HEAD` commit. (One -exception is when the changed index entries are in the state that -would result from the merge already.) +To avoid recording unrelated changes in the merge commit, 'git merge' +will also abort if there are any changes registered in the index +relative to the `HEAD` commit. (One exception is when the changed +index entries are in the state that would result from the merge +already.) If all named commits are already ancestors of `HEAD`, 'git merge' will exit early with the message "Already up-to-date." @@ -138,14 +133,15 @@ will exit early with the message "Already up-to-date." FAST-FORWARD MERGE -- -Often the current branch head is an ancestor of the named commit. +Often the current branch head is an ancestor of the named commit. In +this case, a new commit is not needed to store the combined history; +instead, the `HEAD` (along with the index) is updated to point at the +named commit, without creating an extra merge commit. + This is the most common case especially when invoked from 'git pull': you are tracking an upstream repository, you have committed no local changes, and now you want to update to a newer upstream -revision. In this case, a new commit is not needed to store the -combined history; instead, the `HEAD` (along with the index) is -updated to point at the named commit, without creating an extra -merge commit. +revision. This behavior can be suppressed with the `--no-ff` option. -- 2.10.0.1.g57b01a3
[PATCH 5/6] Documentation/git-merge.txt: improve short description in DESCRIPTION
From: Sergey OrganovOld description had a few problems: - sounded as if commits have changes - stated that changes are taken since some "divergence point" that was not defined. New description rather uses "common ancestor" and "merge base", definitions of which are easily discoverable in the rest of GIT documentation. Signed-off-by: Sergey Organov --- Documentation/git-merge.txt | 25 +++-- 1 file changed, 15 insertions(+), 10 deletions(-) diff --git a/Documentation/git-merge.txt b/Documentation/git-merge.txt index cc0329d..351b8fc 100644 --- a/Documentation/git-merge.txt +++ b/Documentation/git-merge.txt @@ -16,11 +16,16 @@ SYNOPSIS DESCRIPTION --- -Incorporates changes from the named commits (since the time their -histories diverged from the current branch) into the current -branch. This command is used by 'git pull' to incorporate changes -from another repository and can be used by hand to merge changes -from one branch into another. + +Incorporates changes that lead to the named commits into the current +branch, and joins corresponding histories. The best common ancestor of +named commits and the current branch, called "merge base", is +calculated, and then net changes taken from the merge base to +the named commits are applied. + +This command is used by 'git pull' to incorporate changes from another +repository, and can be used by hand to merge changes from one branch +into another. Assume the following history exists and the current branch is "`master`": @@ -31,11 +36,11 @@ Assume the following history exists and the current branch is D---E---F---G master -Then "`git merge topic`" will replay the changes made on the -`topic` branch since it diverged from `master` (i.e., `E`) until -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. +Then "`git merge topic`" will replay the changes made on the `topic` +branch since it diverged from `master` (i.e., `E`) until its current +commit (`C`) on top of `master`, and record the result in a new commit +along with references to the two parent commits and a log message from +the user describing the changes. A---B---C topic -- 2.10.0.1.g57b01a3
[PATCH 3/6] Documentation/git-merge.txt: fix SYNOPSIS of obsolete form to include options
From: Sergey OrganovSigned-off-by: Sergey Organov --- Documentation/git-merge.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Documentation/git-merge.txt b/Documentation/git-merge.txt index 90342eb..216d2f4 100644 --- a/Documentation/git-merge.txt +++ b/Documentation/git-merge.txt @@ -10,7 +10,7 @@ SYNOPSIS [verse] 'git merge' [options] [-m ] [...] -'git merge' HEAD ... +'git merge' [options] HEAD ... 'git merge' --abort DESCRIPTION -- 2.10.0.1.g57b01a3
[PATCH] Documentation/git-merge.txt: improve SYNOPSIS
From: Sergey Organov sorga...@gmail.com Get rid of outdated explicit list of options. Reflect that the obsolete form: 'git merge' msg HEAD commit... could also have options. Signed-off-by: Sergey Organov sorga...@gmail.com --- Documentation/git-merge.txt | 6 ++ 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/Documentation/git-merge.txt b/Documentation/git-merge.txt index 1f94908..1de61a4 100644 --- a/Documentation/git-merge.txt +++ b/Documentation/git-merge.txt @@ -9,10 +9,8 @@ git-merge - Join two or more development histories together SYNOPSIS [verse] -'git merge' [-n] [--stat] [--no-commit] [--squash] [--[no-]edit] - [-s strategy] [-X strategy-option] [-S[key-id]] - [--[no-]rerere-autoupdate] [-m msg] [commit...] -'git merge' msg HEAD commit... +'git merge' [options] [-m msg] [commit...] +'git merge' [options] msg HEAD commit... 'git merge' --abort DESCRIPTION -- 1.9.3 -- To unsubscribe from this list: send the line unsubscribe git in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html