summaryrefslogtreecommitdiff
Commit message (Collapse)AuthorAgeFilesLines
* xdiff: fix merging of appended hunk with -Wrs/xdiff-hunk-with-func-lineRené Scharfe2016-06-092-2/+25
| | | | | | | | | | | | | | When -W is given we search the lines between the end of the current context and the next change for a function line. If there is none then we merge those two hunks as they must be part of the same function. If the next change is an appended chunk we abort the search early in get_func_line(), however, because its line number is out of range. Fix that by searching from the end of the pre-image in that case instead. Reported-by: Junio C Hamano <gitster@pobox.com> Signed-off-by: Rene Scharfe <l.s.r@web.de> Signed-off-by: Junio C Hamano <gitster@pobox.com>
* grep: -W: don't extend context to trailing empty linesRené Scharfe2016-05-312-3/+27
| | | | | | | | | | | | | | | | | Empty lines between functions are shown by grep -W, as it considers them to be part of the function preceding them. They are not interesting in most languages. The previous patches stopped showing them for diff -W. Stop showing empty lines trailing a function with grep -W. Grep scans the lines of a buffer from top to bottom and prints matching lines immediately. Thus we need to peek ahead in order to determine if an empty line is part of a function body and worth showing or not. Remember how far ahead we peeked in order to avoid having to do so repeatedly when handling multiple consecutive empty lines. Signed-off-by: Rene Scharfe <l.s.r@web.de> Signed-off-by: Junio C Hamano <gitster@pobox.com>
* t7810: add test for grep -W and trailing empty context linesRené Scharfe2016-05-311-3/+16
| | | | | | | | | Add a test demonstrating that git grep -W prints empty lines following the function context we're actually interested in. The modified test file makes it necessary to adjust three unrelated test cases. Signed-off-by: Rene Scharfe <l.s.r@web.de> Signed-off-by: Junio C Hamano <gitster@pobox.com>
* xdiff: don't trim common tail with -WRené Scharfe2016-05-312-7/+5
| | | | | | | | | | | | | | | | The function trim_common_tail() exits early if context lines are requested. If -U0 and -W are specified together then it can still trim context lines that might belong to a changed function. As a result that function is shown incompletely. Fix that by calling trim_common_tail() only if no function context or fixed context is requested. The parameter ctx is no longer needed now; remove it. While at it fix an outdated comment as well. Signed-off-by: Rene Scharfe <l.s.r@web.de> Signed-off-by: Junio C Hamano <gitster@pobox.com>
* xdiff: -W: don't include common trailing empty lines in contextRené Scharfe2016-05-312-2/+4
| | | | | | | | | | | | | Empty lines between functions are shown by diff -W, as it considers them to be part of the function preceding them. They are not interesting in most languages. The previous patch stopped showing them in the special case of a function added at the end of a file. Stop extending context to those empty lines by skipping back over them from the start of the next function. Signed-off-by: Rene Scharfe <l.s.r@web.de> Signed-off-by: Junio C Hamano <gitster@pobox.com>
* xdiff: ignore empty lines before added functions with -WRené Scharfe2016-05-312-3/+21
| | | | | | | | | | | | | | | If a new function and a preceding empty line is appended, diff -W shows the previous function in full in order to provide context for that empty line. In most languages empty lines between sections are not interesting in and off themselves and showing a whole extra function for them is not what we want. Skip empty lines when checking of the appended chunk starts with a function line, thereby avoiding to extend the context just for them. Helped-by: Ramsay Jones <ramsay@ramsayjones.plus.com> Signed-off-by: Rene Scharfe <l.s.r@web.de> Signed-off-by: Junio C Hamano <gitster@pobox.com>
* xdiff: handle appended chunks better with -WRené Scharfe2016-05-312-4/+25
| | | | | | | | | | | | | | | | | | | | If lines are added at the end of a file, diff -W shows the whole file. That's because get_func_line() only considers the pre-image and gives up if it sees a record index beyond its end. Consider the post-image as well to see if the added lines already make up a full function. If it doesn't then search for the previous function line by starting from the bottom of the pre-image, thereby avoiding to confuse get_func_line(). Reuse the existing label called "again", as it's exactly where we need to jump to when we're done handling the pre-context, but rename it to "post_context_calculation" in order to document its new purpose better. Reported-by: Junio C Hamano <gitster@pobox.com> Initial-patch-by: Junio C Hamano <gitster@pobox.com> Signed-off-by: Rene Scharfe <l.s.r@web.de> Signed-off-by: Junio C Hamano <gitster@pobox.com>
* xdiff: factor out match_func_rec()René Scharfe2016-05-311-4/+11
| | | | | | | | Add match_func_rec(), a helper that wraps accessing a record and calling the appropriate function for checking if it contains a function line. Signed-off-by: Rene Scharfe <l.s.r@web.de> Signed-off-by: Junio C Hamano <gitster@pobox.com>
* t4051: rewrite, add more testsRené Scharfe2016-05-316-74/+240
| | | | | | | | | | | | | | | | | | | | Remove the tests that checked against a fixed result and replace them with more focused checks of desired properties of the created diffs. That way we get more detailed and meaningful diagnostics. Store test file contents in files in a subdirectory in order to avoid cluttering the test script with them. Use tagged commits to store the changes to test diff -W against instead of using changes to the worktree. Use the worktree instead to try and apply the generated patch in order to validate it. Document unwanted features: trailing empty lines, too much context for appended functions, insufficient context at the end with -U0. Helped-by: Junio C Hamano <gitster@pobox.com> Signed-off-by: Rene Scharfe <l.s.r@web.de> Signed-off-by: Junio C Hamano <gitster@pobox.com>
* Git 2.8v2.8.0Junio C Hamano2016-03-283-9/+14
| | | | Signed-off-by: Junio C Hamano <gitster@pobox.com>
* Merge branch 'ls/p4-doc-markup'Junio C Hamano2016-03-241-6/+4
|\ | | | | | | | | | | * ls/p4-doc-markup: Documentation: fix git-p4 AsciiDoc formatting Documentation: use ASCII quotation marks in git-p4
| * Documentation: fix git-p4 AsciiDoc formattingls/p4-doc-markupLars Schneider2016-03-231-5/+3
| | | | | | | | | | | | Noticed-by: Eric Sunshine <sunshine@sunshineco.com> Signed-off-by: Lars Schneider <larsxschneider@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
| * Documentation: use ASCII quotation marks in git-p4Lars Schneider2016-03-211-1/+1
| | | | | | | | | | Signed-off-by: Lars Schneider <larsxschneider@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
* | Merge branch 'js/mingw-tests-2.8'Junio C Hamano2016-03-244-11/+19
|\ \ | | | | | | | | | | | | | | | | | | | | | * js/mingw-tests-2.8: mingw: skip some tests in t9115 due to file name issues t1300: fix the new --show-origin tests on Windows t1300-repo-config: make it resilient to being run via 'sh -x' config --show-origin: report paths with forward slashes
| * | mingw: skip some tests in t9115 due to file name issuesJohannes Schindelin2016-03-231-2/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | These two tests wanted to write file names which are incompatible with Windows' file naming rules (even if they pass using Cygwin due to Cygwin's magic path mangling). While at it, skip the same tests also on MacOSX/HFS, as pointed out by Torsten Bögershausen. Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de> Signed-off-by: Torsten Bögershausen <tboegi@web.de> Reviewed-by: Jonathan Nieder <jrnieder@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
| * | t1300: fix the new --show-origin tests on WindowsJohannes Schindelin2016-03-231-3/+6
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | On Windows, we have that funny situation where the test script can refer to POSIX paths because it runs in a shell that uses a POSIX emulation layer ("MSYS2 runtime"). Yet, git.exe does *not* understand POSIX paths at all but only pure Windows paths. So let's just convert the POSIX paths to Windows paths before passing them on to Git, using `pwd` (which is already modified on Windows to output Windows paths). While fixing the new tests on Windows, we also have to exclude the tests that want to write a file with a name that is illegal on Windows (unfortunately, there is more than one test trying to make use of that file). Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de> Signed-off-by: Junio C Hamano <gitster@pobox.com>
| * | t1300-repo-config: make it resilient to being run via 'sh -x'Johannes Schindelin2016-03-231-6/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | One way to diagnose broken regression tests is to run the test script using 'sh -x t... -i -v' to find out which call actually demonstrates the symptom. Hence it is pretty counterproductive if the test script behaves differently when being run via 'sh -x', in particular when using test_cmp or test_i18ncmp on redirected stderr. A more recent way "sh tXXXX -i -v -x" has the same issue. So let's use test_i18ngrep (as suggested by Jonathan Nieder) instead of test_cmp/test_i18ncmp to verify that stderr looks as expected. Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de> Signed-off-by: Junio C Hamano <gitster@pobox.com>
| * | config --show-origin: report paths with forward slashesJohannes Schindelin2016-03-232-0/+9
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | On Windows, the backslash is the native directory separator, but all supported Windows versions also accept the forward slash in most circumstances. Our tests expect forward slashes. Relative paths are generated by Git using forward slashes. So let's try to be consistent and use forward slashes in the $HOME part of the paths reported by `git config --show-origin`, too. Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de> Signed-off-by: Junio C Hamano <gitster@pobox.com>
* | | Merge branch 'sb/submodule-module-list-pathspec-fix'Junio C Hamano2016-03-242-3/+16
|\ \ \ | | | | | | | | | | | | | | | | | | | | | | | | | | | | A fix for a small regression in "module_list" helper that was rewritten in C (also applies to 2.7.x). * sb/submodule-module-list-pathspec-fix: submodule: fix regression for deinit without submodules
| * | | submodule: fix regression for deinit without submodulesStefan Beller2016-03-222-3/+16
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Per Cederqvist wrote: > It used to be possible to run > > git submodule deinit -f . > > to remove any submodules, no matter how many submodules you had. That > is no longer possible in projects that don't have any submodules at > all. The command will fail with: > > error: pathspec '.' did not match any file(s) known to git. This regression was introduced in 74703a1e4dfc (submodule: rewrite `module_list` shell function in C, 2015-09-02), as we changed the order of checking in new module listing to first check whether it is a gitlin before feeding it to match_pathspec(). It used to be that a pathspec that does not match any path were diagnosed as an error, but the new code complains for a pathspec that does not match any submodule path. Arguably the new behaviour may give us a better diagnosis, but that is inconsistent with the suggestion "deinit" gives, and also this was an unintended accident. The new behaviour hopefully can be redesigned and implemented better in future releases, but for now, switch these two checks to restore the same behavior as before. In an empty repository, giving the pathspec '.' will still get the same "did not match" error, but that is the same bug we had before 1.7.0. Reported-by: Per Cederqvist <cederp@opera.com> Signed-off-by: Stefan Beller <sbeller@google.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
* | | | Merge branch 'master' of git://github.com/git-l10n/git-poJunio C Hamano2016-03-233-3761/+11533
|\ \ \ \ | |_|/ / |/| | | | | | | | | | | | | | | | | | | * 'master' of git://github.com/git-l10n/git-po: l10n: pt_PT: Update and add new translations l10n: ca.po: update translation l10n: vi.po (2530t): Update translation
| * | | Merge branch 'master' of https://github.com/vnwildman/gitJiang Xin2016-03-231-30/+125
| |\ \ \ | | | | | | | | | | | | | | | | | | | | * 'master' of https://github.com/vnwildman/git: l10n: vi.po (2530t): Update translation
| | * | | l10n: vi.po (2530t): Update translationTran Ngoc Quan2016-03-211-30/+125
| | | | | | | | | | | | | | | | | | | | Signed-off-by: Tran Ngoc Quan <vnwildman@gmail.com>
| * | | | Merge branch 'master' of git://github.com/alexhenrie/git-poJiang Xin2016-03-231-1365/+1581
| |\ \ \ \ | | | | | | | | | | | | | | | | | | | | | | | | * 'master' of git://github.com/alexhenrie/git-po: l10n: ca.po: update translation
| | * | | | l10n: ca.po: update translationAlex Henrie2016-03-211-1365/+1581
| | |/ / / | | | | | | | | | | | | | | | Signed-off-by: Alex Henrie <alexhenrie24@gmail.com>
| * | | | l10n: pt_PT: Update and add new translationsVasco Almeida2016-03-221-2366/+9827
| |/ / / | | | | | | | | | | | | Signed-off-by: Vasco Almeida <vascomalmeida@sapo.pt>
* | | | Git 2.8-rc4v2.8.0-rc4Junio C Hamano2016-03-211-1/+1
| | | | | | | | | | | | | | | | Signed-off-by: Junio C Hamano <gitster@pobox.com>
* | | | Sync with maintJunio C Hamano2016-03-212-3/+3
|\ \ \ \ | | | | | | | | | | | | | | | | | | | | | | | | | * maint: Documentation: fix broken linkgit to git-config git-compat-util: st_add4: work around gcc 4.2.x compiler crash
| * \ \ \ Merge branch 'mm/doc-hooks-linkgit-fix' into maintJunio C Hamano2016-03-211-1/+1
| |\ \ \ \ | | | | | | | | | | | | | | | | | | | | | | | | * mm/doc-hooks-linkgit-fix: Documentation: fix broken linkgit to git-config
| | * | | | Documentation: fix broken linkgit to git-configmm/doc-hooks-linkgit-fixMatthieu Moy2016-03-211-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Signed-off-by: Matthieu Moy <Matthieu.Moy@imag.fr> Signed-off-by: Junio C Hamano <gitster@pobox.com>
| * | | | | Merge branch 'es/st-add4-gcc-4.2-workaround' into maintJunio C Hamano2016-03-211-2/+2
| |\ \ \ \ \ | | |_|_|_|/ | |/| | | | | | | | | | | | | | | | * es/st-add4-gcc-4.2-workaround: git-compat-util: st_add4: work around gcc 4.2.x compiler crash
| | * | | | git-compat-util: st_add4: work around gcc 4.2.x compiler crashes/st-add4-gcc-4.2-workaroundEric Sunshine2016-03-211-2/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Although changes by 5b442c4 (tree-diff: catch integer overflow in combine_diff_path allocation, 2016-02-19) are perfectly valid, they unfortunately trigger an internal compiler error in gcc 4.2.x: combine-diff.c: In function 'diff_tree_combined': combine-diff.c:1391: internal compiler error: Segmentation fault: 11 Experimentation reveals that changing st_add4()'s argument evaluation order is sufficient to sidestep this problem. Although st_add3() does not trigger the compiler bug, for style consistency, change its argument evaluation order to match. Signed-off-by: Eric Sunshine <sunshine@sunshineco.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
* | | | | | Merge branch 'tb/avoid-gcc-on-darwin-10-6'Junio C Hamano2016-03-211-3/+0
|\ \ \ \ \ \ | | | | | | | | | | | | | | | | | | | | | | | | | | | | * tb/avoid-gcc-on-darwin-10-6: Revert "config.mak.uname: use clang for Mac OS X 10.6"
| * | | | | | Revert "config.mak.uname: use clang for Mac OS X 10.6"tb/avoid-gcc-on-darwin-10-6Eric Sunshine2016-03-211-3/+0
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This reverts commit 7b6daf8d2fee1a9866b1d4eddbfaa5dbc42c5dbb. Now that st_add4() has been patched to work around the gcc 4.2.x compiler crash, revert the sledge-hammer approach of forcing Mac OS X 10.6 to unconditionally use 'clang' rather than the default compiler (gcc). Signed-off-by: Eric Sunshine <sunshine@sunshineco.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
* | | | | | | Merge tag 'l10n-2.8.0-rnd3' of git://github.com/git-l10n/git-poJunio C Hamano2016-03-206-82/+283
|\ \ \ \ \ \ \ | | |_|_|_|/ / | |/| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | l10n-2.8.0-rnd3 * tag 'l10n-2.8.0-rnd3' of git://github.com/git-l10n/git-po: l10n: zh_CN: review for git v2.8.0 l10n round 2 l10n: de.po: add missing newlines l10n: de.po: translate 22 new messages l10n: ko.po: Update Korean translation l10n: fr.po v2.8.0 round 3 l10n: sv.po: Update Swedish translation (2530t0f0u) l10n: ru.po: update Russian translation
| * | | | | | l10n: zh_CN: review for git v2.8.0 l10n round 2Ray Chen2016-03-201-5/+5
| | | | | | | | | | | | | | | | | | | | | | | | | | | | Signed-off-by: Ray Chen <oldsharp@gmail.com>
| * | | | | | l10n: de.po: add missing newlinesRalf Thielow2016-03-171-2/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | Signed-off-by: Ralf Thielow <ralf.thielow@gmail.com>
| * | | | | | l10n: de.po: translate 22 new messagesRalf Thielow2016-03-171-37/+136
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Translate 22 new messages came from git.pot update in f1522b2 (l10n: git.pot: v2.8.0 round 2 (21 new, 1 removed)) and a5a4168 (l10n: git.pot: Add one new message for Git 2.8.0). Signed-off-by: Ralf Thielow <ralf.thielow@gmail.com> Acked-by: Matthias RĂ¼ster <matthias.ruester@gmail.com>
| * | | | | | Merge branch 'fr_v2.8.0_r3' of git://github.com/jnavila/gitJiang Xin2016-03-171-5/+7
| |\ \ \ \ \ \ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * 'fr_v2.8.0_r3' of git://github.com/jnavila/git: l10n: fr.po v2.8.0 round 3
| | * | | | | | l10n: fr.po v2.8.0 round 3Jean-Noel Avila2016-03-151-5/+7
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Signed-off-by: Jean-Noel Avila <jn.avila@free.fr>
| * | | | | | | Merge branch 'ko/merge-l10n' of https://github.com/changwoo/git-l10n-koJiang Xin2016-03-171-3/+7
| |\ \ \ \ \ \ \ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * 'ko/merge-l10n' of https://github.com/changwoo/git-l10n-ko: l10n: ko.po: Update Korean translation
| | * | | | | | | l10n: ko.po: Update Korean translationChangwoo Ryu2016-03-161-3/+7
| | |/ / / / / / | | | | | | | | | | | | | | | | | | | | | | | | Signed-off-by: Changwoo Ryu <cwryu@debian.org>
| * | | | | | | Merge branch 'master' of git://github.com/nafmo/git-l10n-svJiang Xin2016-03-171-31/+122
| |\ \ \ \ \ \ \ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * 'master' of git://github.com/nafmo/git-l10n-sv: l10n: sv.po: Update Swedish translation (2530t0f0u)
| | * | | | | | | l10n: sv.po: Update Swedish translation (2530t0f0u)Peter Krefting2016-03-151-31/+122
| | |/ / / / / / | | | | | | | | | | | | | | | | | | | | | | | | Signed-off-by: Peter Krefting <peter@softwolves.pp.se>
| * | | | | | | l10n: ru.po: update Russian translationDimitriy Ryazantcev2016-03-151-2/+6
| |/ / / / / / | | | | | | | | | | | | | | | | | | | | | Signed-off-by: Dimitriy Ryazantcev <dimitriy.ryazantcev@gmail.com>
* | | | | | | Merge branch 'master' of git://ozlabs.org/~paulus/gitkJunio C Hamano2016-03-204-804/+788
|\ \ \ \ \ \ \ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * 'master' of git://ozlabs.org/~paulus/gitk: gitk: Follow themed bgcolor in help dialogs gitk: fr.po: Sync translations with git gitk: Update French translation (311t) gitk: Update German translation gitk: Update Bulgarian translation (311t)
| * | | | | | | gitk: Follow themed bgcolor in help dialogsGuillermo S. Romero2016-03-191-4/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Make Help > About & Key bindings dialogs readable if theme has changed font color to something incompatible with white. Signed-off-by: Guillermo S. Romero <gsromero@infernal-iceberg.com> Signed-off-by: Paul Mackerras <paulus@samba.org>
| * | | | | | | gitk: fr.po: Sync translations with gitJean-Noel Avila2016-03-191-50/+46
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Signed-off-by: Jean-Noel Avila <jn.avila@free.fr> Signed-off-by: Paul Mackerras <paulus@samba.org>
| * | | | | | | gitk: Update French translation (311t)Jean-Noel Avila2016-03-191-388/+373
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Signed-off-by: Jean-Noel Avila <jn.avila@free.fr> Signed-off-by: Paul Mackerras <paulus@samba.org>
| * | | | | | | gitk: Update German translationRalf Thielow2016-03-191-46/+33
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Signed-off-by: Ralf Thielow <ralf.thielow@gmail.com> Signed-off-by: Paul Mackerras <paulus@samba.org>