summaryrefslogtreecommitdiff
AgeCommit message (Collapse)AuthorFilesLines
2018-01-30wildmatch test: use a paranoia pattern from nul_match()Libravatar Ævar Arnfjörð Bjarmason1-3/+12
Use a pattern from the nul_match() function in t7008-grep-binary.sh to make sure that we don't just fall through to the "else" if there's an unknown parameter. This is something I added in commit 77f6f4406f ("grep: add a test helper function for less verbose -f \0 tests", 2017-05-20) to grep tests, which were modeled on these wildmatch tests, and I'm now porting back to the original wildmatch tests. I am not using the "say '...'; exit 1" pattern from t0000-basic.sh because if I fail I want to run the rest of the tests (unless under -i), and doing this makes sure we do that and don't exit right away without fully reporting our errors. Signed-off-by: Ævar Arnfjörð Bjarmason <avarab@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2018-01-30wildmatch test: don't try to vertically align our outputLibravatar Ævar Arnfjörð Bjarmason1-5/+5
Don't try to vertically align the test output, which is futile anyway under the TAP output where we're going to be emitting a number for each test without aligning the test count. This makes subsequent changes of mine where I'm not going to be aligning this output as I add new tests easier. Signed-off-by: Ævar Arnfjörð Bjarmason <avarab@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2018-01-30wildmatch test: use more standard shell styleLibravatar Ævar Arnfjörð Bjarmason1-3/+6
Change the wildmatch test to use more standard shell style, usually we use "if test" not "if [". Signed-off-by: Ævar Arnfjörð Bjarmason <avarab@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2018-01-30wildmatch test: indent with tabs, not spacesLibravatar Ævar Arnfjörð Bjarmason1-27/+27
Replace the 4-width mixed space & tab indentation in this file with indentation with tabs as we do in most of the rest of our tests. Signed-off-by: Ævar Arnfjörð Bjarmason <avarab@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2017-11-06Merge branch 'ex/deprecate-empty-pathspec-as-match-all'Libravatar Junio C Hamano4-14/+9
The final step to make an empty string as a pathspec element illegal. We started this by first deprecating and warning a pathspec that has such an element in 2.11 (Nov 2016). Hopefully we can merge this down to the 'master' by the end of the year? A deprecation warning period that is about 1 year does not sound too bad. * ex/deprecate-empty-pathspec-as-match-all: pathspec: die on empty strings as pathspec t0027: do not use an empty string as a pathspec element
2017-11-06Merge branch 'jk/rebase-i-exec-gitdir-fix'Libravatar Junio C Hamano2-1/+17
A recent regression in "git rebase -i" that broke execution of git commands from subdirectories via "exec" insn has been fixed. * jk/rebase-i-exec-gitdir-fix: sequencer: pass absolute GIT_DIR to exec commands
2017-11-06Merge branch 'cn/diff-indent-no-longer-is-experimental'Libravatar Junio C Hamano4-9/+6
Doc update. * cn/diff-indent-no-longer-is-experimental: diff: --indent-heuristic is no longer experimental
2017-11-06Merge branch 'bw/grep-recurse-submodules'Libravatar Junio C Hamano1-0/+2
A broken access to object databases in recent update to "git grep --recurse-submodules" has been fixed. * bw/grep-recurse-submodules: grep: take the read-lock when adding a submodule
2017-11-06Merge branch 'mh/test-local-canary'Libravatar Junio C Hamano1-0/+25
We try to see if somebody runs our test suite with a shell that does not support "local" like bash/dash does. * mh/test-local-canary: t0000: check whether the shell supports the "local" keyword
2017-11-06Merge branch 'js/submodule-in-excluded'Libravatar Junio C Hamano2-1/+12
"git status --ignored -u" did not stop at a working tree of a separate project that is embedded in an ignored directory and listed files in that other project, instead of just showing the directory itself as ignored. * js/submodule-in-excluded: status: do not get confused by submodules in excluded directories
2017-11-06Merge branch 'ao/check-resolve-ref-unsafe-result'Libravatar Junio C Hamano1-0/+2
"git commit", after making a commit, did not check for errors when asking on what branch it made the commit, which has been correted. * ao/check-resolve-ref-unsafe-result: commit: check result of resolve_ref_unsafe
2017-11-06Merge branch 'jk/misc-resolve-ref-unsafe-fixes'Libravatar Junio C Hamano4-4/+5
Some codepaths did not check for errors when asking what branch the HEAD points at, which have been fixed. * jk/misc-resolve-ref-unsafe-fixes: worktree: handle broken symrefs in find_shared_symref() log: handle broken HEAD in decoration check remote: handle broken symrefs test-ref-store: avoid passing NULL to printf
2017-11-06Merge branch 'sb/diff-color-moved-use-xdl-recmatch'Libravatar Junio C Hamano3-78/+32
Instead of using custom line comparison and hashing functions to implement "moved lines" coloring in the diff output, use the pair of these functions from lower-layer xdiff/ code. * sb/diff-color-moved-use-xdl-recmatch: diff.c: get rid of duplicate implementation xdiff-interface: export comparing and hashing strings
2017-11-06Merge branch 'jk/diff-color-moved-fix'Libravatar Junio C Hamano2-42/+188
The experimental "color moved lines differently in diff output" feature was buggy around "ignore whitespace changes" edges, whihch has been corrected. * jk/diff-color-moved-fix: diff: handle NULs in get_string_hash() diff: fix whitespace-skipping with --color-moved t4015: test the output of "diff --color-moved -b" t4015: check "negative" case for "-w --color-moved" t4015: refactor --color-moved whitespace test
2017-11-06Merge branch 'kd/auto-col-with-pager-fix'Libravatar Junio C Hamano2-1/+15
"auto" as a value for the columnar output configuration ought to judge "is the output consumed by humans?" with the same criteria as "auto" for coloured output configuration, i.e. either the standard output stream is going to tty, or a pager is in use. We forgot the latter, which has been fixed. * kd/auto-col-with-pager-fix: column: do not include pager.c column: show auto columns when pager is active
2017-11-06Merge branch 'jc/no-cmd-as-subroutine'Libravatar Junio C Hamano2-13/+18
Calling cmd_foo() as if it is a general purpose helper function is a no-no. Correct two instances of such to set an example. * jc/no-cmd-as-subroutine: merge-ours: do not use cmd_*() as a subroutine describe: do not use cmd_*() as a subroutine
2017-11-06Merge branch 'ma/lockfile-fixes'Libravatar Junio C Hamano21-131/+123
An earlier update made it possible to use an on-stack in-core lockfile structure (as opposed to having to deliberately leak an on-heap one). Many codepaths have been updated to take advantage of this new facility. * ma/lockfile-fixes: read_cache: roll back lock in `update_index_if_able()` read-cache: leave lock in right state in `write_locked_index()` read-cache: drop explicit `CLOSE_LOCK`-flag cache.h: document `write_locked_index()` apply: remove `newfd` from `struct apply_state` apply: move lockfile into `apply_state` cache-tree: simplify locking logic checkout-index: simplify locking logic tempfile: fix documentation on `delete_tempfile()` lockfile: fix documentation on `close_lock_file_gently()` treewide: prefer lockfiles on the stack sha1_file: do not leak `lock_file`
2017-11-02diff: --indent-heuristic is no longer experimentalLibravatar Carlos Martín Nieto4-9/+6
This heuristic has been the default since 2.14 so we should not confuse our users by saying that it's experimental and off by default. Signed-off-by: Carlos Martín Nieto <cmn@dwim.me> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2017-11-02grep: take the read-lock when adding a submoduleLibravatar Martin Ågren1-0/+2
With --recurse-submodules, we add each submodule that we encounter to the list of alternate object databases. With threading, our changes to the list are not protected against races. Indeed, ThreadSanitizer reports a race when we call `add_to_alternates_memory()` around the same time that another thread is reading in the list through `read_sha1_file()`. Take the grep read-lock while adding the submodule. The lock is used to serialize uses of non-thread-safe parts of Git's API, including `read_sha1_file()`. Helped-by: Brandon Williams <bmwill@google.com> Signed-off-by: Martin Ågren <martin.agren@gmail.com> Acked-by: Brandon Williams <bmwill@google.com> Reviewed-by: Jeff King <peff@peff.net> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2017-11-02sequencer: pass absolute GIT_DIR to exec commandsLibravatar Jacob Keller2-1/+17
When we replaced the old shell script based interactive rebase in commmit 18633e1a22a6 ("rebase -i: use the rebase--helper builtin", 2017-02-09) we introduced a regression of functionality in that the GIT_DIR would be sent to the environment of the exec command as-is. This generally meant that it would be passed as "GIT_DIR=.git", which causes problems for any exec command that wants to run git commands in a subdirectory. This isn't a very large regression, since it is not that likely that the exec command will run a git command, and even less likely that it will need to do so in a subdir. This regression was discovered by a build system which uses git-describe to find the current version of the build system, and happened to do so from the src/ sub directory of the project. Fix this by passing in the absolute path of the git directory into the child environment. Signed-off-by: Jacob Keller <jacob.keller@gmail.com> Acked-by: Johannes Schindelin <Johannes.Schindelin@gmx.de> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2017-10-31t0000: check whether the shell supports the "local" keywordLibravatar Michael Haggerty1-0/+25
Add a test balloon to see if we get complaints from anybody who is using a shell that doesn't support the "local" keyword. If so, this test can be reverted. If not, we might want to consider using "local" in shell code throughout the git code base. Signed-off-by: Michael Haggerty <mhagger@alum.mit.edu> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2017-10-30Git 2.15Libravatar Junio C Hamano1-1/+1
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2017-10-30Merge tag 'l10n-2.15.0-rnd2.1' of git://github.com/git-l10n/git-poLibravatar Junio C Hamano1-58/+123
l10n for Git 2.15.0 round 2 with Catalan updates * tag 'l10n-2.15.0-rnd2.1' of git://github.com/git-l10n/git-po: l10n: Update Catalan translation
2017-10-29l10n: Update Catalan translationLibravatar Jordi Mas1-58/+123
Signed-off-by: Jordi Mas <jmas@softcatala.org>
2017-10-28Hopefully final batch before 2.15Libravatar Junio C Hamano1-0/+7
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2017-10-28Merge branch 'sg/rev-list-doc-reorder-fix'Libravatar Junio C Hamano1-3/+3
Doc flow fix. * sg/rev-list-doc-reorder-fix: rev-list-options.txt: use correct directional reference
2017-10-28Merge branch 'sb/rev-parse-show-superproject-root'Libravatar Junio C Hamano1-1/+1
Doc markup fix. * sb/rev-parse-show-superproject-root: docs: fix formatting of rev-parse's --show-superproject-working-tree
2017-10-28Merge branch 'ao/path-use-xmalloc'Libravatar Junio C Hamano1-1/+1
A possible oom error is now caught as a fatal error, instead of continuing and dereferencing NULL. * ao/path-use-xmalloc: path.c: use xmalloc() in add_to_trie()
2017-10-28Merge branch 'np/config-path-doc'Libravatar Junio C Hamano1-4/+4
Doc update. * np/config-path-doc: config doc: clarify "git config --path" example
2017-10-27docs: fix formatting of rev-parse's --show-superproject-working-treeLibravatar Sebastian Schuberth1-1/+1
Signed-off-by: Sebastian Schuberth <sschuberth@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2017-10-27rev-list-options.txt: use correct directional referenceLibravatar SZEDER Gábor1-3/+3
The descriptions of the options '--parents', '--children' and '--graph' say "see 'History Simplification' below", although the referred section is in fact above the description of these options. Send readers in the right direction by saying "above" instead of "below". Signed-off-by: SZEDER Gábor <szeder.dev@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2017-10-26Merge branch 'mh/ref-locking-fix'Libravatar Junio C Hamano2-1/+142
Transactions to update multiple references that involves a deletion was quite broken in an error codepath and did not abort everything correctly. * mh/ref-locking-fix: files_transaction_prepare(): fix handling of ref lock failure t1404: add a bunch of tests of D/F conflicts
2017-10-26status: do not get confused by submodules in excluded directoriesLibravatar Johannes Schindelin2-1/+12
We meticulously pass the `exclude` flag to the `treat_directory()` function so that we can indicate that files in it are excluded rather than untracked when recursing. But we did not yet treat submodules the same way. Because of that, `git status --ignored --untracked` with a submodule `submodule` in a gitignored `tracked/` would show the submodule in the "Untracked files" section, e.g. On branch master Untracked files: (use "git add <file>..." to include in what will be committed) tracked/submodule/ Ignored files: (use "git add -f <file>..." to include in what will be committed) tracked/submodule/initial.t Instead, we would want it to show the submodule in the "Ignored files" section: On branch master Ignored files: (use "git add -f <file>..." to include in what will be committed) tracked/submodule/ Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2017-10-26diff.c: get rid of duplicate implementationLibravatar Stefan Beller1-78/+4
The implementations in diff.c to detect moved lines needs to compare strings and hash strings, which is implemented in that file, as well as in the xdiff library. Remove the rather recent implementation in diff.c and rely on the well exercised code in the xdiff lib. With this change the hash used for bucketing the strings for the moved line detection changes from FNV32 (that is provided via the hashmaps memhash) to DJB2 (which is used internally in xdiff). Benchmarks found on the web[1] do not indicate that these hashes are different in performance for readable strings. [1] https://softwareengineering.stackexchange.com/questions/49550/which-hashing-algorithm-is-best-for-uniqueness-and-speed Signed-off-by: Stefan Beller <sbeller@google.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2017-10-26xdiff-interface: export comparing and hashing stringsLibravatar Stefan Beller2-0/+28
This will turn out to be useful in a later patch. xdl_recmatch is exported in xdiff/xutils.h, to be used by various xdiff/*.c files, but not outside of xdiff/. This one makes it available to the outside, too. While at it, add documentation. Signed-off-by: Stefan Beller <sbeller@google.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2017-10-25path.c: use xmalloc() in add_to_trie()Libravatar Andrey Okoshkin1-1/+1
Add usage of xmalloc() instead of malloc() in add_to_trie() as xmalloc wraps and checks memory allocation result. Signed-off-by: Andrey Okoshkin <a.okoshkin@samsung.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2017-10-25files_transaction_prepare(): fix handling of ref lock failureLibravatar Michael Haggerty2-9/+9
Since dc39e09942 (files_ref_store: use a transaction to update packed refs, 2017-09-08), failure to lock a reference has been handled incorrectly by `files_transaction_prepare()`. If `lock_ref_for_update()` fails in the lock-acquisition loop of that function, it sets `ret` then breaks out of that loop. Prior to dc39e09942, that was OK, because the only thing following the loop was the cleanup code. But dc39e09942 added another blurb of code between the loop and the cleanup. That blurb sometimes resets `ret` to zero, making the cleanup code think that the locking was successful. Specifically, whenever * One or more reference deletions have been processed successfully in the lock-acquisition loop. (Processing the first such reference causes a packed-ref transaction to be initialized.) * Then `lock_ref_for_update()` fails for a subsequent reference. Such a failure can happen for a number of reasons, such as the old SHA-1 not being correct, lock contention, etc. This causes a `break` out of the lock-acquisition loop. * The `packed-refs` lock is acquired successfully and `ref_transaction_prepare()` succeeds for the packed-ref transaction. This has the effect of resetting `ret` back to 0, and making the cleanup code think that lock acquisition was successful. In that case, any reference updates that were processed prior to breaking out of the loop would be carried out (loose and packed), but the reference that couldn't be locked and any subsequent references would silently be ignored. This can easily cause data loss if, for example, the user was trying to push a new name for an existing branch while deleting the old name. After the push, the branch could be left unreachable, and could even subsequently be garbage-collected. This problem was noticed in the context of deleting one reference and creating another in a single transaction, when the two references D/F conflict with each other, like git update-ref --stdin <<EOF delete refs/foo create refs/foo/bar HEAD EOF This triggers the above bug because the deletion is processed successfully for `refs/foo`, then the D/F conflict causes `lock_ref_for_update()` to fail when `refs/foo/bar` is processed. In this case the transaction *should* fail, but instead it causes `refs/foo` to be deleted without creating `refs/foo`. This could easily result in data loss. The fix is simple: instead of just breaking out of the loop, jump directly to the cleanup code. This fixes some tests in t1404 that were added in the previous commit. Signed-off-by: Michael Haggerty <mhagger@alum.mit.edu> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2017-10-25t1404: add a bunch of tests of D/F conflictsLibravatar Michael Haggerty1-0/+141
It is currently not allowed, in a single transaction, to add one reference and delete another reference if the two reference names D/F conflict with each other (e.g., like `refs/foo/bar` and `refs/foo`). The reason is that the code would need to take locks $GIT_DIR/refs/foo.lock $GIT_DIR/refs/foo/bar.lock But the latter lock couldn't coexist with the loose reference file $GIT_DIR/refs/foo , because `$GIT_DIR/refs/foo` cannot be both a directory and a file at the same time (hence the name "D/F conflict). Add a bunch of tests that we cleanly reject such transactions. In fact, many of the new tests currently fail. They will be fixed in the next commit along with an explanation. Reported-by: Jeff King <peff@peff.net> Signed-off-by: Michael Haggerty <mhagger@alum.mit.edu> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2017-10-24Merge tag 'l10n-2.15.0-rnd2' of git://github.com/git-l10n/git-poLibravatar Junio C Hamano12-24768/+42782
l10n for Git 2.15.0 round 2 * tag 'l10n-2.15.0-rnd2' of git://github.com/git-l10n/git-po: (22 commits) l10n: zh_CN: review for git v2.15.0 l10n round 2 l10n: zh_CN: for git v2.15.0 l10n round 2 l10n: de.po: fix typos l10n: de.po: translate 70 new messages l10n: ru.po: update Russian translation l10n: vi.po(3245t): Updated Vietnamese translation for v2.15.0 round 2 l10n: sv.po: Update Swedish translation (3245t0f0u) l10n: fr.po: v2.15.0 round 2 l10n: fr.po change translation of "First, rewinding" l10n: fr.po fix some mistakes l10n: Update Catalan translation l10n: ko.po: Update Korean translation l10n: es.po: v2.15.0 round 2 l10n: git.pot: v2.15.0 round 2 (2 new, 2 removed) l10n: ru.po: update Russian translation l10n: bg.po: Updated Bulgarian translation (3245t) l10n: sv.po: Update Swedish translation (3245t0f0u) l10n: vi.po(3245t): Updated Vietnamese translation for v2.15.0 l10n: es.po: Update translation v2.15.0 round 1 l10n: git.pot: v2.15.0 round 1 (68 new, 36 removed) ...
2017-10-24Merge branch 'jx/zh_CN-proposed' of github.com:jiangxin/gitLibravatar Jiang Xin1-2414/+2557
* 'jx/zh_CN-proposed' of github.com:jiangxin/git: l10n: zh_CN: review for git v2.15.0 l10n round 2 l10n: zh_CN: for git v2.15.0 l10n round 2
2017-10-24l10n: zh_CN: review for git v2.15.0 l10n round 2Libravatar Ray Chen1-2/+2
Signed-off-by: Ray Chen <oldsharp@gmail.com>
2017-10-24l10n: zh_CN: for git v2.15.0 l10n round 2Libravatar Jiang Xin1-2414/+2557
Translate 69 messages (3245t0f0u) for git v2.15.0-rc2. Signed-off-by: Jiang Xin <worldhello.net@gmail.com> Reviewed-by: 依云 <lilydjwg@gmail.com>
2017-10-24Merge branch 'master' of https://github.com/ralfth/git-po-deLibravatar Jiang Xin1-2448/+2630
* 'master' of https://github.com/ralfth/git-po-de: l10n: de.po: fix typos l10n: de.po: translate 70 new messages
2017-10-24column: do not include pager.cLibravatar Junio C Hamano1-1/+0
Everything this file needs from the pager API (e.g. term_columns(), pager_in_use()) is already declared in the header file it includes. Noticed-by: Jonathan Nieder <jrnieder@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2017-10-23l10n: de.po: fix typosLibravatar Andre Hinrichs1-14/+14
Signed-off-by: Andre Hinrichs <andre.hinrichs@gmx.de> Signed-off-by: Ralf Thielow <ralf.thielow@gmail.com>
2017-10-23l10n: de.po: translate 70 new messagesLibravatar Ralf Thielow1-2435/+2617
Translate 70 new messages came from git.pot update in 25eab542b (l10n: git.pot: v2.15.0 round 1 (68 new, 36 removed)) and 9c07fab78 (l10n: git.pot: v2.15.0 round 2 (2 new, 2 removed)). Signed-off-by: Ralf Thielow <ralf.thielow@gmail.com>
2017-10-23Sync with 2.14.3Libravatar Junio C Hamano1-0/+24
2017-10-23Git 2.14.3Libravatar Junio C Hamano2-1/+25
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2017-10-23Merge branch 'jk/info-alternates-fix' into maintLibravatar Junio C Hamano1-20/+11
A regression fix for 2.11 that made the code to read the list of alternate object stores overrun the end of the string. * jk/info-alternates-fix: read_info_alternates: warn on non-trivial errors read_info_alternates: read contents into strbuf
2017-10-23Merge branch 'jc/fetch-refspec-doc-update' into maintLibravatar Junio C Hamano1-2/+4
"git fetch <there> <src>:<dst>" allows an object name on the <src> side when the other side accepts such a request since Git v2.5, but the documentation was left stale. * jc/fetch-refspec-doc-update: fetch doc: src side of refspec could be full SHA-1