From: Junio C Hamano Date: Mon, 16 Apr 2012 19:42:22 +0000 (-0700) Subject: Merge branch 'jk/branch-quiet' X-Git-Tag: v1.7.11-rc0~149 X-Git-Url: https://git.lorimer.id.au/gitweb.git/diff_plain/b3ba46945d634d5c79dfa7a63b300a3007d1ca31?hp=-c Merge branch 'jk/branch-quiet' Even with "-q"uiet option, "checkout" used to report setting up tracking. Also "branch" learns "-q"uiet option to squelch informational message. By Jeff King * jk/branch-quiet: teach "git branch" a --quiet option checkout: suppress tracking message with "-q" --- b3ba46945d634d5c79dfa7a63b300a3007d1ca31 diff --combined Documentation/git-branch.txt index 6410c3d345,d74a30c1ce..e71370d6b4 --- a/Documentation/git-branch.txt +++ b/Documentation/git-branch.txt @@@ -24,8 -24,8 +24,8 @@@ be highlighted with an asterisk. Optio branches to be listed, and option `-a` shows both. This list mode is also activated by the `--list` option (see below). restricts the output to matching branches, the pattern is a shell -wildcard (i.e., matched using fnmatch(3)) -Multiple patterns may be given; if any of them matches, the tag is shown. +wildcard (i.e., matched using fnmatch(3)). +Multiple patterns may be given; if any of them matches, the branch is shown. With `--contains`, shows only the branches that contain the named commit (in other words, the branches whose tip commits are descendants of the @@@ -49,7 -49,7 +49,7 @@@ the remote-tracking branch. This behavi overridden by using the `--track` and `--no-track` options, and changed later using `git branch --set-upstream`. -With a '-m' or '-M' option, will be renamed to . +With a `-m` or `-M` option, will be renamed to . If had a corresponding reflog, it is renamed to match , and a reflog entry is created to remember the branch renaming. If exists, -M must be used to force the rename @@@ -59,7 -59,7 +59,7 @@@ With a `-d` or `-D` option, `:: Alter the sha1's minimum display length in the output listing. The default value is 7 and can be overridden by the `core.abbrev` @@@ -154,18 -159,17 +159,18 @@@ start-point is either a local or remote branch.autosetupmerge configuration variable is true. --set-upstream:: - If specified branch does not exist yet or if '--force' has been - given, acts exactly like '--track'. Otherwise sets up configuration - like '--track' would when creating the branch, except that where + If specified branch does not exist yet or if `--force` has been + given, acts exactly like `--track`. Otherwise sets up configuration + like `--track` would when creating the branch, except that where branch points to is not changed. --edit-description:: Open an editor and edit the text to explain what the branch is for, to be used by various other commands (e.g. `request-pull`). ---contains :: - Only list branches which contain the specified commit. +--contains []:: + Only list branches which contain the specified commit (HEAD + if not specified). --merged []:: Only list branches whose tips are reachable from the diff --combined builtin/checkout.c index 6b9061f26f,48f8b430f9..23fc56d88d --- a/builtin/checkout.c +++ b/builtin/checkout.c @@@ -514,6 -514,20 +514,6 @@@ static void report_tracking(struct bran strbuf_release(&sb); } -static void detach_advice(const char *old_path, const char *new_name) -{ - const char fmt[] = - "Note: checking out '%s'.\n\n" - "You are in 'detached HEAD' state. You can look around, make experimental\n" - "changes and commit them, and you can discard any commits you make in this\n" - "state without impacting any branches by performing another checkout.\n\n" - "If you want to create a new branch to retain commits you create, you may\n" - "do so (now or later) by using -b with the checkout command again. Example:\n\n" - " git checkout -b new_branch_name\n\n"; - - fprintf(stderr, fmt, new_name); -} - static void update_refs_for_switch(struct checkout_opts *opts, struct branch_info *old, struct branch_info *new) @@@ -543,6 -557,7 +543,7 @@@ opts->new_branch_force ? 1 : 0, opts->new_branch_log, opts->new_branch_force ? 1 : 0, + opts->quiet, opts->track); new->name = opts->new_branch; setup_branch_path(new); @@@ -561,7 -576,7 +562,7 @@@ REF_NODEREF, DIE_ON_ERR); if (!opts->quiet) { if (old->path && advice_detached_head) - detach_advice(old->path, new->name); + detach_advice(new->name); describe_detached_head(_("HEAD is now at"), new->commit); } } else if (new->path) { /* Switch branches. */