summaryrefslogtreecommitdiff
Commit message (Collapse)AuthorAgeFilesLines
* t0012: test "-h" with builtinsjk/consistent-hJeff King2017-06-051-0/+12
| | | | | | | | | | | | | | | | | | Since commit 99caeed05 (Let 'git <command> -h' show usage without a git dir, 2009-11-09), the git wrapper handles "-h" specially, skipping any repository setup but still calling the builtin's cmd_foo() function. This means that every cmd_foo() must be ready to handle this case, but we don't have any systematic tests. This led to "git am -h" being broken for some time without anybody noticing. This patch just tests that "git foo -h" works for every builtin, where we see a 129 exit code (the normal code for our usage() helper), and that the word "usage" appears in the output. Signed-off-by: Jeff King <peff@peff.net> Signed-off-by: Junio C Hamano <gitster@pobox.com>
* git: add hidden --list-builtins optionJeff King2017-06-051-0/+12
| | | | | | | | | | | | It can be useful in the test suite to be able to iterate over the list of builtins. We could do this with some Makefile magic. But since the authoritative list is in the commands array inside git.c, and since this could also be handy for debugging, let's add a hidden command-line option to dump that list. Signed-off-by: Jeff King <peff@peff.net> Signed-off-by: Junio C Hamano <gitster@pobox.com>
* version: convert to parse-optionsJeff King2017-06-051-5/+20
| | | | | | | | | | | | | | The "git version" command didn't traditionally accept any options, and in fact ignores any you give it. When we added simple option parsing for "--build-options" in 6b9c38e14, we didn't improve this; we just loop over the arguments and pick out the one we recognize. Instead, let's move to a real parsing loop, complain about nonsense options, and recognize conventions like "-h". Signed-off-by: Jeff King <peff@peff.net> Signed-off-by: Junio C Hamano <gitster@pobox.com>
* diff- and log- family: handle "git cmd -h" earlyJunio C Hamano2017-06-054-0/+12
| | | | | | | | | | | | | | | | | "git $builtin -h" bypasses the usual repository setup and calls the cmd_$builtin() function, expecting it to show the help text. Unfortunately the commands in the log- and the diff- family want to call into the revisions machinery, which by definition needs to have a repository already discovered. Strictly speaking, they may not need a repository only for parsing "-h", but it is a good discipline to future-proof codepath to ensure that setup_revisions() is called after we know that a repository is there. Handle the "git $builtin -h" special case very early in these commands to work around potential issues. Signed-off-by: Junio C Hamano <gitster@pobox.com>
* submodule--helper: show usage for "-h"Jeff King2017-05-301-3/+2
| | | | | | | | | Normal users shouldn't ever call submodule--helper, but it doesn't hurt to give them a normal usage message if they try "-h". Signed-off-by: Jeff King <peff@peff.net> Signed-off-by: Junio C Hamano <gitster@pobox.com>
* remote-{ext,fd}: print usage message on invalid argumentsJeff King2017-05-302-2/+8
| | | | | | | | | | We just say "Expected two arguments" when we get a different number of arguments, but we can be slightly friendlier. People shouldn't generally be running remote helpers themselves, but curious users might say "git remote-ext -h". Signed-off-by: Jeff King <peff@peff.net> Signed-off-by: Junio C Hamano <gitster@pobox.com>
* upload-archive: handle "-h" option earlyJeff King2017-05-301-1/+4
| | | | | | | | | | | | | | | | | | | | | Normally upload-archive forks off upload-archive--writer to do the real work, and relays any errors back over the sideband channel. This is a good thing when the command is properly invoked remotely via ssh or git-daemon. But it's confusing to curious users who try "git upload-archive -h". Let's catch this invocation early and give a real usage message, rather than spewing "-h does not appear to be a git repository" amidst packet-lines. The chance of a false positive due to a real client asking for the repo "-h" is quite small. Likewise, we'll catch "-h" in upload-archive--writer. People shouldn't be invoking it manually, but it doesn't hurt to give a sane message if they do. Signed-off-by: Jeff King <peff@peff.net> Signed-off-by: Junio C Hamano <gitster@pobox.com>
* credential: handle invalid arguments earlierJeff King2017-05-301-2/+2
| | | | | | | | | | | | | | | | | | | | | The git-credential command only takes one argument: the operation to perform. If we don't have one, we complain immediately. But if we have one that we don't recognize, we don't notice until after we've read the credential from stdin. This is likely to confuse a user invoking "git credential -h", as the program will hang waiting for their input before showing anything. Let's detect this case early. Likewise, we never noticed when there are extra arguments beyond the one we're expecting. Let's catch this with the same conditional. Note that we don't need to handle "--help" similarly, because the git wrapper does this before even calling cmd_credential(). Signed-off-by: Jeff King <peff@peff.net> Signed-off-by: Junio C Hamano <gitster@pobox.com>
* am: handle "-h" argument earlierjk/unbreak-am-hJeff King2017-05-301-0/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | If the user provides "-h" on the command line, then our parse_options() invocation will show a usage message and quit. But if "-h" is the only argument, the git wrapper behaves specially: it ignores our RUN_SETUP flag and calls cmd_am() without having done repository setup at all. This is due to 99caeed05 (Let 'git <command> -h' show usage without a git dir, 2009-11-09). Before cmd_am() calls parse_options(), though, it runs a few other setup functions. One of these is am_state_init(), which uses git_pathdup() to set up the default rebase-apply path. But calling git_pathdup() when we haven't done repository setup will fall back to using ".git". That's mostly harmless (since we won't use the value anyway), but is forbidden since b1ef400eec ("setup_git_env: avoid blind fall-back to ".git"", 2016-10-20), and we now BUG(). We can't easily move that setup to after the parse_options() call; the point is to set up defaults that are overwritten by the option parsing. Instead, we'll detect the "-h" case early and show the usage then. This matches the behavior of other builtins which have a similar setup-ordering issue (e.g., git-branch). Signed-off-by: Jeff King <peff@peff.net> Signed-off-by: Junio C Hamano <gitster@pobox.com>
* Git 2.13v2.13.0Junio C Hamano2017-05-093-1/+14
| | | | Signed-off-by: Junio C Hamano <gitster@pobox.com>
* Merge tag 'l10n-2.13.0-rnd2.1' of git://github.com/git-l10n/git-poJunio C Hamano2017-05-099-19174/+23732
|\ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | l10n for Git 2.13.0 round 2.1 * tag 'l10n-2.13.0-rnd2.1' of git://github.com/git-l10n/git-po: l10n: zh_CN: for git v2.13.0 l10n round 2 l10n: sv.po: Update Swedish translation (3195t0f0u) l10n: zh_CN: review for git v2.13.0 l10n round 1 l10n: Update Catalan translation l10n: bg.po: Updated Bulgarian translation (3195t) l10n: fr.po v2.13 rnd 2 l10n: de.po: translate 4 new messages l10n: de.po: update German translation l10n: de.po: lower case after semi-colon l10n: vi.po(3195t): Update translation for v2.13.0 round 2 l10n: git.pot: v2.13.0 round 2 (4 new, 7 removed) l10n: zh_CN: for git v2.13.0 l10n round 1 l10n: fr.po v2.13 round 1 l10n: pt_PT: update Portuguese translation l10n: bg.po: Updated Bulgarian translation (3201t) l10n: vi.po(3198t): Updated Vietnamese translation for v2.13.0-rc0 l10n: sv.po: Update Swedish translation (3199t0f0u) l10n: git.pot: v2.13.0 round 1 (96 new, 37 removed)
| * Merge branch 'master' of git://github.com/nafmo/git-l10n-svJiang Xin2017-05-091-434/+439
| |\ | | | | | | | | | | | | * 'master' of git://github.com/nafmo/git-l10n-sv: l10n: sv.po: Update Swedish translation (3195t0f0u)
| | * l10n: sv.po: Update Swedish translation (3195t0f0u)Peter Krefting2017-05-091-434/+439
| | | | | | | | | | | | Signed-off-by: Peter Krefting <peter@softwolves.pp.se>
| * | l10n: zh_CN: for git v2.13.0 l10n round 2Jiang Xin2017-05-091-429/+436
| |/ | | | | | | | | | | Translate 4 messages (3195t0f0u) for git v2.13.0-rc2. Signed-off-by: Jiang Xin <worldhello.net@gmail.com>
| * l10n: zh_CN: review for git v2.13.0 l10n round 1Ray Chen2017-05-091-17/+17
| | | | | | | | Signed-off-by: Ray Chen <oldsharp@gmail.com>
| * Merge branch 'master' of https://github.com/vnwildman/gitJiang Xin2017-05-091-431/+438
| |\ | | | | | | | | | | | | * 'master' of https://github.com/vnwildman/git: l10n: vi.po(3195t): Update translation for v2.13.0 round 2
| | * l10n: vi.po(3195t): Update translation for v2.13.0 round 2Tran Ngoc Quan2017-05-051-431/+438
| | | | | | | | | | | | Signed-off-by: Tran Ngoc Quan <vnwildman@gmail.com>
| * | l10n: Update Catalan translationJordi Mas2017-05-091-2126/+2491
| | | | | | | | | | | | Signed-off-by: Jordi Mas <jmas@softcatala.org>
| * | l10n: bg.po: Updated Bulgarian translation (3195t)Alexander Shopov2017-05-091-85/+61
| | | | | | | | | | | | Signed-off-by: Alexander Shopov <ash@kambanaria.org>
| * | Merge branch 'fr_l10n_v2.13_rnd2' of git://github.com/jnavila/gitJiang Xin2017-05-091-448/+478
| |\ \ | | | | | | | | | | | | | | | | * 'fr_l10n_v2.13_rnd2' of git://github.com/jnavila/git: l10n: fr.po v2.13 rnd 2
| | * | l10n: fr.po v2.13 rnd 2Jean-Noel Avila2017-05-061-448/+478
| | |/ | | | | | | | | | Signed-off-by: Jean-Noel Avila <jn.avila@free.fr>
| * | l10n: de.po: translate 4 new messagesRalf Thielow2017-05-051-440/+465
| | | | | | | | | | | | | | | | | | | | | | | | Translate 4 new messages came from git.pot update in 28e1aaa48 (l10n: git.pot: v2.13.0 round 2 (4 new, 7 removed)). Signed-off-by: Ralf Thielow <ralf.thielow@gmail.com> Acked-by: Matthias Rüster <matthias.ruester@gmail.com>
| * | l10n: de.po: update German translationRalf Thielow2017-05-051-1989/+2381
| | | | | | | | | | | | | | | | | | | | | | | | Translate 96 new messages came from git.pot update in dfc182b (l10n: git.pot: v2.13.0 round 1 (96 new, 37 removed)). Signed-off-by: Ralf Thielow <ralf.thielow@gmail.com> Acked-by: Matthias Rüster <matthias.ruester@gmail.com>
| * | l10n: de.po: lower case after semi-colonMichael J Gruber2017-05-051-1/+1
| |/ | | | | | | | | Signed-off-by: Michael J Gruber <git@drmicha.warpmail.net> Signed-off-by: Ralf Thielow <ralf.thielow@gmail.com>
| * l10n: git.pot: v2.13.0 round 2 (4 new, 7 removed)Jiang Xin2017-05-051-428/+417
| | | | | | | | | | | | Generate po/git.pot from v2.13.0-rc2 for git v2.13.0 l10n round 2. Signed-off-by: Jiang Xin <worldhello.net@gmail.com>
| * Merge branch 'master' of git://github.com/git-l10n/git-poJiang Xin2017-05-057-14167/+17929
| |\ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * 'master' of git://github.com/git-l10n/git-po: l10n: zh_CN: for git v2.13.0 l10n round 1 l10n: fr.po v2.13 round 1 l10n: pt_PT: update Portuguese translation l10n: bg.po: Updated Bulgarian translation (3201t) l10n: vi.po(3198t): Updated Vietnamese translation for v2.13.0-rc0 l10n: sv.po: Update Swedish translation (3199t0f0u) l10n: git.pot: v2.13.0 round 1 (96 new, 37 removed)
| | * l10n: zh_CN: for git v2.13.0 l10n round 1Jiang Xin2017-05-051-1947/+2303
| | | | | | | | | | | | | | | | | | | | | Translate 96 messages (3198t0f0u) for git v2.13.0-rc0. Reviewed-by: 依云 <lilydjwg@gmail.com> Signed-off-by: Jiang Xin <worldhello.net@gmail.com>
| | * Merge branch 'fr_l10n_v2.13_rnd1' of git://github.com/jnavila/gitJiang Xin2017-05-051-1943/+2285
| | |\ | | | | | | | | | | | | | | | | * 'fr_l10n_v2.13_rnd1' of git://github.com/jnavila/git: l10n: fr.po v2.13 round 1
| | | * l10n: fr.po v2.13 round 1Jean-Noel Avila2017-05-021-1943/+2285
| | | | | | | | | | | | | | | | Signed-off-by: Jean-Noel Avila <jn.avila@free.fr>
| | * | l10n: pt_PT: update Portuguese translationVasco Almeida2017-05-011-2057/+2471
| | | | | | | | | | | | | | | | Signed-off-by: Vasco Almeida <vascomalmeida@sapo.pt>
| | * | l10n: bg.po: Updated Bulgarian translation (3201t)Alexander Shopov2017-04-301-2423/+4086
| | | | | | | | | | | | | | | | Signed-off-by: Alexander Shopov <ash@kambanaria.org>
| | * | Merge branch 'master' of https://github.com/vnwildman/gitJiang Xin2017-04-291-1946/+2299
| | |\ \ | | | | | | | | | | | | | | | | | | | | * 'master' of https://github.com/vnwildman/git: l10n: vi.po(3198t): Updated Vietnamese translation for v2.13.0-rc0
| | | * | l10n: vi.po(3198t): Updated Vietnamese translation for v2.13.0-rc0Tran Ngoc Quan2017-04-251-1946/+2299
| | | |/ | | | | | | | | | | | | Signed-off-by: Tran Ngoc Quan <vnwildman@gmail.com>
| | * | l10n: sv.po: Update Swedish translation (3199t0f0u)Peter Krefting2017-04-231-1938/+2294
| | |/ | | | | | | | | | Signed-off-by: Peter Krefting <peter@softwolves.pp.se>
| | * l10n: git.pot: v2.13.0 round 1 (96 new, 37 removed)Jiang Xin2017-04-231-1913/+2191
| | | | | | | | | | | | | | | | | | Generate po/git.pot from v2.13.0-rc0 for git v2.13.0 l10n round 1. Signed-off-by: Jiang Xin <worldhello.net@gmail.com>
* | | Sync with v2.12.3Junio C Hamano2017-05-0811-11/+116
|\ \ \ | | | | | | | | | | | | Signed-off-by: Junio C Hamano <gitster@pobox.com>
| * | | Git 2.12.3v2.12.3Junio C Hamano2017-05-053-4/+12
| | | | | | | | | | | | | | | | Signed-off-by: Junio C Hamano <gitster@pobox.com>
| * | | Merge branch 'maint-2.11' into maintJunio C Hamano2017-05-0510-8/+105
| |\ \ \
| | * | | Git 2.11.2v2.11.2Junio C Hamano2017-05-054-3/+16
| | | | | | | | | | | | | | | | | | | | Signed-off-by: Junio C Hamano <gitster@pobox.com>
| | * | | Merge branch 'maint-2.10' into maint-2.11Junio C Hamano2017-05-059-8/+92
| | |\ \ \
| | | * | | Git 2.10.3v2.10.3Junio C Hamano2017-05-053-2/+10
| | | | | | | | | | | | | | | | | | | | | | | | Signed-off-by: Junio C Hamano <gitster@pobox.com>
| | | * | | Merge branch 'maint-2.9' into maint-2.10Junio C Hamano2017-05-058-7/+83
| | | |\ \ \
| | | | * | | Git 2.9.4v2.9.4Junio C Hamano2017-05-053-2/+11
| | | | | | | | | | | | | | | | | | | | | | | | | | | | Signed-off-by: Junio C Hamano <gitster@pobox.com>
| | | | * | | Merge branch 'maint-2.8' into maint-2.9Junio C Hamano2017-05-057-6/+74
| | | | |\ \ \
| | | | | * | | Git 2.8.5v2.8.5Junio C Hamano2017-05-054-3/+16
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Signed-off-by: Junio C Hamano <gitster@pobox.com>
| | | | | * | | Merge branch 'maint-2.7' into maint-2.8Junio C Hamano2017-05-056-5/+60
| | | | | |\ \ \
| | | | | | * | | Git 2.7.5v2.7.5Junio C Hamano2017-05-054-3/+19
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Signed-off-by: Junio C Hamano <gitster@pobox.com>
| | | | | | * | | Merge branch 'maint-2.6' into maint-2.7Junio C Hamano2017-05-055-4/+43
| | | | | | |\ \ \
| | | | | | | * | | Git 2.6.7v2.6.7maint-2.6Junio C Hamano2017-05-054-3/+16
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Signed-off-by: Junio C Hamano <gitster@pobox.com>
| | | | | | | * | | Merge branch 'maint-2.5' into maint-2.6Junio C Hamano2017-05-054-3/+29
| | | | | | | |\ \ \