More consistant terminology
v4 cover More consistant terminology
The last batch adressed all comments but two: one mis-rebase which ended up in patch hunks in the wrong commit, and separate patches changing remote to remote-tracking in the code, which are now merged.
Jonathan Nieder (1):
user-manual: remote-tracking can be checked out, with detached HEAD
Matthieu Moy (9):
Better "Changed but not updated" message in git-status Replace "remote tracking" with "remote-tracking"
Change remote tracking to remote-tracking in non-trivial places everyday.txt: change "tracking branch" to "remote-tracking branch" Change "tracking branch" to "remote-tracking branch" Change incorrect uses of "remote branch" meaning "remote-tracking" Change incorrect "remote branch" to "remote tracking branch" in C
code
user-manual.txt: explain better the remote(-tracking) branch terms git-branch.txt: mention --set-upstream as a way to change upstream
configuration
Documentation/config.txt | 13 +++++----- Documentation/everyday.txt | 6 ++-- Documentation/fetch-options.txt | 2 +- Documentation/git-branch.txt | 14 ++++++----- Documentation/git-checkout.txt | 2 +- Documentation/git-clone.txt | 2 +- Documentation/git-describe.txt | 2 +- Documentation/git-fetch.txt | 2 +- Documentation/git-gc.txt | 6 ++-- Documentation/git-log.txt | 2 +- Documentation/git-pull.txt | 8 +++--- Documentation/git-remote.txt | 6 ++-- Documentation/git-tag.txt | 4 +- Documentation/gittutorial-2.txt | 2 +- Documentation/gittutorial.txt | 6 ++-- Documentation/glossary-content.txt | 20 ++++++++-------- Documentation/rev-list-options.txt | 2 +- Documentation/user-manual.txt | 39 +++++++++++++++++++++++--------- branch.h | 4 +- builtin/checkout.c | 4 +- builtin/fetch.c | 6 ++-- builtin/fmt-merge-msg.c | 6 ++-- builtin/merge.c | 2 +- builtin/remote.c | 6 ++-- contrib/examples/builtin-fetch--tool.c | 2 +- remote.c | 2 +- t/t1507-rev-parse-upstream.sh | 2 +- t/t3409-rebase-preserve-merges.sh | 2 +- t/t5400-send-pack.sh | 2 +- t/t5505-remote.sh | 8 ++++-- t/t5513-fetch-track.sh | 2 +- t/t7508-status.sh | 34 ++++++++++++++-------------- t/t7608-merge-messages.sh | 4 +- wt-status.c | 2 +- 34 files changed, 124 insertions(+), 102 deletions(-)
Signature · 1 line
1.7.3.2.183.g2e7b0
PATCH v4 1/10 Better "Changed but not updated" message in git-status
Older Gits talked about "updating" a file to add its content to the index, but this terminology is confusing for new users. "to stage" is far more intuitive and already used in e.g. the "git stage" command name.
--- Documentation/gittutorial-2.txt | 2 +- t/t7508-status.sh | 34 +++++++++++++++++----------------- wt-status.c | 2 +- 3 files changed, 19 insertions(+), 19 deletions(-)
Documentation/gittutorial-2.txt +1 -1
@@ -373,7 +373,7 @@ $ git status # # new file: closing.txt # -# Changed but not updated: +# Changes not staged for commit: # (use "git add <file>..." to update what will be committed) # # modified: file.txt
t/t7508-status.sh +17 -17
@@ -44,7 +44,7 @@ cat >expect <<\EOF # # new file: dir2/added # -# Changed but not updated: +# Changes not staged for commit: # (use "git add <file>..." to update what will be committed) # (use "git checkout -- <file>..." to discard changes in working directory) #
@@ -73,7 +73,7 @@ cat >expect <<\EOF # Changes to be committed: # new file: dir2/added # -# Changed but not updated: +# Changes not staged for commit: # modified: dir1/modified # # Untracked files:
@@ -140,7 +140,7 @@ cat >expect <<EOF # # new file: dir2/added # -# Changed but not updated: +# Changes not staged for commit: # (use "git add <file>..." to update what will be committed) # (use "git checkout -- <file>..." to discard changes in working directory) #
@@ -167,7 +167,7 @@ cat >expect <<EOF # Changes to be committed: # new file: dir2/added # -# Changed but not updated: +# Changes not staged for commit: # modified: dir1/modified # # Untracked files not listed
@@ -202,7 +202,7 @@ cat >expect <<EOF # # new file: dir2/added # -# Changed but not updated: +# Changes not staged for commit: # (use "git add <file>..." to update what will be committed) # (use "git checkout -- <file>..." to discard changes in working directory) #
@@ -260,7 +260,7 @@ cat >expect <<EOF # # new file: dir2/added # -# Changed but not updated: +# Changes not staged for commit: # (use "git add <file>..." to update what will be committed) # (use "git checkout -- <file>..." to discard changes in working directory) #
@@ -320,7 +320,7 @@ cat >expect <<\EOF # # new file: ../dir2/added # -# Changed but not updated: +# Changes not staged for commit: # (use "git add <file>..." to update what will be committed) # (use "git checkout -- <file>..." to discard changes in working directory) #
@@ -392,7 +392,7 @@ cat >expect <<\EOF # # <GREEN>new file: dir2/added<RESET> # -# Changed but not updated: +# Changes not staged for commit: # (use "git add <file>..." to update what will be committed) # (use "git checkout -- <file>..." to discard changes in working directory) #
@@ -521,7 +521,7 @@ cat >expect <<\EOF # # new file: dir2/added # -# Changed but not updated: +# Changes not staged for commit: # (use "git add <file>..." to update what will be committed) # (use "git checkout -- <file>..." to discard changes in working directory) #
@@ -614,7 +614,7 @@ cat >expect <<EOF # new file: dir2/added # new file: sm # -# Changed but not updated: +# Changes not staged for commit: # (use "git add <file>..." to update what will be committed) # (use "git checkout -- <file>..." to discard changes in working directory) #
@@ -673,7 +673,7 @@ cat >expect <<EOF # new file: dir2/added # new file: sm # -# Changed but not updated: +# Changes not staged for commit: # (use "git add <file>..." to update what will be committed) # (use "git checkout -- <file>..." to discard changes in working directory) #
@@ -718,7 +718,7 @@ test_expect_success 'status -s submodule summary' ' cat >expect <<EOF # On branch master -# Changed but not updated: +# Changes not staged for commit: # (use "git add <file>..." to update what will be committed) # (use "git checkout -- <file>..." to discard changes in working directory) #
@@ -766,7 +766,7 @@ cat >expect <<EOF # new file: dir2/added # new file: sm # -# Changed but not updated: +# Changes not staged for commit: # (use "git add <file>..." to update what will be committed) # (use "git checkout -- <file>..." to discard changes in working directory) #
@@ -819,7 +819,7 @@ cat > expect << EOF # # modified: sm # -# Changed but not updated: +# Changes not staged for commit: # (use "git add <file>..." to update what will be committed) # (use "git checkout -- <file>..." to discard changes in working directory) #
@@ -931,7 +931,7 @@ cat > expect << EOF # # modified: sm # -# Changed but not updated: +# Changes not staged for commit: # (use "git add <file>..." to update what will be committed) # (use "git checkout -- <file>..." to discard changes in working directory) # (commit or discard the untracked or modified content in submodules)
@@ -989,7 +989,7 @@ cat > expect << EOF # # modified: sm # -# Changed but not updated: +# Changes not staged for commit: # (use "git add <file>..." to update what will be committed) # (use "git checkout -- <file>..." to discard changes in working directory) #
@@ -1067,7 +1067,7 @@ test_expect_success ".git/config ignore=dirty doesn't suppress submodule summary cat > expect << EOF # On branch master -# Changed but not updated: +# Changes not staged for commit: # (use "git add <file>..." to update what will be committed) # (use "git checkout -- <file>..." to discard changes in working directory) #
wt-status.c +1 -1
@@ -88,7 +88,7 @@ static void wt_status_print_dirty_header(struct wt_status *s, {const char *c =color (WT_STATUS_HEADER , s); -color_fprintf_ln (s->fp, c,"# Changed but not updated:" ); +color_fprintf_ln (s->fp, c,"# Changes not staged for commit:" );if (!advice_status_hints)return ;if (!has_deleted)
Signature · 1 line
1.7.3.2.183.g2e7b0
PATCH v4 2/10 Replace "remote tracking" with "remote-tracking"
In reply to Matthieu Moy"remote-tracking" branch makes it explicit that the branch is "tracking a remote", as opposed to "remote, and tracking something".
See discussion in e.g.
http://mid.gmane.org/[email protected]
for more details.
This patch is a straightforward application of
perl -pi -e 's/remote tracking branch/remote-tracking branch/'
except in the RelNotes directory.
--- Documentation/config.txt | 2 +- Documentation/fetch-options.txt | 2 +- Documentation/git-log.txt | 2 +- Documentation/git-pull.txt | 2 +- Documentation/git-remote.txt | 4 ++-- Documentation/gittutorial.txt | 2 +- Documentation/rev-list-options.txt | 2 +- Documentation/user-manual.txt | 2 +- builtin/checkout.c | 2 +- t/t5513-fetch-track.sh | 2 +- 10 files changed, 11 insertions(+), 11 deletions(-)
Documentation/config.txt +1 -1
@@ -708,7 +708,7 @@ color.diff.<slot>:: color.decorate.<slot>:: Use customized color for 'git log --decorate' output. `<slot>` is one of `branch`, `remoteBranch`, `tag`, `stash` or `HEAD` for local - branches, remote tracking branches, tags, stash and HEAD, respectively. + branches, remote-tracking branches, tags, stash and HEAD, respectively. color.grep:: When set to `always`, always highlight matches. When `false` (or
Documentation/fetch-options.txt +1 -1
@@ -36,7 +36,7 @@ ifndef::git-pull[] -p:: --prune:: - After fetching, remove any remote tracking branches which + After fetching, remove any remote-tracking branches which no longer exist on the remote. endif::git-pull[]
Documentation/git-log.txt +1 -1
@@ -116,7 +116,7 @@ git log --follow builtin-rev-list.c:: git log --branches --not --remotes=origin:: Shows all commits that are in any of local branches but not in - any of remote tracking branches for 'origin' (what you have that + any of remote-tracking branches for 'origin' (what you have that origin doesn't). git log master --not --remotes=*/master::
Documentation/git-pull.txt +1 -1
@@ -26,7 +26,7 @@ With `--rebase`, it runs 'git rebase' instead of 'git merge'. <repository> should be the name of a remote repository as passed to linkgit:git-fetch[1]. <refspec> can name an arbitrary remote ref (for example, the name of a tag) or even -a collection of refs with corresponding remote tracking branches +a collection of refs with corresponding remote-tracking branches (e.g., refs/heads/*:refs/remotes/origin/*), but usually it is the name of a branch in the remote repository.
Documentation/git-remote.txt +2 -2
@@ -75,7 +75,7 @@ was passed. 'rename':: -Rename the remote named <old> to <new>. All remote tracking branches and +Rename the remote named <old> to <new>. All remote-tracking branches and configuration settings for the remote are updated. + In case <old> and <new> are the same, and <old> is a file under
@@ -84,7 +84,7 @@ the configuration file format. 'rm':: -Remove the remote named <name>. All remote tracking branches and +Remove the remote named <name>. All remote-tracking branches and configuration settings for the remote are removed. 'set-head'::
Documentation/gittutorial.txt +1 -1
@@ -385,7 +385,7 @@ alice$ git fetch bob Unlike the longhand form, when Alice fetches from Bob using a remote repository shorthand set up with 'git remote', what was -fetched is stored in a remote tracking branch, in this case +fetched is stored in a remote-tracking branch, in this case `bob/master`. So after this: -------------------------------------
Documentation/rev-list-options.txt +1 -1
@@ -264,7 +264,7 @@ endif::git-rev-list[] Pretend as if all the refs in `refs/remotes` are listed on the command line as '<commit>'. If '<pattern>' is given, limit - remote tracking branches to ones matching given shell glob. + remote-tracking branches to ones matching given shell glob. If pattern lacks '?', '*', or '[', '/*' at the end is implied. --glob=<glob-pattern>::
Documentation/user-manual.txt +1 -1
@@ -1700,7 +1700,7 @@ may wish to check the original repository for updates and merge them into your own work. We have already seen <<Updating-a-repository-With-git-fetch,how to -keep remote tracking branches up to date>> with linkgit:git-fetch[1], +keep remote-tracking branches up to date>> with linkgit:git-fetch[1], and how to merge two branches. So you can merge in changes from the original repository's master branch with:
builtin/checkout.c +1 -1
@@ -786,7 +786,7 @@ int cmd_checkout(int argc, const char **argv, const char *prefix)* With no paths, if <something> is _not_ a commit, no -t nor -b * was given, and there is a tracking branch whose name is * <something> in one and only one remote, then this is a short-hand -* to fork local <something> from that remote tracking branch. +* to fork local <something> from that remote-tracking branch. * * Otherwise <something> shall not be ambiguous. * - If it's *only* a reference, treat it like case (1).
t/t5513-fetch-track.sh +1 -1
@@ -1,6 +1,6 @@ #!/bin/sh -test_description='fetch follows remote tracking branches correctly' +test_description='fetch follows remote-tracking branches correctly' . ./test-lib.sh
Signature · 1 line
1.7.3.2.183.g2e7b0
PATCH v4 3/10 Change remote tracking to remote-tracking in non-trivial places
In reply to Matthieu MoyTo complement the straightforward perl application in previous patch, this adds a few manual changes.
--- Documentation/git-gc.txt | 6 +++--- Documentation/gittutorial.txt | 4 ++-- t/t5400-send-pack.sh | 2 +- 3 files changed, 6 insertions(+), 6 deletions(-)
Documentation/git-gc.txt +3 -3
@@ -89,7 +89,7 @@ are not part of the current project most users will want to expire them sooner. This option defaults to '30 days'. The above two configuration variables can be given to a pattern. For -example, this sets non-default expiry values only to remote tracking +example, this sets non-default expiry values only to remote-tracking branches: ------------
@@ -128,8 +128,8 @@ Notes 'git gc' tries very hard to be safe about the garbage it collects. In particular, it will keep not only objects referenced by your current set -of branches and tags, but also objects referenced by the index, remote -tracking branches, refs saved by 'git filter-branch' in +of branches and tags, but also objects referenced by the index, +remote-tracking branches, refs saved by 'git filter-branch' in refs/original/, or reflogs (which may reference commits in branches that were later amended or rewound).
Documentation/gittutorial.txt +2 -2
@@ -402,8 +402,8 @@ could merge the changes into her master branch: alice$ git merge bob/master ------------------------------------- -This `merge` can also be done by 'pulling from her own remote -tracking branch', like this: +This `merge` can also be done by 'pulling from her own remote-tracking +branch', like this: ------------------------------------- alice$ git pull . remotes/bob/master
t/t5400-send-pack.sh +1 -1
@@ -129,7 +129,7 @@ test_expect_success 'denyNonFastforwards trumps --force' ' test "$victim_orig" = "$victim_head" ' -test_expect_success 'push --all excludes remote tracking hierarchy' ' +test_expect_success 'push --all excludes remote-tracking hierarchy' ' mkdir parent && ( cd parent &&
Signature · 1 line
1.7.3.2.183.g2e7b0
PATCH v4 4/10 everyday.txt: change "tracking branch" to "remote-tracking branch"
In reply to Matthieu Moy--- Documentation/everyday.txt | 6 +++--- 1 files changed, 3 insertions(+), 3 deletions(-)
Documentation/everyday.txt +3 -3
@@ -180,12 +180,12 @@ directory; clone from it to start a repository on the satellite machine. <2> clone sets these configuration variables by default. It arranges `git pull` to fetch and store the branches of mothership -machine to local `remotes/origin/*` tracking branches. +machine to local `remotes/origin/*` remote-tracking branches. <3> arrange `git push` to push local `master` branch to `remotes/satellite/master` branch of the mothership machine. <4> push will stash our work away on `remotes/satellite/master` -tracking branch on the mothership machine. You could use this as -a back-up method. +remote-tracking branch on the mothership machine. You could use this +as a back-up method. <5> on mothership machine, merge the work done on the satellite machine into the master branch.
Signature · 1 line
1.7.3.2.183.g2e7b0
PATCH v4 5/10 Change "tracking branch" to "remote-tracking branch"
In reply to Matthieu MoyOne more step towards consistancy. We change the documentation and the C code in a single patch, since the only instances in the C code are in comment and usage strings.
--- Documentation/config.txt | 4 ++-- Documentation/git-fetch.txt | 2 +- Documentation/git-pull.txt | 6 +++--- Documentation/git-remote.txt | 2 +- Documentation/git-tag.txt | 4 ++-- Documentation/glossary-content.txt | 20 ++++++++++---------- Documentation/user-manual.txt | 2 +- builtin/checkout.c | 2 +- builtin/fetch.c | 4 ++-- remote.c | 2 +- 10 files changed, 24 insertions(+), 24 deletions(-)
Documentation/config.txt +2 -2
@@ -680,7 +680,7 @@ color.branch:: color.branch.<slot>:: Use customized color for branch coloration. `<slot>` is one of `current` (the current branch), `local` (a local branch), - `remote` (a tracking branch in refs/remotes/), `plain` (other + `remote` (a remote-tracking branch in refs/remotes/), `plain` (other refs). + The value for these configuration variables is a list of colors (at most
@@ -1102,7 +1102,7 @@ gui.newbranchtemplate:: linkgit:git-gui[1]. gui.pruneduringfetch:: - "true" if linkgit:git-gui[1] should prune tracking branches when + "true" if linkgit:git-gui[1] should prune remote-tracking branches when performing a fetch. The default value is "false". gui.trustmtime::
Documentation/git-fetch.txt +1 -1
@@ -26,7 +26,7 @@ The ref names and their object names of fetched refs are stored in `.git/FETCH_HEAD`. This information is left for a later merge operation done by 'git merge'. -When <refspec> stores the fetched result in tracking branches, +When <refspec> stores the fetched result in remote-tracking branches, the tags that point at these branches are automatically followed. This is done by first fetching from the remote using the given <refspec>s, and if the repository has objects that are
Documentation/git-pull.txt +3 -3
@@ -134,7 +134,7 @@ and if there is not any such variable, the value on `URL: ` line in `$GIT_DIR/remotes/<origin>` file is used. In order to determine what remote branches to fetch (and -optionally store in the tracking branches) when the command is +optionally store in the remote-tracking branches) when the command is run without any refspec parameters on the command line, values of the configuration variable `remote.<origin>.fetch` are consulted, and if there aren't any, `$GIT_DIR/remotes/<origin>`
@@ -147,9 +147,9 @@ refs/heads/*:refs/remotes/origin/* ------------ A globbing refspec must have a non-empty RHS (i.e. must store -what were fetched in tracking branches), and its LHS and RHS +what were fetched in remote-tracking branches), and its LHS and RHS must end with `/*`. The above specifies that all remote -branches are tracked using tracking branches in +branches are tracked using remote-tracking branches in `refs/remotes/origin/` hierarchy under the same name. The rule to determine which remote branch to merge after
Documentation/git-remote.txt +1 -1
@@ -146,7 +146,7 @@ With `-n` option, the remote heads are not queried first with 'prune':: -Deletes all stale tracking branches under <name>. +Deletes all stale remote-tracking branches under <name>. These stale branches have already been removed from the remote repository referenced by <name>, but are still locally available in "remotes/<name>".
Documentation/git-tag.txt +2 -2
@@ -177,7 +177,7 @@ On Automatic following ~~~~~~~~~~~~~~~~~~~~~~ If you are following somebody else's tree, you are most likely -using tracking branches (`refs/heads/origin` in traditional +using remote-tracking branches (`refs/heads/origin` in traditional layout, or `refs/remotes/origin/master` in the separate-remote layout). You usually want the tags from the other end.
@@ -232,7 +232,7 @@ this case. It may well be that among networking people, they may want to exchange the tags internal to their group, but in that workflow they are most likely tracking with each other's progress by -having tracking branches. Again, the heuristic to automatically +having remote-tracking branches. Again, the heuristic to automatically follow such tags is a good thing.
Documentation/glossary-content.txt +10 -10
@@ -131,7 +131,7 @@ to point at the new commit. you have. In such these cases, you do not make a new <<def_merge,merge>> <<def_commit,commit>> but instead just update to his revision. This will happen frequently on a - <<def_tracking_branch,tracking branch>> of a remote + <<def_remote_tracking_branch,remote-tracking branch>> of a remote <<def_repository,repository>>. [[def_fetch]]fetch::
@@ -260,7 +260,7 @@ This commit is referred to as a "merge commit", or sometimes just a The default upstream <<def_repository,repository>>. Most projects have at least one upstream project which they track. By default 'origin' is used for that purpose. New upstream updates - will be fetched into remote <<def_tracking_branch,tracking branches>> named + will be fetched into remote <<def_remote_tracking_branch,remote-tracking branches>> named origin/name-of-upstream-branch, which you can see using `git branch -r`.
@@ -349,6 +349,14 @@ This commit is referred to as a "merge commit", or sometimes just a master branch head as to-upstream branch at $URL". See also linkgit:git-push[1]. +[[def_remote_tracking_branch]]remote-tracking branch:: + A regular git <<def_branch,branch>> that is used to follow changes from + another <<def_repository,repository>>. A tracking + branch should not contain direct modifications or have local commits + made to it. A remote-tracking branch can usually be + identified as the right-hand-side <<def_ref,ref>> in a Pull: + <<def_refspec,refspec>>. + [[def_repository]]repository:: A collection of <<def_ref,refs>> together with an <<def_object_database,object database>> containing all objects
@@ -418,14 +426,6 @@ This commit is referred to as a "merge commit", or sometimes just a that each contain very well defined concepts or small incremental yet related changes. -[[def_tracking_branch]]tracking branch:: - A regular git <<def_branch,branch>> that is used to follow changes from - another <<def_repository,repository>>. A tracking - branch should not contain direct modifications or have local commits - made to it. A tracking branch can usually be - identified as the right-hand-side <<def_ref,ref>> in a Pull: - <<def_refspec,refspec>>. - [[def_tree]]tree:: Either a <<def_working_tree,working tree>>, or a <<def_tree_object,tree object>> together with the dependent <<def_blob_object,blob>> and tree objects
Documentation/user-manual.txt +1 -1
@@ -435,7 +435,7 @@ linux-nfs/master origin/master ------------------------------------------------- -If you run "git fetch <remote>" later, the tracking branches for the +If you run "git fetch <remote>" later, the remote-tracking branches for the named <remote> will be updated. If you examine the file .git/config, you will see that git has added
builtin/checkout.c +1 -1
@@ -784,7 +784,7 @@ int cmd_checkout(int argc, const char **argv, const char *prefix)* between A and B, A...B names that merge base. * * With no paths, if <something> is _not_ a commit, no -t nor -b -* was given, and there is a tracking branch whose name is +* was given, and there is a remote-tracking branch whose name is * <something> in one and only one remote, then this is a short-hand * to fork local <something> from that remote-tracking branch. *
builtin/fetch.c +2 -2
@@ -52,7 +52,7 @@ static struct option builtin_fetch_options[] = {OPT_SET_INT ('n' ,NULL , &tags,"do not fetch all tags (--no-tags)" ,TAGS_UNSET ),OPT_BOOLEAN ('p' ,"prune" , &prune, -"prune tracking branches no longer on remote" ), +"prune remote-tracking branches no longer on remote" ),OPT_BOOLEAN (0 ,"dry-run" , &dry_run,"dry run" ), OPT_BOOLEAN('k', "keep", &keep, "keep downloaded pack"),
@@ -98,7 +98,7 @@ static void add_merge_config(struct ref **head,continue ;/* -* Not fetched to a tracking branch? We need to fetch +* Not fetched to a remote-tracking branch? We need to fetch * it anyway to allow this branch's "branch.$name.merge" * to be honored by 'git pull', but we do not have to * fail if branch.$name.merge is misconfigured to point
remote.c +1 -1
@@ -493,7 +493,7 @@ static void read_config(void) }/* -* We need to make sure the tracking branches are well formed, but a +* We need to make sure the remote-tracking branches are well formed, but a * wildcard refspec in "struct refspec" must have a trailing slash. We * temporarily drop the trailing '/' while calling check_ref_format(), * and put it back. The caller knows that a CHECK_REF_FORMAT_ONELEVEL
Signature · 1 line
1.7.3.2.183.g2e7b0
Re: [PATCH 05/10] Change "tracking branch" to "remote-tracking branch"
Quoted 8 lines · Matthieu Moy
+[[def_remote_tracking_branch]]remote-tracking branch::
+ A regular git <<def_branch,branch>> that is used to follow changes from
+ another <<def_repository,repository>>. A tracking
+ branch should not contain direct modifications or have local commits
+ made to it. A remote-tracking branch can usually be
+ identified as the right-hand-side <<def_ref,ref>> in a Pull:
+ <<def_refspec,refspec>>.
+
You missed a tracking branch -> remote-tracking branch substitution in the third/fourth line.
Santi
PATCH 1/1 Forgotten 'tracking' -> 'remote-tracking'
---
Quoted 2 lines
You missed a tracking branch -> remote-tracking branch substitution in the third/fourth line.
Oops, right. Junio, can you either add this or (better) squash this in my PATCH 5/10?
Thanks,
Documentation/glossary-content.txt | 2 +- 1 files changed, 1 insertions(+), 1 deletions(-)
Documentation/glossary-content.txt +1 -1
@@ -351,7 +351,7 @@ This commit is referred to as a "merge commit", or sometimes just a [[def_remote_tracking_branch]]remote-tracking branch:: A regular git <<def_branch,branch>> that is used to follow changes from - another <<def_repository,repository>>. A tracking + another <<def_repository,repository>>. A remote-tracking branch should not contain direct modifications or have local commits made to it. A remote-tracking branch can usually be identified as the right-hand-side <<def_ref,ref>> in a Pull:
Signature · 1 line
1.7.3.2.183.g2e7b0
PATCH v4 6/10 Change incorrect uses of "remote branch" meaning "remote-tracking"
In reply to Matthieu Moy"remote branch" is a branch hosted in a remote repository, while "remote-tracking branch" is a copy of such branch, hosted locally. The distinction is subtle when the copy is up-to-date, but rather fundamental to understand what "git fetch" and "git push" do.
This patch should fix all incorrect usages in Documentation/ directory.
--- Documentation/config.txt | 7 ++++--- Documentation/git-branch.txt | 11 ++++++----- Documentation/git-checkout.txt | 2 +- Documentation/git-clone.txt | 2 +- Documentation/git-describe.txt | 2 +- Documentation/user-manual.txt | 9 +++++---- 6 files changed, 18 insertions(+), 15 deletions(-)
Documentation/config.txt +4 -3
@@ -601,8 +601,9 @@ branch.autosetupmerge:: this behavior can be chosen per-branch using the `--track` and `--no-track` options. The valid settings are: `false` -- no automatic setup is done; `true` -- automatic setup is done when the - starting point is a remote branch; `always` -- automatic setup is - done when the starting point is either a local branch or remote + starting point is a remote-tracking branch; `always` -- + automatic setup is done when the starting point is either a + local branch or remote-tracking branch. This option defaults to true. branch.autosetuprebase::
@@ -613,7 +614,7 @@ branch.autosetuprebase:: When `local`, rebase is set to true for tracked branches of other local branches. When `remote`, rebase is set to true for tracked branches of - remote branches. + remote-tracking branches. When `always`, rebase will be set to true for all tracking branches. See "branch.autosetupmerge" for details on how to set up a
Documentation/git-branch.txt +6 -5
@@ -37,9 +37,9 @@ Note that this will create the new branch, but it will not switch the working tree to it; use "git checkout <newbranch>" to switch to the new branch. -When a local branch is started off a remote branch, git sets up the +When a local branch is started off a remote-tracking branch, git sets up the branch so that 'git pull' will appropriately merge from -the remote branch. This behavior may be changed via the global +the remote-tracking branch. This behavior may be changed via the global `branch.autosetupmerge` configuration flag. That setting can be overridden by using the `--track` and `--no-track` options.
@@ -89,7 +89,8 @@ OPTIONS Move/rename a branch even if the new branch name already exists. --color[=<when>]:: - Color branches to highlight current, local, and remote branches. + Color branches to highlight current, local, and + remote-tracking branches. The value must be always (the default), never, or auto. --no-color::
@@ -125,11 +126,11 @@ OPTIONS it directs `git pull` without arguments to pull from the upstream when the new branch is checked out. + -This behavior is the default when the start point is a remote branch. +This behavior is the default when the start point is a remote-tracking branch. Set the branch.autosetupmerge configuration variable to `false` if you want `git checkout` and `git branch` to always behave as if '--no-track' were given. Set it to `always` if you want this behavior when the -start-point is either a local or remote branch. +start-point is either a local or remote-tracking branch. --no-track:: Do not set up "upstream" configuration, even if the
Documentation/git-checkout.txt +1 -1
@@ -98,7 +98,7 @@ entries; instead, unmerged entries are ignored. "--track" in linkgit:git-branch[1] for details. + If no '-b' option is given, the name of the new branch will be -derived from the remote branch. If "remotes/" or "refs/remotes/" +derived from the remote-tracking branch. If "remotes/" or "refs/remotes/" is prefixed it is stripped away, and then the part up to the next slash (which would be the nickname of the remote) is removed. This would tell us to use "hack" as the local branch when branching
Documentation/git-clone.txt +1 -1
@@ -131,7 +131,7 @@ objects from the source repository into a pack in the cloned repository. Set up a mirror of the source repository. This implies `--bare`. Compared to `--bare`, `--mirror` not only maps local branches of the source to local branches of the target, it maps all refs (including - remote branches, notes etc.) and sets up a refspec configuration such + remote-tracking branches, notes etc.) and sets up a refspec configuration such that all these refs are overwritten by a `git remote update` in the target repository.
Documentation/git-describe.txt +1 -1
@@ -37,7 +37,7 @@ OPTIONS --all:: Instead of using only the annotated tags, use any ref found in `.git/refs/`. This option enables matching - any known branch, remote branch, or lightweight tag. + any known branch, remote-tracking branch, or lightweight tag. --tags:: Instead of using only the annotated tags, use any tag
Documentation/user-manual.txt +5 -4
@@ -1724,7 +1724,8 @@ accomplish the above with just a simple $ git pull ------------------------------------------------- -More generally, a branch that is created from a remote branch will pull +More generally, a branch that is created from a remote-tracking branch +will pull by default from that branch. See the descriptions of the branch.<name>.remote and branch.<name>.merge options in linkgit:git-config[1], and the discussion of the `--track` option in
@@ -2106,7 +2107,7 @@ $ git clone git://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux-2.6.git $ cd work ------------------------------------------------- -Linus's tree will be stored in the remote branch named origin/master, +Linus's tree will be stored in the remote-tracking branch named origin/master, and can be updated using linkgit:git-fetch[1]; you can track other public trees using linkgit:git-remote[1] to set up a "remote" and linkgit:git-fetch[1] to keep them up-to-date; see
@@ -2800,8 +2801,8 @@ Be aware that commits that the old version of example/master pointed at may be lost, as we saw in the previous section. [[remote-branch-configuration]] -Configuring remote branches ---------------------------- +Configuring remote-tracking branches +------------------------------------ We saw above that "origin" is just a shortcut to refer to the repository that you originally cloned from. This information is
Signature · 1 line
1.7.3.2.183.g2e7b0
PATCH v4 7/10 Change incorrect "remote branch" to "remote tracking branch" in C code
In reply to Matthieu Moy(Just like we did for documentation already)
In the process, we change "non-remote branch" to "branch outside the refs/remotes/ hierarchy" to avoid the ugly "non-remote-tracking branch". The new formulation actually corresponds to how the code detects this case (i.e. prefixcmp(refname, "refs/remotes")).
Also, we use 'remote-tracking branch' in generated merge messages (by merge an fmt-merge-msg).
--- branch.h | 4 ++-- builtin/fetch.c | 2 +- builtin/fmt-merge-msg.c | 6 +++--- builtin/merge.c | 2 +- builtin/remote.c | 6 +++--- contrib/examples/builtin-fetch--tool.c | 2 +- t/t1507-rev-parse-upstream.sh | 2 +- t/t3409-rebase-preserve-merges.sh | 2 +- t/t5505-remote.sh | 8 +++++--- t/t7608-merge-messages.sh | 4 ++-- 10 files changed, 20 insertions(+), 18 deletions(-)
branch.h +2 -2
@@ -22,8 +22,8 @@ void create_branch(const char *head, const char *name, const char *start_name,void remove_branch_state (void );/* -* Configure local branch "local" to merge remote branch "remote" -* taken from origin "origin". +* Configure local branch "local" as downstream to branch "remote" +* from remote "origin". Used by git branch --set-upstream. */ #define BRANCH_CONFIG_VERBOSE 01extern void install_branch_config (int flag,const char *local,const char *origin,const char *remote);
builtin/fetch.c +1 -1
@@ -359,7 +359,7 @@ static int store_updated_refs(const char *raw_url, const char *remote_name, what = rm->name +10 ; }else if (!prefixcmp (rm->name,"refs/remotes/" )) { - kind ="remote branch" ; + kind ="remote-tracking branch" ; what = rm->name +13 ; }else {
builtin/fmt-merge-msg.c +3 -3
@@ -100,8 +100,8 @@ static int handle_line(char *line) origin = line;string_list_append (&src_data->tag, origin +4 ); src_data->head_status |=2 ; - }else if (!prefixcmp (line,"remote branch " )) { - origin = line +14 ; + }else if (!prefixcmp (line,"remote-tracking branch " )) { + origin = line +strlen ("remote-tracking branch " );string_list_append (&src_data->r_branch, origin); src_data->head_status |=2 ; }else {
@@ -233,7 +233,7 @@ static void do_fmt_merge_msg_title(struct strbuf *out,if (src_data->r_branch.nr) {strbuf_addstr (out, subsep); subsep =", " ; -print_joined ("remote branch " ,"remote branches " , +print_joined ("remote-tracking branch " ,"remote-tracking branches " , &src_data->r_branch, out); }if (src_data->tag.nr) {
builtin/merge.c +1 -1
@@ -403,7 +403,7 @@ static void merge_name(const char *remote, struct strbuf *msg) goto cleanup; }if (!prefixcmp (found_ref,"refs/remotes/" )) { -strbuf_addf (msg,"%s\t\tremote branch '%s' of .\n" , +strbuf_addf (msg,"%s\t\tremote-tracking branch '%s' of .\n" ,sha1_to_hex (branch_head), remote); goto cleanup; }
builtin/remote.c +3 -3
@@ -507,7 +507,7 @@ static int add_branch_for_removal(const char *refname,return 0 ; } -/* don't delete non-remote refs */ +/* don't delete non-remote-tracking refs */ if (prefixcmp (refname,"refs/remotes" )) {/* advise user how to delete local branches */ if (!prefixcmp (refname,"refs/heads/" ))
@@ -791,9 +791,9 @@ static int rm(int argc, const char **argv)if (skipped.nr) {fprintf (stderr, skipped.nr ==1 ? -"Note: A non-remote branch was not removed; " +"Note: A branch outside the refs/remotes/ hierarchy was not removed;\n" "to delete it, use:\n" : -"Note: Non-remote branches were not removed; " +"Note: Some branches outside the refs/remotes/ hierarchy were not removed;\n" "to delete them, use:\n" );for (i =0 ; i < skipped.nr; i++) fprintf(stderr, " git branch -d %s\n",
contrib/examples/builtin-fetch--tool.c +1 -1
@@ -148,7 +148,7 @@ static int append_fetch_head(FILE *fp, what = remote_name +10 ; }else if (!strncmp (remote_name,"refs/remotes/" ,13 )) { - kind ="remote branch" ; + kind ="remote-tracking branch" ; what = remote_name +13 ; }else {
t/t1507-rev-parse-upstream.sh +1 -1
@@ -85,7 +85,7 @@ test_expect_success 'merge my-side@{u} records the correct name' ' git branch -t new my-side@{u} && git merge -s ours new@{u} && git show -s --pretty=format:%s >actual && - echo "Merge remote branch ${sq}origin/side${sq}" >expect && + echo "Merge remote-tracking branch ${sq}origin/side${sq}" >expect && test_cmp expect actual ) '
t/t3409-rebase-preserve-merges.sh +1 -1
@@ -72,7 +72,7 @@ test_expect_success 'rebase -p fakes interactive rebase' ' git fetch && git rebase -p origin/topic && test 1 = $(git rev-list --all --pretty=oneline | grep "Modify A" | wc -l) && - test 1 = $(git rev-list --all --pretty=oneline | grep "Merge remote branch " | wc -l) + test 1 = $(git rev-list --all --pretty=oneline | grep "Merge remote-tracking branch " | wc -l) ) '
t/t5505-remote.sh +5 -3
@@ -107,16 +107,18 @@ test_expect_success 'remove remote' ' ) ' -test_expect_success 'remove remote protects non-remote branches' ' +test_expect_success 'remove remote protects local branches' ' ( cd test && { cat >expect1 <<EOF -Note: A non-remote branch was not removed; to delete it, use: +Note: A branch outside the refs/remotes/ hierarchy was not removed; +to delete it, use: git branch -d master EOF } && { cat >expect2 <<EOF -Note: Non-remote branches were not removed; to delete them, use: +Note: Some branches outside the refs/remotes/ hierarchy were not removed; +to delete them, use: git branch -d foobranch git branch -d master EOF
t/t7608-merge-messages.sh +2 -2
@@ -47,14 +47,14 @@ test_expect_success 'ambiguous tag' ' check_oneline "Merge commit QambiguousQ" ' -test_expect_success 'remote branch' ' +test_expect_success 'remote-tracking branch' ' git checkout -b remote master && test_commit remote-1 && git update-ref refs/remotes/origin/master remote && git checkout master && test_commit master-5 && git merge origin/master && - check_oneline "Merge remote branch Qorigin/masterQ" + check_oneline "Merge remote-tracking branch Qorigin/masterQ" ' test_done
Signature · 1 line
1.7.3.2.183.g2e7b0
What's the -s switch in git show?
I know this should be obvious but I can't find *any* reference to this in git show --help
PATCH 1/1 Documentation: document show -s
Git's diff machinery has supported a -s (silence diff output) option as far back as v0.99~900 (Silent flag for show-diff, 2005-04-13), but the option is only advertised in an odd corner of the git diff-tree manual.
The main use is to retrieve basic metadata about a commit:
git show -s rev
Explain this in the 'git log' manual and provide an example in the 'git show' examples section. This is kind of a cop-out, since it would be more useful to explain it in the 'git show' manual proper, which says:
The command takes options applicable to the git diff-tree command to control how the changes the commit introduces are shown.
This manual page describes only the most frequently used options.
Fixing that is a larger task for another day.
---
Quoted 2 lines · Will Hall
I know this should be obvious but I can't find *any* reference to this in git show --help
Thanks, good catch.
Documentation/git-show.txt | 4 ++++ Documentation/rev-list-options.txt | 3 +++ 2 files changed, 7 insertions(+), 0 deletions(-)
Documentation/git-show.txt +4 -0
@@ -54,6 +54,10 @@ git show v1.0.0:: git show v1.0.0^\{tree\}:: Shows the tree pointed to by the tag `v1.0.0`. +git show -s --format=%s v1.0.0^\{commit\}:: + Shows the subject of the commit pointed to by the + tag `v1.0.0`. + git show next~10:Documentation/README:: Shows the contents of the file `Documentation/README` as they were current in the 10th last commit of the branch
Documentation/rev-list-options.txt +3 -0
@@ -146,6 +146,9 @@ options may be given. See linkgit:git-diff-files[1] for more options. -t:: Show the tree objects in the diff output. This implies '-r'. + +-s:: + Suppress diff output. endif::git-rev-list[] Commit Limiting
Signature · 1 line
1.7.2.3.557.gab647.dirty
PATCH v4 8/10 user-manual.txt: explain better the remote(-tracking) branch terms
In reply to Matthieu MoyNow that the documentation is mostly consistant in the use of "remote branch" Vs "remote-tracking branch", let's make this distinction explicit early in the user-manual.
--- Documentation/user-manual.txt | 19 ++++++++++++++++--- 1 files changed, 16 insertions(+), 3 deletions(-)
Documentation/user-manual.txt +16 -3
@@ -344,7 +344,8 @@ Examining branches from a remote repository The "master" branch that was created at the time you cloned is a copy of the HEAD in the repository that you cloned from. That repository may also have had other branches, though, and your local repository -keeps branches which track each of those remote branches, which you +keeps branches which track each of those remote branches, called +remote-tracking branches, which you can view using the "-r" option to linkgit:git-branch[1]: ------------------------------------------------
@@ -359,6 +360,13 @@ $ git branch -r origin/todo ------------------------------------------------ +In this example, "origin" is called a remote repository, or "remote" +for short. The branches of this repository are called "remote +branches" from our point of view. The remote-tracking branches listed +above were created based on the remote branches at clone time and will +be updated by "git fetch" (hence "git pull) and "git push". See +<<Updating -a-repository-With-git-fetch>> for details. + You cannot check out these remote-tracking branches, but you can examine them on a branch of your own, just as you would a tag:
@@ -1716,14 +1724,19 @@ one step: $ git pull origin master ------------------------------------------------- -In fact, if you have "master" checked out, then by default "git pull" -merges from the HEAD branch of the origin repository. So often you can +In fact, if you have "master" checked out, then this branch has been +configured by "git clone" to get changes from the HEAD branch of the +origin repository. So often you can accomplish the above with just a simple ------------------------------------------------- $ git pull ------------------------------------------------- +This command will fetch changes from the remote branches to your +remote-tracking branches `origin/*`, and merge the default branch into +the current branch. + More generally, a branch that is created from a remote-tracking branch will pull by default from that branch. See the descriptions of the
Signature · 1 line
1.7.3.2.183.g2e7b0
Re: [PATCH 08/10] user-manual.txt: explain better the remote(-tracking) branch terms
Matthieu Moy:
Documentation/user-manual.txt $ git branch -r · line 367
Quoted 5 lines
Documentation/user-manual.txt +5
-0+In this example, "origin" is called a remote repository, or "remote" +for short. The branches of this repository are called "remote +branches" from our point of view. The remote-tracking branches listed +above were created based on the remote branches at clone time and will +be updated by "git fetch" (hence "git pull) and "git push". See
Missing a double quote after '"git pull' above.
Signature · 1 line
\\// Peter - http://www.softwolves.pp.se/
PATCH 1/1 user-manual.txt: explain better the remote(-tracking) branch terms
Now that the documentation is mostly consistant in the use of "remote branch" Vs "remote-tracking branch", let's make this distinction explicit early in the user-manual.
---
Quoted 1 line
Missing a double quote after '"git pull' above.
Oops, right. And there was a spurious space on the line right below, breaking a hyper-link.
So, Junio, can you replace the previous patch with this one?
(Or let me know if you prefer me to resend the serie)
Documentation/user-manual.txt | 19 ++++++++++++++++--- 1 files changed, 16 insertions(+), 3 deletions(-)
Documentation/user-manual.txt +16 -3
@@ -344,7 +344,8 @@ Examining branches from a remote repository The "master" branch that was created at the time you cloned is a copy of the HEAD in the repository that you cloned from. That repository may also have had other branches, though, and your local repository -keeps branches which track each of those remote branches, which you +keeps branches which track each of those remote branches, called +remote-tracking branches, which you can view using the "-r" option to linkgit:git-branch[1]: ------------------------------------------------
@@ -359,6 +360,13 @@ $ git branch -r origin/todo ------------------------------------------------ +In this example, "origin" is called a remote repository, or "remote" +for short. The branches of this repository are called "remote +branches" from our point of view. The remote-tracking branches listed +above were created based on the remote branches at clone time and will +be updated by "git fetch" (hence "git pull") and "git push". See +<<Updating-a-repository-With-git-fetch>> for details. + You cannot check out these remote-tracking branches, but you can examine them on a branch of your own, just as you would a tag:
@@ -1716,14 +1724,19 @@ one step: $ git pull origin master ------------------------------------------------- -In fact, if you have "master" checked out, then by default "git pull" -merges from the HEAD branch of the origin repository. So often you can +In fact, if you have "master" checked out, then this branch has been +configured by "git clone" to get changes from the HEAD branch of the +origin repository. So often you can accomplish the above with just a simple ------------------------------------------------- $ git pull ------------------------------------------------- +This command will fetch changes from the remote branches to your +remote-tracking branches `origin/*`, and merge the default branch into +the current branch. + More generally, a branch that is created from a remote-tracking branch will pull by default from that branch. See the descriptions of the
Signature · 1 line
1.7.3.2.183.g2e7b0
PATCH v4 9/10 user-manual: remote-tracking can be checked out, with detached HEAD
In reply to Matthieu MoyFrom: Jonathan Nieder <[email protected]>
--- Documentation/user-manual.txt | 7 +++++-- 1 files changed, 5 insertions(+), 2 deletions(-)
Documentation/user-manual.txt +5 -2
@@ -367,13 +367,16 @@ above were created based on the remote branches at clone time and will be updated by "git fetch" (hence "git pull) and "git push". See <<Updating -a-repository-With-git-fetch>> for details. -You cannot check out these remote-tracking branches, but you can -examine them on a branch of your own, just as you would a tag: +You might want to build on one of these remote-tracking branches +on a branch of your own, just as you would for a tag: ------------------------------------------------ $ git checkout -b my-todo-copy origin/todo ------------------------------------------------ +You can also check out "origin/todo" directly to examine it or +write a one-off patch. See <<detached-head,detached head>>. + Note that the name "origin" is just the name that git uses by default to refer to the repository that you cloned from.
Signature · 1 line
1.7.3.2.183.g2e7b0
PATCH v4 10/10 git-branch.txt: mention --set-upstream as a way to change upstream configuration
In reply to Matthieu Moy--- Documentation/git-branch.txt | 3 ++- 1 files changed, 2 insertions(+), 1 deletions(-)
Documentation/git-branch.txt +2 -1
@@ -41,7 +41,8 @@ When a local branch is started off a remote-tracking branch, git sets up the branch so that 'git pull' will appropriately merge from the remote-tracking branch. This behavior may be changed via the global `branch.autosetupmerge` configuration flag. That setting can be -overridden by using the `--track` and `--no-track` options. +overridden by using the `--track` and `--no-track` options, and +changed later using `git branch --set-upstream`. With a '-m' or '-M' option, <oldbranch> will be renamed to <newbranch>. If <oldbranch> had a corresponding reflog, it is renamed to match
Signature · 1 line
1.7.3.2.183.g2e7b0