summaryrefslogtreecommitdiff
path: root/builtin
AgeCommit message (Collapse)AuthorFilesLines
2012-09-14Merge branch 'dj/fetch-all-tags'Libravatar Junio C Hamano1-0/+4
"git fetch --all", when passed "--no-tags", did not honor the "--no-tags" option while fetching from individual remotes (the same issue existed with "--tags", but combination "--all --tags" makes much less sense than "--all --no-tags"). * dj/fetch-all-tags: fetch --all: pass --tags/--no-tags through to each remote
2012-09-14Merge branch 'sn/ls-remote-get-url-doc'Libravatar Junio C Hamano1-1/+1
* sn/ls-remote-get-url-doc: ls-remote: document the '--get-url' option
2012-09-14Merge branch 'rj/path-cleanup'Libravatar Junio C Hamano4-5/+6
* rj/path-cleanup: Call mkpathdup() rather than xstrdup(mkpath(...)) Call git_pathdup() rather than xstrdup(git_path("...")) path.c: Use vsnpath() in the implementation of git_path() path.c: Don't discard the return value of vsnpath() path.c: Remove the 'git_' prefix from a file scope function
2012-09-12Merge branch 'nd/maint-remote-remove'Libravatar Junio C Hamano1-3/+3
* nd/maint-remote-remove: remote: prefer subcommand name 'remove' to 'rm'
2012-09-11Merge branch 'jk/argv-array'Libravatar Junio C Hamano1-22/+25
Use argv-array API in "git fetch" implementation. * jk/argv-array: submodule: use argv_array instead of hand-building arrays fetch: use argv_array instead of hand-building arrays argv-array: fix bogus cast when freeing array argv-array: add pop function
2012-09-11Merge branch 'jc/merge-bases'Libravatar Junio C Hamano4-10/+26
Optimise the "merge-base" computation a bit, and also update its users that do not need the full merge-base information to call a cheaper subset. * jc/merge-bases: reduce_heads(): reimplement on top of remove_redundant() merge-base: "--is-ancestor A B" get_merge_bases_many(): walk from many tips in parallel in_merge_bases(): use paint_down_to_common() merge_bases_many(): split out the logic to paint history in_merge_bases(): omit unnecessary redundant common ancestor reduction http-push: use in_merge_bases() for fast-forward check receive-pack: use in_merge_bases() for fast-forward check in_merge_bases(): support only one "other" commit
2012-09-11Merge branch 'nd/i18n-index-pack'Libravatar Junio C Hamano1-10/+11
* nd/i18n-index-pack: i18n: mark more index-pack strings for translation
2012-09-11Merge branch 'jc/maint-ident-missing-human-name'Libravatar Junio C Hamano1-1/+16
"git show --format='%ci'" did not give timestamp correctly for commits created without human readable name on "committer" line. * jc/maint-ident-missing-human-name: split_ident_line(): make best effort when parsing author/committer line
2012-09-10Merge branch 'cn/branch-set-upstream-to'Libravatar Junio C Hamano1-3/+57
"git branch --set-upstream origin/master" is a common mistake to create a local branch 'origin/master' and set it to integrate with the current branch. With a plan to deprecate this option, introduce "git branch (-u|--set-upstream-to) origin/master" that sets the current branch to integrate with 'origin/master' remote tracking branch. * cn/branch-set-upstream-to: branch: deprecate --set-upstream and show help if we detect possible mistaken use branch: add --unset-upstream option branch: introduce --set-upstream-to
2012-09-10Merge branch 'mz/cherry-pick-cmdline-order'Libravatar Junio C Hamano2-2/+2
"git cherry-pick A C B" used to replay changes in A and then B and then C if these three commits had committer timestamps in that order, which is not what the user who said "A C B" naturally expects. * mz/cherry-pick-cmdline-order: cherry-pick/revert: respect order of revisions to pick demonstrate broken 'git cherry-pick three one two' teach log --no-walk=unsorted, which avoids sorting
2012-09-10Merge branch 'jk/maint-quiet-is-synonym-to-s-in-log'Libravatar Junio C Hamano1-1/+1
We tried to bend backwards to allow "--quiet" to be a synonym as "-s" when given as e.g. "git show --quiet", but did not quite succeed. * jk/maint-quiet-is-synonym-to-s-in-log: log: fix --quiet synonym for -s
2012-09-07Merge branch 'nd/branch-v-alignment'Libravatar Junio C Hamano1-13/+15
Output from "git branch -v" contains "(no branch)" that could be localized, but the code to align it along with the names of branches were counting in bytes, not in display columns. * nd/branch-v-alignment: branch -v: align even when branch names are in UTF-8
2012-09-07Merge branch 'jc/apply-binary-p0'Libravatar Junio C Hamano1-25/+43
"git apply -p0" did not parse pathnames on "diff --git" line correctly. This caused patches that had pathnames in no other places to be mistakenly rejected (most notably, binary patch that does not rename nor change mode). Textual patches, renames or mode changes have preimage and postimage pathnames in different places in a form that can be parsed unambiguously and did not suffer from this problem. * jc/apply-binary-p0: apply: compute patch->def_name correctly under -p0
2012-09-07Merge branch 'jc/dotdot-is-parent-directory'Libravatar Junio C Hamano1-2/+14
"git log .." errored out saying it is both rev range and a path when there is no disambiguating "--" is on the command line. Update the command line parser to interpret ".." as a path in such a case. * jc/dotdot-is-parent-directory: specifying ranges: we did not mean to make ".." an empty set
2012-09-07Merge branch 'nd/i18n-parseopt-help'Libravatar Junio C Hamano61-892/+892
A lot of i18n mark-up for the help text from "git <cmd> -h". * nd/i18n-parseopt-help: (66 commits) Use imperative form in help usage to describe an action Reduce translations by using same terminologies i18n: write-tree: mark parseopt strings for translation i18n: verify-tag: mark parseopt strings for translation i18n: verify-pack: mark parseopt strings for translation i18n: update-server-info: mark parseopt strings for translation i18n: update-ref: mark parseopt strings for translation i18n: update-index: mark parseopt strings for translation i18n: tag: mark parseopt strings for translation i18n: symbolic-ref: mark parseopt strings for translation i18n: show-ref: mark parseopt strings for translation i18n: show-branch: mark parseopt strings for translation i18n: shortlog: mark parseopt strings for translation i18n: rm: mark parseopt strings for translation i18n: revert, cherry-pick: mark parseopt strings for translation i18n: rev-parse: mark parseopt strings for translation i18n: reset: mark parseopt strings for translation i18n: rerere: mark parseopt strings for translation i18n: status: mark parseopt strings for translation i18n: replace: mark parseopt strings for translation ...
2012-09-07Merge branch 'jk/config-warn-on-inaccessible-paths'Libravatar Junio C Hamano1-2/+2
When looking for $HOME/.gitconfig etc., it is OK if we cannot read them because they do not exist, but we did not diagnose existing files that we cannot read. * jk/config-warn-on-inaccessible-paths: warn_on_inaccessible(): a helper to warn on inaccessible paths attr: warn on inaccessible attribute files gitignore: report access errors of exclude files config: warn on inaccessible files
2012-09-07Merge branch 'kk/maint-for-each-ref-multi-sort'Libravatar Junio C Hamano1-1/+3
"git for-each-ref" did not currectly support more than one --sort option. * kk/maint-for-each-ref-multi-sort: for-each-ref: Fix sort with multiple keys t6300: test sort with multiple keys
2012-09-07Merge branch 'lt/commit-tree-guess-utf-8'Libravatar Junio C Hamano1-26/+2
Teach "git commit" and "git commit-tree" the "we are told to use utf-8 in log message, but this does not look like utf-8---attempt to pass it through convert-from-latin1-to-utf8 and see if it makes sense" heuristics "git mailinfo" already uses. * lt/commit-tree-guess-utf-8: commit/commit-tree: correct latin1 to utf-8
2012-09-07ls-remote: document the '--get-url' optionLibravatar Stefan Naewe1-1/+1
While looking for a way to expand the URL of a remote that uses a 'url.<name>.insteadOf' config option I stumbled over the undocumented '--get-url' option of 'git ls-remote'. This adds some minimum documentation for that option. And while at it, also add that option to the '-h' output. Signed-off-by: Stefan Naewe <stefan.naewe@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2012-09-07fetch --all: pass --tags/--no-tags through to each remoteLibravatar Dan Johnson1-0/+4
When fetch is invoked with --all, we need to pass the tag-following preference to each individual fetch; without this, we will always auto-follow tags, preventing us from fetching the remote tags into a remote-specific namespace, for example. Reported-by: Oswald Buddenhagen <ossi@kde.org> Signed-off-by: Dan Johnson <ComputerDruid@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2012-09-06remote: prefer subcommand name 'remove' to 'rm'Libravatar Nguyễn Thái Ngọc Duy1-3/+3
All remote subcommands are spelled out words except 'rm'. 'rm', being a popular UNIX command name, may mislead users that there are also 'ls' or 'mv'. Use 'remove' to fit with the rest of subcommands. 'rm' is still supported and used in the test suite. It's just not widely advertised. Signed-off-by: Nguyễn Thái Ngọc Duy <pclouds@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2012-09-04Call mkpathdup() rather than xstrdup(mkpath(...))Libravatar Ramsay Jones3-4/+4
In addition to updating the xstrdup(mkpath(...)) call sites with mkpathdup(), we also fix a memory leak (in merge_3way()) caused by neglecting to free the memory allocated to the 'base_name' variable. Signed-off-by: Ramsay Jones <ramsay@ramsay1.demon.co.uk> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2012-09-04Call git_pathdup() rather than xstrdup(git_path("..."))Libravatar Ramsay Jones1-1/+2
In addition to updating the two xstrdup(git_path("...")) call sites with git_pathdup(), we also fix a memory leak by freeing the memory allocated to the ADD_EDIT.patch 'file' in the edit_patch() function. Signed-off-by: Ramsay Jones <ramsay@ramsay1.demon.co.uk> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2012-09-03Merge branch 'cw/cherry-pick-allow-empty-message'Libravatar Junio C Hamano1-0/+2
"git cherry-pick" by default stops when it sees a commit without any log message. The "--allow-empty-message" option can be used to silently proceed. * cw/cherry-pick-allow-empty-message: cherry-pick: add --allow-empty-message option
2012-09-03Merge branch 'jc/maint-config-exit-status'Libravatar Junio C Hamano1-2/+6
The exit status code from "git config" was way overspecified while being incorrect. Update the implementation to give the documented status for a case that was documented, and introduce a new code for "all other errors". * jc/maint-config-exit-status: config: "git config baa" should exit with status 1
2012-09-02submodule: use argv_array instead of hand-building arraysLibravatar Jens Lehmann1-1/+1
fetch_populated_submodules() allocates the full argv array it uses to recurse into the submodules from the number of given options plus the six argv values it is going to add. It then initializes it with those values which won't change during the iteration and copies the given options into it. Inside the loop the two argv values different for each submodule get replaced with those currently valid. However, this technique is brittle and error-prone (as the comment to explain the magic number 6 indicates), so let's replace it with an argv_array. Instead of replacing the argv values, push them to the argv_array just before the run_command() call (including the option separating them) and pop them from the argv_array right after that. Signed-off-by: Jens Lehmann <Jens.Lehmann@web.de> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2012-09-02fetch: use argv_array instead of hand-building arraysLibravatar Jeff King1-22/+25
Fetch invokes itself recursively when recursing into submodules or handling "fetch --multiple". In both cases, it builds the child's command line by pushing options onto a statically-sized array. In both cases, the array is currently just big enough to handle the largest possible case. However, this technique is brittle and error-prone, so let's replace it with a dynamic argv_array. Signed-off-by: Jeff King <peff@peff.net> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2012-08-31split_ident_line(): make best effort when parsing author/committer lineLibravatar Junio C Hamano1-1/+16
Commits made by ancient version of Git allowed committer without human readable name, like this (00213b17c in the kernel history): tree 6947dba41f8b0e7fe7bccd41a4840d6de6a27079 parent 352dd1df32e672be4cff71132eb9c06a257872fe author Petr Baudis <pasky@ucw.cz> 1135223044 +0100 committer <sam@mars.ravnborg.org> 1136151043 +0100 kconfig: Remove support for lxdialog --checklist ... Signed-off-by: Petr Baudis <pasky@suse.cz> Signed-off-by: Sam Ravnborg <sam@ravnborg.org> When fed such a commit, --format='%ci' fails to parse it, and gives back an empty string. Update the split_ident_line() to be a bit more lenient when parsing, but make sure the caller that wants to pick up sane value from its return value does its own validation. Signed-off-by: Junio C Hamano <gitster@pobox.com>
2012-08-31i18n: mark more index-pack strings for translationLibravatar Nguyễn Thái Ngọc Duy1-10/+11
Signed-off-by: Nguyễn Thái Ngọc Duy <pclouds@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2012-08-31merge-base: "--is-ancestor A B"Libravatar Junio C Hamano1-0/+22
In many scripted Porcelain commands, we find this idiom: if test "$(git rev-parse --verify A)" = "$(git merge-base A B)" then ... A is an ancestor of B ... fi But you do not have to compute exact merge-base only to see if A is an ancestor of B. Give them a more direct way to use the underlying machinery. Signed-off-by: Junio C Hamano <gitster@pobox.com>
2012-08-30cherry-pick/revert: respect order of revisions to pickLibravatar Martin von Zweigbergk1-1/+1
When giving multiple individual revisions to cherry-pick or revert, as in 'git cherry-pick A B' or 'git revert B A', one would expect them to be picked/reverted in the order given on the command line. They are instead ordered by their commit timestamp -- in chronological order for "cherry-pick" and in reverse chronological order for "revert". This matches the order in which one would usually give them on the command line, making this bug somewhat hard to notice. Still, it has been reported at least once before [1]. It seems like the chronological sorting happened by accident because the revision walker has traditionally always sorted commits in reverse chronological order when rev_info.no_walk was enabled. In the case of 'git revert B A' where B is newer than A, this sorting is a no-op. For 'git cherry-pick A B', the sorting would reverse the arguments, but because the sequencer also flips the rev_info.reverse flag when picking (as opposed to reverting), the end result is a chronological order. The rev_info.reverse flag was probably flipped so that the revision walker emits B before C in 'git cherry-pick A..C'; that it happened to effectively undo the unexpected sorting done when not walking, was probably a coincidence that allowed this bug to happen at all. Fix the bug by telling the revision walker not to sort the commits when not walking. The only case we want to reverse the order is now when cherry-picking and walking revisions (rev_info.no_walk = 0). [1] http://thread.gmane.org/gmane.comp.version-control.git/164794 Signed-off-by: Martin von Zweigbergk <martinvonz@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2012-08-30teach log --no-walk=unsorted, which avoids sortingLibravatar Martin von Zweigbergk2-2/+2
When 'git log' is passed the --no-walk option, no revision walk takes place, naturally. Perhaps somewhat surprisingly, however, the provided revisions still get sorted by commit date. So e.g 'git log --no-walk HEAD HEAD~1' and 'git log --no-walk HEAD~1 HEAD' give the same result (unless the two revisions share the commit date, in which case they will retain the order given on the command line). As the commit that introduced --no-walk (8e64006 (Teach revision machinery about --no-walk, 2007-07-24)) points out, the sorting is intentional, to allow things like git log --abbrev-commit --pretty=oneline --decorate --all --no-walk to show all refs in order by commit date. But there are also other cases where the sorting is not wanted, such as <command producing revisions in order> | git log --oneline --no-walk --stdin To accomodate both cases, leave the decision of whether or not to sort up to the caller, by allowing --no-walk={sorted,unsorted}, defaulting to 'sorted' for backward-compatibility reasons. Signed-off-by: Martin von Zweigbergk <martinvonz@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2012-08-30branch: deprecate --set-upstream and show help if we detect possible ↵Libravatar Carlos Martín Nieto1-0/+26
mistaken use This interface is error prone, and a better one (--set-upstream-to) exists. Add a message listing the alternatives and suggest how to fix a --set-upstream invocation in case the user only gives one argument which causes a local branch with the same name as a remote-tracking one to be created. The typical case is git branch --set-upstream origin/master when the user meant git branch --set-upstream master origin/master assuming that the current branch is master. Show a message telling the user how to undo their action and get what they wanted. For the command above, the message would be The --set-upstream flag is deprecated and will be removed. Consider using --track or --set-upstream-to Branch origin/master set up to track local branch master. If you wanted to make 'master' track 'origin/master', do this: git branch -d origin/master git branch --set-upstream-to origin/master Signed-off-by: Carlos Martín Nieto <cmn@elego.de> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2012-08-30branch: add --unset-upstream optionLibravatar Carlos Martín Nieto1-3/+18
We have ways of setting the upstream information, but if we want to unset it, we need to resort to modifying the configuration manually. Teach branch an --unset-upstream option that unsets this information. Signed-off-by: Carlos Martín Nieto <cmn@elego.de> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2012-08-29Merge branch 'jc/capabilities'Libravatar Junio C Hamano3-5/+36
Some capabilities were asked by fetch-pack even when upload-pack did not advertise that they are available. Fix fetch-pack not to do so. * jc/capabilities: fetch-pack: mention server version with verbose output parse_feature_request: make it easier to see feature values fetch-pack: do not ask for unadvertised capabilities do not send client agent unless server does first send-pack: fix capability-sending logic include agent identifier in capability string
2012-08-29Merge branch 'bc/prune-info'Libravatar Junio C Hamano1-1/+2
Teach "git prune" without "-v" to be silent about leftover temporary files. * bc/prune-info: prune.c: only print informational message in show_only or verbose mode
2012-08-29Merge branch 'mz/cherry-code-cleanup'Libravatar Junio C Hamano1-16/+6
Minor code clean-up on the cherry-pick codepath. * mz/cherry-code-cleanup: cherry: remove redundant check for merge commit cherry: don't set ignored rev_info options remove unnecessary parameter from get_patch_ids()
2012-08-28log: fix --quiet synonym for -sLibravatar Jeff King1-1/+1
Originally the "--quiet" option was parsed by the diff-option parser into the internal QUICK option. This had the effect of silencing diff output from the log (which was not intended, but happened to work and people started to use it). But it also had other odd side effects at the diff level (for example, it would suppress the second commit in "git show A B"). To fix this, commit 1c40c36 converted log to parse-options and handled the "quiet" option separately, not passing it on to the diff code. However, it simply ignored the option, which was a regression for people using it as a synonym for "-s". Commit 01771a8 then fixed that by interpreting the option to add DIFF_FORMAT_NO_OUTPUT to the list of output formats. However, that commit did not fix it in all cases. It sets the flag after setup_revisions is called. Naively, this makes sense because you would expect the setup_revisions parser to overwrite our output format flag if "-p" or another output format flag is seen. However, that is not how the NO_OUTPUT flag works. We actually store it in the bit-field as just another format. At the end of setup_revisions, we call diff_setup_done, which post-processes the bitfield and clears any other formats if we have set NO_OUTPUT. By setting the flag after setup_revisions is done, diff_setup_done does not have a chance to make this tweak, and we end up with other format options still set. As a result, the flag would have no effect in "git log -p --quiet" or "git show --quiet". Fix it by setting the format flag before the call to setup_revisions. Signed-off-by: Jeff King <peff@peff.net> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2012-08-27receive-pack: use in_merge_bases() for fast-forward checkLibravatar Junio C Hamano1-7/+1
The original computed merge-base between the old commit and the new commit and checked if the old commit was a merge base between them, in order to make sure we are fast-forwarding. Instead, call in_merge_bases(old, new) which does the same. Signed-off-by: Junio C Hamano <gitster@pobox.com>
2012-08-27in_merge_bases(): support only one "other" commitLibravatar Junio C Hamano2-3/+3
In early days of its life, I planned to make it possible to compute "is a commit contained in all of these other commits?" with this function, but it turned out that no caller needed it. Just make it take two commit objects and add a comment to say what these two functions do. Signed-off-by: Junio C Hamano <gitster@pobox.com>
2012-08-27Merge branch 'js/grep-patterntype-config'Libravatar Junio C Hamano1-40/+72
"grep" learned to use a non-standard pattern type by default if a configuration variable tells it to. * js/grep-patterntype-config: grep: add a grep.patternType configuration setting
2012-08-27Merge branch 'bc/receive-pack-stdout-protection'Libravatar Junio C Hamano1-1/+2
When "git push" triggered the automatic gc on the receiving end, a message from "git prune" that said it was removing cruft leaked to the standard output, breaking the communication protocol. * bc/receive-pack-stdout-protection: receive-pack: do not leak output from auto-gc to standard output t/t5400: demonstrate breakage caused by informational message from prune
2012-08-27Merge branch 'jk/maint-null-in-trees'Libravatar Junio C Hamano3-7/+12
We do not want a link to 0{40} object stored anywhere in our objects. * jk/maint-null-in-trees: fsck: detect null sha1 in tree entries do not write null sha1s to on-disk index diff: do not use null sha1 as a sentinel value
2012-08-27Merge branch 'mm/push-default-switch-warning'Libravatar Junio C Hamano1-2/+27
In the next major release, we will switch "git push [$there]" that does not say what to push from the traditional "matching" to the updated "simple" semantics, that pushes the current branch to the branch with the same name only when the current branch is set to integrate with that remote branch (all other cases will error out). * mm/push-default-switch-warning: push: start warning upcoming default change for push.default
2012-08-27branch -v: align even when branch names are in UTF-8Libravatar Nguyễn Thái Ngọc Duy1-13/+15
Branch names are usually in ASCII so they are not the problem. The problem most likely comes from "(no branch)" translation, which is in UTF-8 and makes display-width calculation just wrong. Clarify this by renaming the field "len" in struct ref_item to "width", as it stores the display-width and is used to compute the width of the screen needed to show the names of all the branches, and compute the display width using utf8_strwidth(), not byte-length with strlen(). Update document to mention the fact that we may want ref names in UTF-8. Encodings that produce invalid UTF-8 are safe as utf8_strwidth() falls back to strlen(). The ones that incidentally produce valid UTF-8 sequences will cause misalignment. Signed-off-by: Nguyễn Thái Ngọc Duy <pclouds@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2012-08-24apply: compute patch->def_name correctly under -p0Libravatar Junio C Hamano1-25/+43
Back when "git apply" was written, we made sure that the user can skip more than the default number of path components (i.e. 1) by giving "-p<n>", but the logic for doing so was built around the notion of "we skip N slashes and stop". This obviously does not work well when running under -p0 where we do not want to skip any, but still want to skip SP/HT that separates the pathnames of preimage and postimage and want to reject absolute pathnames. Stop using "stop_at_slash()", and instead introduce a new helper "skip_tree_prefix()" with similar logic but works correctly even for the -p0 case. This is an ancient bug, but has been masked for a long time because most of the patches are text and have other clues to tell us the name of the preimage and the postimage. Noticed by Colin McCabe. Signed-off-by: Junio C Hamano <gitster@pobox.com>
2012-08-24Merge branch 'jk/maint-commit-check-committer-early' into maint-1.7.11Libravatar Junio C Hamano1-1/+1
* jk/maint-commit-check-committer-early: commit: check committer identity more strictly
2012-08-23specifying ranges: we did not mean to make ".." an empty setLibravatar Junio C Hamano1-2/+14
Either end of revision range operator can be omitted to default to HEAD, as in "origin.." (what did I do since I forked) or "..origin" (what did they do since I forked). But the current parser interprets ".." as an empty range "HEAD..HEAD", and worse yet, because ".." does exist on the filesystem, we get this annoying output: $ cd Documentation/howto $ git log .. ;# give me recent commits that touch Documentation/ area. fatal: ambiguous argument '..': both revision and filename Use '--' to separate filenames from revisions Surely we could say "git log ../" or even "git log -- .." to disambiguate, but we shouldn't have to. Helped-by: Jeff King <peff@peff.net> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2012-08-23branch: introduce --set-upstream-toLibravatar Carlos Martín Nieto1-2/+15
The existing --set-uptream option can cause confusion, as it uses the usual branch convention of assuming a starting point of HEAD if none is specified, causing git branch --set-upstream origin/master to create a new local branch 'origin/master' that tracks the current branch. As --set-upstream already exists, we can't simply change its behaviour. To work around this, introduce --set-upstream-to which accepts a compulsory argument indicating what the new upstream branch should be and one optinal argument indicating which branch to change, defaulting to HEAD. The new options allows us to type git branch --set-upstream-to origin/master to set the current branch's upstream to be origin's master. Signed-off-by: Carlos Martín Nieto <cmn@elego.de> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2012-08-22Use imperative form in help usage to describe an actionLibravatar Nguyễn Thái Ngọc Duy6-10/+10
Signed-off-by: Nguyễn Thái Ngọc Duy <pclouds@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>