summaryrefslogtreecommitdiff
Commit message (Collapse)AuthorAgeFilesLines
* t: make 'test_i18ngrep' more informative on failuresg/test-i18ngrepSZEDER Gábor2018-02-081-4/+20
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | When 'test_i18ngrep' can't find the expected pattern, it exits completely silently; when its negated form does find the pattern that shouldn't be there, it prints the matching line(s) but otherwise exits without any error message. This leaves the developer puzzled about what could have gone wrong. Make 'test_i18ngrep' more informative on failure by printing an error message including the invoked 'grep' command and the contents of the file it had to scan through. Note that this "dump the scanned file" part is not quite perfect, as it dumps only the file specified as the function's last positional parameter, thus assuming that there is only a single file parameter. I think that's a reasonable assumption to make, one that holds true in the current code base. And even if someone were to scan multiple files at once in the future, the worst thing that could happen is that the verbose error message won't include the contents of all those files, only the last one. Alas, we can't really do any better than this, because checking whether the other positional parameters match a filename can result in false positives: 't3400-rebase.sh' and 't3404-rebase-interactive.sh' contain one test each, where the 'test_i18ngrep's pattern verbatimly matches a file in the trash directory. Signed-off-by: SZEDER Gábor <szeder.dev@gmail.com> Reviewed-by: Jeff King <peff@peff.net> Signed-off-by: Junio C Hamano <gitster@pobox.com>
* t: validate 'test_i18ngrep's parametersSZEDER Gábor2018-02-081-0/+12
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Some of the previous patches in this series fixed bogus 'test_i18ngrep' invocations: - Two invocations where the tested git command's standard output is directly piped into 'test_i18ngrep'. While convenient, this is an antipattern, because the pipe hides the git command's exit code, and the test could continue even if the command exited with error. - Two invocations that had neither a filename parameter nor anything piped into their standard input, yet both managed to remain unnoticed for years. A third similarly bogus invocation is currently lurking in 'pu' for a couple of weeks now. Prevent similar mistakes in the future by validating 'test_i18ngrep's parameters requiring that - The last parameter names an existing file to be read, effectively forbidding piping into 'test_i18ngrep'. Note that this change will also forbid cases where 'test_i18ngrep' would legitimately read its standard input, e.g. when its standard input is redirected from a file, or when a git command's standard output is first written to an intermediate file, which is then preprocessed by a non-git command before the results are piped into 'test_i18ngrep'. See two of the previous patches for the only such cases we had in our test suite. However, reliably preventing the piping antipattern is arguably more important than supporting these cases, which can be easily worked around by opening the file directly or using an intermediate file anyway. - There are at least two parameters, not including the optional '!' to negate the pattern. This ought to catch corner cases when 'test_i18ngrep' looks for the name of an existing file on its standard input; the above check would miss this case becase the filename as pattern would be the last parameter. Note that this is not quite perfect, as it doesn't account for any 'grep --options' given as parameters. However, doing so would be far too complicated, considering that patterns can start with dashes as well, and in the majority of the cases we don't use any such options anyway. Signed-off-by: SZEDER Gábor <szeder.dev@gmail.com> Reviewed-by: Jeff King <peff@peff.net> Signed-off-by: Junio C Hamano <gitster@pobox.com>
* t: move 'test_i18ncmp' and 'test_i18ngrep' to 'test-lib-functions.sh'SZEDER Gábor2018-02-082-26/+26
| | | | | | | | | | Both 'test_i18ncmp' and 'test_i18ngrep' helper functions are supposed to be called from our test scripts, so they should be in 'test-lib-functions.sh'. Signed-off-by: SZEDER Gábor <szeder.dev@gmail.com> Reviewed-by: Jeff King <peff@peff.net> Signed-off-by: Junio C Hamano <gitster@pobox.com>
* t5536: let 'test_i18ngrep' read the file without redirectionSZEDER Gábor2018-02-081-1/+1
| | | | | | | | | Redirecting 'test_i18ngrep's standard input from a file will interfere with the linting that will be added in a later patch. Signed-off-by: SZEDER Gábor <szeder.dev@gmail.com> Reviewed-by: Jeff King <peff@peff.net> Signed-off-by: Junio C Hamano <gitster@pobox.com>
* t5510: consolidate 'grep' and 'test_i18ngrep' patternsSZEDER Gábor2018-02-081-6/+3
| | | | | | | | | | | | | | | One of the tests in 't5510-fetch.sh' checks the output of 'git fetch' using 'test_i18ngrep', and while doing so it prefilters the output with 'grep' before piping the result into 'test_i18ngrep'. This prefiltering is unnecessary, with the appropriate pattern 'test_i18ngrep' can do it all by itself. Furthermore, piping data into 'test_i18ngrep' will interfere with the linting that will be added in a later patch. Signed-off-by: SZEDER Gábor <szeder.dev@gmail.com> Reviewed-by: Jeff King <peff@peff.net> Signed-off-by: Junio C Hamano <gitster@pobox.com>
* t4001: don't run 'git status' upstream of a pipeSZEDER Gábor2018-02-081-3/+8
| | | | | | | | | | | | | | The primary purpose of three tests in 't4001-diff-rename.sh' is to check rename detection in 'git status', but all three do so by running 'git status' upstream of a pipe, hiding its exit code. Consequently, the test could continue even if 'git status' exited with error. Use an intermediate file between 'git status' and 'test_i18ngrep' to catch a potential failure of the former. Signed-off-by: SZEDER Gábor <szeder.dev@gmail.com> Reviewed-by: Jeff King <peff@peff.net> Signed-off-by: Junio C Hamano <gitster@pobox.com>
* t6022: don't run 'git merge' upstream of a pipeSZEDER Gábor2018-02-081-2/+4
| | | | | | | | | | | | | | The primary purpose of 't6022-merge-rename.sh' is to test 'git merge', but one of the tests runs it upstream of a pipe, hiding its exit code. Consequently, the test could continue even if 'git merge' exited with error. Use an intermediate file between 'git merge' and 'test_i18ngrep' to catch a potential failure of the former. Signed-off-by: SZEDER Gábor <szeder.dev@gmail.com> Reviewed-by: Jeff King <peff@peff.net> Signed-off-by: Junio C Hamano <gitster@pobox.com>
* t5812: add 'test_i18ngrep's missing filename parameterSZEDER Gábor2018-02-081-4/+1
| | | | | | | | | | | | | | | | | | | | | | | | The second 'test_i18ngrep' invocation in the test 'curl redirects respect whitelist' is missing its filename parameter. This has remained unnoticed since its introduction in f4113cac0 (http: limit redirection to protocol-whitelist, 2015-09-22), because it would only cause the test to fail if Git was built with a sufficiently old libcurl version. The test's two ||-chained 'test_i18ngrep' invocations are supposed to check that either one of the two patterns is present in 'git clone's error message. As it happens, the first invocation covers the error message from any reasonably up-to-date libcurl, thus the second invocation, the one without the filename parameter, isn't executed at all. Apparently no one has run the test suite's httpd tests with such an old libcurl in the last 2+ years, or at least they haven't bothered to notify us about the failed test. Fix this by consolidating the two patterns into a single extended regexp, eliminating the need for an ||-chained second 'test_i18ngrep' invocation. Signed-off-by: SZEDER Gábor <szeder.dev@gmail.com> Reviewed-by: Jeff King <peff@peff.net> Signed-off-by: Junio C Hamano <gitster@pobox.com>
* t5541: add 'test_i18ngrep's missing filename parameterSZEDER Gábor2018-02-081-1/+1
| | | | | | | | | | | | | | | The test 'push --no-progress silences progress but not status' runs 'test_i18ngrep' without specifying a filename parameter. This has remained unnoticed since its introduction in e304aeba2 (t5541: test more combinations of --progress, 2012-05-01), because that 'test_i18ngrep' is supposed to check that the given pattern is not present in its input, and of course it won't find that pattern if its input is empty (as it comes from /dev/null). This also means that this test could miss a potential breakage of 'git push --no-progress'. Signed-off-by: SZEDER Gábor <szeder.dev@gmail.com> Reviewed-by: Jeff King <peff@peff.net> Signed-off-by: Junio C Hamano <gitster@pobox.com>
* Git 2.16.1v2.16.1Junio C Hamano2018-01-213-2/+13
| | | | Signed-off-by: Junio C Hamano <gitster@pobox.com>
* Merge branch 'bc/hash-algo' into maintJunio C Hamano2018-01-212-1/+18
|\ | | | | | | | | | | * bc/hash-algo: t5601-clone: test case-conflicting files on case-insensitive filesystem repository: pre-initialize hash algo pointer
| * t5601-clone: test case-conflicting files on case-insensitive filesystemEric Sunshine2018-01-211-0/+17
| | | | | | | | | | | | | | | | | | | | | | | | | | | | A recently introduced regression caused a segfault at clone time on case-insensitive filesystems when filenames differing only in case are present. This bug has already been fixed (repository: pre-initialize hash algo pointer, 2018-01-18), but it's not the first time similar problems have arisen. Therefore, introduce a test to catch this case and protect against future regressions. Signed-off-by: Eric Sunshine <sunshine@sunshineco.com> Signed-off-by: brian m. carlson <sandals@crustytoothpaste.net> Signed-off-by: Eric Sunshine <sunshine@sunshineco.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
| * repository: pre-initialize hash algo pointerbrian m. carlson2018-01-191-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | There are various git subcommands (among them, clone) which don't set up the repository (that is, they lack RUN_SETUP or RUN_SETUP_GENTLY) but end up needing to have information about the hash algorithm in use. Because the hash algorithm is part of struct repository and it's only initialized in repository setup, we can end up dereferencing a NULL pointer in some cases if we call one of these subcommands and look up the empty blob or empty tree values. A "git clone" of a project that has two paths that differ only in case suffers from this if it is run on a case insensitive platform. When the command attempts to check out one of these two paths after checking out the other one, the checkout codepath needs to see if the version that is already on the filesystem (which should not happen if the FS were case sensitive) is dirty, and it needs to exercise the hashing code at that point. In the future, we can add a command line option for this or read it from the configuration, but until we're ready to expose that functionality to the user, simply initialize the repository structure to use the current hash algorithm, SHA-1. Signed-off-by: brian m. carlson <sandals@crustytoothpaste.net> Signed-off-by: Junio C Hamano <gitster@pobox.com>
* | Git 2.16v2.16.0Junio C Hamano2018-01-172-3/+6
| | | | | | | | Signed-off-by: Junio C Hamano <gitster@pobox.com>
* | Merge tag 'l10n-2.16.0-rnd2' of git://github.com/git-l10n/git-poJunio C Hamano2018-01-1612-20028/+22202
|\ \ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | l10n for Git 2.16.0 round 2 * tag 'l10n-2.16.0-rnd2' of git://github.com/git-l10n/git-po: (24 commits) l10n: de.po: translate 72 new messages l10n: de.po: improve messages when a branch starts to track another ref l10n: bg.po: Updated Bulgarian translation (3288t) l10n: TEAMS: add zh_CN team members l10n: zh_CN: for git v2.16.0 l10n round 2 l10n: sv.po: Update Swedish translation (3288t0f0u) l10n: ru.po: update Russian translation l10n: TEAMS: Add ko team members l10n: ko.po: Update Korean translation l10n: fr.po 2.16 round 2 l10n: es.po: Spanish translation 2.16.0 round 2 l10n: vi.po(3288t): Updated Vietnamese translation for v2.16.0 round 2 l10n: git.pot: v2.16.0 round 2 (8 new, 4 removed) l10n: es.po: Update Spanish Translation v2.16.0 l10n: fr.po v2.16.0 round 1 l10n: bg.po: Updated Bulgarian translation (3284t) l10n: sv.po: Update Swedish translation (3284t0f0u) l10n: fr.po: "worktree list" mistranslated as prune l10n: git.pot: v2.16.0 round 1 (64 new, 25 removed) l10n: fixes to German translation ...
| * | l10n: de.po: translate 72 new messagesRalf Thielow2018-01-151-1934/+2172
| | | | | | | | | | | | | | | | | | | | | | | | | | | Translate 72 new messages came from git.pot update in 18a907225 (l10n: git.pot: v2.16.0 round 1 (64 new, 25 removed)) and 005c62fe4 (l10n: git.pot: v2.16.0 round 2 (8 new, 4 removed)). Signed-off-by: Ralf Thielow <ralf.thielow@gmail.com> Acked-by: Matthias Rüster <matthias.ruester@gmail.com>
| * | l10n: de.po: improve messages when a branch starts to track another refRalf Thielow2018-01-151-8/+8
| | | | | | | | | | | | Signed-off-by: Ralf Thielow <ralf.thielow@gmail.com>
| * | l10n: bg.po: Updated Bulgarian translation (3288t)Alexander Shopov2018-01-111-181/+203
| | | | | | | | | | | | Signed-off-by: Alexander Shopov <ash@kambanaria.org>
| * | l10n: TEAMS: add zh_CN team membersJiang Xin2018-01-101-0/+1
| | | | | | | | | | | | | | | | | | Add Fangyi Zhou to zh_CN l10n team members. Signed-off-by: Jiang Xin <worldhello.net@gmail.com>
| * | l10n: zh_CN: for git v2.16.0 l10n round 2Jiang Xin2018-01-101-1920/+2144
| | | | | | | | | | | | | | | | | | | | | | | | Translate 72 messages (3288t0f0u) for git v2.16.0-rc1. Signed-off-by: Jiang Xin <worldhello.net@gmail.com> Reviewed-by: 依云 <lilydjwg@gmail.com> Reviewed-by: Fangyi Zhou <fangyi.zhou@yuriko.moe>
| * | Merge branch 'master' of git://github.com/nafmo/git-l10n-svJiang Xin2018-01-101-181/+197
| |\ \ | | | | | | | | | | | | | | | | * 'master' of git://github.com/nafmo/git-l10n-sv: l10n: sv.po: Update Swedish translation (3288t0f0u)
| | * | l10n: sv.po: Update Swedish translation (3288t0f0u)Peter Krefting2018-01-091-181/+197
| | | | | | | | | | | | | | | | Signed-off-by: Peter Krefting <peter@softwolves.pp.se>
| * | | Merge branch 'russian-l10n' of https://github.com/DJm00n/git-po-ruJiang Xin2018-01-101-1918/+2092
| |\ \ \ | | | | | | | | | | | | | | | | | | | | * 'russian-l10n' of https://github.com/DJm00n/git-po-ru: l10n: ru.po: update Russian translation
| | * | | l10n: ru.po: update Russian translationDimitriy Ryazantcev2018-01-091-1918/+2092
| | |/ / | | | | | | | | | | | | Signed-off-by: Dimitriy Ryazantcev <dimitriy.ryazantcev@gmail.com>
| * | | l10n: TEAMS: Add ko team membersChangwoo Ryu2018-01-091-0/+2
| |/ / | | | | | | | | | | | | | | | Add Gwan-gyeong Mun and Sihyeon Jang. Signed-off-by: Changwoo Ryu <cwryu@debian.org>
| * | Merge branch 'ko/merge-l10n' of https://github.com/git-l10n-ko/git-l10n-koJiang Xin2018-01-092-1944/+2200
| |\ \ | | | | | | | | | | | | | | | | * 'ko/merge-l10n' of https://github.com/git-l10n-ko/git-l10n-ko: l10n: ko.po: Update Korean translation
| | * | l10n: ko.po: Update Korean translationChangwoo Ryu2018-01-082-1944/+2200
| | | | | | | | | | | | | | | | | | | | | | | | | | | | Signed-off-by: Changwoo Ryu <cwryu@debian.org> Signed-off-by: Sihyeon Jang <uneedsihyeon@gmail.com> Signed-off-by: Gwan-gyeong Mun <elongbug@gmail.com> Reviewed-by: Changwoo Ryu <cwryu@debian.org>
| * | | Merge branch '2.16' of https://github.com/ChrisADR/git-poJiang Xin2018-01-081-181/+197
| |\ \ \ | | | | | | | | | | | | | | | | | | | | * '2.16' of https://github.com/ChrisADR/git-po: l10n: es.po: Spanish translation 2.16.0 round 2
| | * | | l10n: es.po: Spanish translation 2.16.0 round 2Christopher Díaz Riveros2018-01-071-181/+197
| | |/ / | | | | | | | | | | | | Signed-off-by: Christopher Díaz Riveros <chrisadr@gentoo.org>
| * | | Merge branch 'fr_2.16-rc1' of git://github.com/jnavila/gitJiang Xin2018-01-081-192/+225
| |\ \ \ | | | | | | | | | | | | | | | | | | | | * 'fr_2.16-rc1' of git://github.com/jnavila/git: l10n: fr.po 2.16 round 2
| | * | | l10n: fr.po 2.16 round 2Jean-Noel Avila2018-01-071-192/+225
| | |/ / | | | | | | | | | | | | Signed-off-by: Jean-Noel Avila <jn.avila@free.fr>
| * | | l10n: vi.po(3288t): Updated Vietnamese translation for v2.16.0 round 2Tran Ngoc Quan2018-01-071-1929/+2156
| |/ / | | | | | | | | | Signed-off-by: Tran Ngoc Quan <vnwildman@gmail.com>
| * | l10n: git.pot: v2.16.0 round 2 (8 new, 4 removed)Jiang Xin2018-01-071-173/+192
| | | | | | | | | | | | | | | | | | Generate po/git.pot from v2.16.0-rc1 for git v2.16.0 l10n round 2. Signed-off-by: Jiang Xin <worldhello.net@gmail.com>
| * | Merge branch 'master' of git://github.com/git-l10n/git-poJiang Xin2018-01-078-10292/+11238
| |\ \ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * 'master' of git://github.com/git-l10n/git-po: l10n: es.po: Update Spanish Translation v2.16.0 l10n: fr.po v2.16.0 round 1 l10n: bg.po: Updated Bulgarian translation (3284t) l10n: sv.po: Update Swedish translation (3284t0f0u) l10n: fr.po: "worktree list" mistranslated as prune l10n: git.pot: v2.16.0 round 1 (64 new, 25 removed) l10n: fixes to German translation l10n: Update Spanish translation l10n: zh_CN translate parameter name l10n: zh_CN Fix typo l10n: Fixes to Catalan translation
| | * \ Merge branch '2.16' of https://github.com/ChrisADR/git-poJiang Xin2018-01-061-1920/+2129
| | |\ \ | | | | | | | | | | | | | | | | | | | | * '2.16' of https://github.com/ChrisADR/git-po: l10n: es.po: Update Spanish Translation v2.16.0
| | | * | l10n: es.po: Update Spanish Translation v2.16.0Christopher Díaz Riveros2018-01-041-1920/+2129
| | | | | | | | | | | | | | | | | | | | Signed-off-by: Christopher Díaz Riveros <chrisadr@gentoo.org>
| | * | | Merge branch 'fr_2.16' of git://github.com/jnavila/gitJiang Xin2018-01-061-1911/+2113
| | |\ \ \ | | | |/ / | | |/| | | | | | | | | | | | | | | | | * 'fr_2.16' of git://github.com/jnavila/git: l10n: fr.po v2.16.0 round 1 l10n: fr.po: "worktree list" mistranslated as prune
| | | * | l10n: fr.po v2.16.0 round 1Jean-Noel Avila2018-01-021-1910/+2112
| | | | | | | | | | | | | | | | | | | | Signed-off-by: Jean-Noel Avila <jn.avila@free.fr>
| | | * | l10n: fr.po: "worktree list" mistranslated as pruneLouis Bettens2017-12-311-1/+1
| | | | | | | | | | | | | | | | | | | | Signed-off-by: Louis Bettens <louis@bettens.info>
| | * | | Merge branch 'master' of git://github.com/alshopov/git-poJiang Xin2018-01-021-1934/+2106
| | |\ \ \ | | | | | | | | | | | | | | | | | | | | | | | | * 'master' of git://github.com/alshopov/git-po: l10n: bg.po: Updated Bulgarian translation (3284t)
| | | * | | l10n: bg.po: Updated Bulgarian translation (3284t)Alexander Shopov2018-01-011-1934/+2106
| | | |/ / | | | | | | | | | | | | | | | Signed-off-by: Alexander Shopov <ash@kambanaria.org>
| | * | | l10n: sv.po: Update Swedish translation (3284t0f0u)Peter Krefting2018-01-011-1910/+2118
| | |/ / | | | | | | | | | | | | | | | | | | | | Also corrected spelling. Signed-off-by: Peter Krefting <peter@softwolves.pp.se>
| | * | Merge branch 'maint' of git://github.com/git-l10n/git-poJiang Xin2017-12-314-745/+746
| | |\ \ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * 'maint' of git://github.com/git-l10n/git-po: l10n: fixes to German translation l10n: Update Spanish translation l10n: zh_CN translate parameter name l10n: zh_CN Fix typo l10n: Fixes to Catalan translation
| | | * | l10n: fixes to German translationRobert Abel2017-12-061-3/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Der-, die- and dasselbe and their declensions are spelt as one word in German. Signed-off-by: Robert Abel <rabel@robertabel.eu> Signed-off-by: Ralf Thielow <ralf.thielow@gmail.com>
| | | * | Merge branch '2.15.1' of https://github.com/ChrisADR/git-po into maintJiang Xin2017-12-051-531/+534
| | | |\ \ | | | | | | | | | | | | | | | | | | | | | | | | * '2.15.1' of https://github.com/ChrisADR/git-po: l10n: Update Spanish translation
| | | | * | l10n: Update Spanish translationChristopher Díaz Riveros2017-12-041-531/+534
| | | | | | | | | | | | | | | | | | | | | | | | Signed-off-by: Christopher Díaz Riveros <chrisadr@gentoo.org>
| | | * | | l10n: zh_CN translate parameter nameFangyi Zhou2017-12-031-17/+17
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Translate parameters such as: * <new-branch-name> in advice.c:126, * <command>, <path>, <revision> in setup.c:171, setup.c:184, setup.c:252, * <base-commit-id> in builtin/log.c:1288, * <conflicted_files> in git-rebase.sh:58, and more... Signed-off-by: Fangyi Zhou <fangyi.zhou@yuriko.moe> Signed-off-by: Jiang Xin <worldhello.net@gmail.com>
| | | * | | l10n: zh_CN Fix typoZhou Fangyi2017-12-031-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | apply.c:125 say -> way Signed-off-by: Fangyi Zhou <fangyi.zhou@yuriko.moe>
| | | * | | l10n: Fixes to Catalan translationJordi Mas2017-11-041-193/+191
| | | |/ / | | | | | | | | | | | | | | | Signed-off-by: Jordi Mas <jmas@softcatala.org>
| | * | | l10n: git.pot: v2.16.0 round 1 (64 new, 25 removed)Jiang Xin2017-12-311-1885/+2039
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Generate po/git.pot from v2.16.0-rc0 for git v2.16.0 l10n round 1. Signed-off-by: Jiang Xin <worldhello.net@gmail.com>