summaryrefslogtreecommitdiff
AgeCommit message (Collapse)AuthorFilesLines
2018-10-30Merge branch 'jc/receive-deny-current-branch-fix'Libravatar Junio C Hamano2-4/+16
The receive.denyCurrentBranch=updateInstead codepath kicked in even when the push should have been rejected due to other reasons, such as it does not fast-forward or the update-hook rejects it, which has been corrected. * jc/receive-deny-current-branch-fix: receive: denyCurrentBranch=updateinstead should not blindly update
2018-10-30Merge branch 'ds/ci-commit-graph-and-midx'Libravatar Junio C Hamano1-0/+2
One of our CI tests to run with "unusual/experimental/random" settings now also uses commit-graph and midx. * ds/ci-commit-graph-and-midx: ci: add optional test variables
2018-10-30Merge branch 'jk/unused-function'Libravatar Junio C Hamano1-1/+0
Developer support. * jk/unused-function: config.mak.dev: enable -Wunused-function
2018-10-30Merge branch 'cb/remove-dead-init'Libravatar Junio C Hamano2-2/+2
Code clean-up. * cb/remove-dead-init: multi-pack-index: avoid dead store for struct progress unpack-trees: avoid dead store for struct progress
2018-10-30Merge branch 'js/diff-notice-has-drive-prefix'Libravatar Junio C Hamano2-2/+12
Under certain circumstances, "git diff D:/a/b/c D:/a/b/d" on Windows would strip initial parts from the paths because they were not recognized as absolute, which has been corrected. * js/diff-notice-has-drive-prefix: diff: don't attempt to strip prefix from absolute Windows paths
2018-10-30Merge branch 'ot/ref-filter-plug-leaks'Libravatar Junio C Hamano2-43/+59
Plugging a handful of memory leaks in the ref-filter codepath. * ot/ref-filter-plug-leaks: ref-filter: free item->value and item->value->s ls-remote: release memory instead of UNLEAK ref-filter: free memory from used_atom
2018-10-30Merge branch 'ds/reachable-first-parent-fix'Libravatar Junio C Hamano1-1/+3
Correct performance regression in commit ancestry computation when generation numbers are involved. * ds/reachable-first-parent-fix: commit-reach: fix first-parent heuristic
2018-10-30Merge branch 'rj/header-guards'Libravatar Junio C Hamano10-20/+20
Code clean-up. * rj/header-guards: headers: normalize the spelling of some header guards
2018-10-30Merge branch 'jk/test-tool-help'Libravatar Junio C Hamano1-2/+13
Developer support. * jk/test-tool-help: test-tool: show tool list on error
2018-10-30Merge branch 'sg/doc-show-branch-typofix'Libravatar Junio C Hamano1-1/+1
Docfix. * sg/doc-show-branch-typofix: doc: fix small typo in git show-branch
2018-10-30Merge branch 'sb/submodule-helper-remove-cruft'Libravatar Junio C Hamano1-2/+0
Code clean-up. * sb/submodule-helper-remove-cruft: builtin/submodule--helper: remove debugging leftover tracing
2018-10-30Merge branch 'js/pack-objects-mutex-init-fix'Libravatar Junio C Hamano4-2/+36
A mutex used in "git pack-objects" were not correctly initialized and this caused "git repack" to dump core on Windows. * js/pack-objects-mutex-init-fix: pack-objects (mingw): initialize `packing_data` mutex in the correct spot pack-objects (mingw): demonstrate a segmentation fault with large deltas pack-objects: fix typo 'detla' -> 'delta'
2018-10-30Merge branch 'tq/branch-style-fix'Libravatar Junio C Hamano1-2/+1
Code clean-up. * tq/branch-style-fix: branch: trivial style fix
2018-10-30Merge branch 'tq/branch-create-wo-branch-get'Libravatar Junio C Hamano1-5/+0
Code clean-up. * tq/branch-create-wo-branch-get: builtin/branch.c: remove useless branch_get
2018-10-30Merge branch 'bc/hash-transition-part-15'Libravatar Junio C Hamano14-156/+181
More codepaths are moving away from hardcoded hash sizes. * bc/hash-transition-part-15: rerere: convert to use the_hash_algo submodule: make zero-oid comparison hash function agnostic apply: rename new_sha1_prefix and old_sha1_prefix apply: replace hard-coded constants tag: express constant in terms of the_hash_algo transport: use parse_oid_hex instead of a constant upload-pack: express constants in terms of the_hash_algo refs/packed-backend: express constants using the_hash_algo packfile: express constants in terms of the_hash_algo pack-revindex: express constants in terms of the_hash_algo builtin/fetch-pack: remove constants with parse_oid_hex builtin/mktree: remove hard-coded constant builtin/repack: replace hard-coded constants pack-bitmap-write: use GIT_MAX_RAWSZ for allocation object_id.cocci: match only expressions of type 'struct object_id'
2018-10-30Merge branch 'sb/strbuf-h-update'Libravatar Junio C Hamano1-67/+81
Code clean-up to serve as a BCP example. * sb/strbuf-h-update: strbuf.h: format according to coding guidelines
2018-10-30Merge branch 'jk/run-command-notdot'Libravatar Junio C Hamano2-5/+29
The implementation of run_command() API on the UNIX platforms had a bug that caused a command not on $PATH to be found in the current directory. * jk/run-command-notdot: run-command: mark path lookup errors with ENOENT
2018-10-30Merge branch 'tb/filter-alternate-refs'Libravatar Junio C Hamano2-2/+2
Test fix. * tb/filter-alternate-refs: t5410: use longer path for sample script Documentation/config.txt: fix typo in core.alternateRefsCommand
2018-10-30Merge branch 'rv/send-email-cc-misc-by'Libravatar Junio C Hamano2-11/+24
"git send-email" learned to grab address-looking string on any trailer whose name ends with "-by"; --suppress-cc=misc-by on the command line, or setting sendemail.suppresscc configuration variable to "misc-by", can be used to disable this behaviour. This is a backward-incompatible change that may surprise existing users. * rv/send-email-cc-misc-by: send-email: also pick up cc addresses from -by trailers send-email: only consider lines containing @ or <> for automatic Cc'ing Documentation/git-send-email.txt: style fixes
2018-10-30Merge branch 'lm/range-diff-submodule-fix'Libravatar Junio C Hamano2-1/+30
"git range-diff" did not work well when the compared ranges had changes in submodules and the "--submodule=log" was used. * lm/range-diff-submodule-fix: range-diff: allow to diff files regardless of submodule config
2018-10-30Merge branch 'ch/subtree-build'Libravatar Junio C Hamano1-0/+4
Build update for "git subtree" (in contrib/) documentation pages. * ch/subtree-build: Revert "subtree: make install targets depend on build targets" subtree: make install targets depend on build targets subtree: add build targets 'man' and 'html'
2018-10-30Merge branch 'md/filter-trees'Libravatar Junio C Hamano13-128/+433
The "rev-list --filter" feature learned to exclude all trees via "tree:0" filter. * md/filter-trees: list-objects: support for skipping tree traversal filter-trees: code clean-up of tests list-objects-filter: implement filter tree:0 list-objects-filter-options: do not over-strbuf_init list-objects-filter: use BUG rather than die revision: mark non-user-given objects instead rev-list: handle missing tree objects properly list-objects: always parse trees gently list-objects: refactor to process_tree_contents list-objects: store common func args in struct
2018-10-26Sixth batch for 2.20Libravatar Junio C Hamano1-0/+48
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2018-10-26Merge branch 'js/mingw-default-ident'Libravatar Junio C Hamano4-7/+62
The logic to select the default user name and e-mail on Windows has been improved. * js/mingw-default-ident: mingw: use domain information for default email getpwuid(mingw): provide a better default for the user name getpwuid(mingw): initialize the structure only once
2018-10-26Merge branch 'ld/p4-unshelve'Libravatar Junio C Hamano3-58/+117
"git p4 unshelve" improvements. * ld/p4-unshelve: git-p4: fully support unshelving changelists git-p4: unshelve into refs/remotes/p4-unshelved, not refs/remotes/p4/unshelved git-p4: do not fail in verbose mode for missing 'fileSize' key
2018-10-26Merge branch 'du/cherry-is-plumbing'Libravatar Junio C Hamano2-12/+1
Doc update to mark "git cherry" as a plumbing command. * du/cherry-is-plumbing: doc: move git-cherry to plumbing
2018-10-26Merge branch 'ab/gc-doc-update'Libravatar Junio C Hamano1-1/+2
The documentation of "git gc" has been updated to mention that it is no longer limited to "pruning away crufts" but also updates ancillary files like commit-graph as a part of repository optimization. * ab/gc-doc-update: gc doc: mention the commit-graph in the intro
2018-10-26Merge branch 'js/fuzzer'Libravatar Junio C Hamano6-19/+101
An experiment to fuzz test a few areas, hopefully we can gain more coverage to various areas. * js/fuzzer: fuzz: add fuzz testing for packfile indices. fuzz: add basic fuzz testing target.
2018-10-26Merge branch 'rv/alias-help'Libravatar Junio C Hamano3-3/+38
"git cmd --help" when "cmd" is aliased used to only say "cmd is aliased to ...". Now it shows that to the standard error stream and runs "git $cmd --help" where $cmd is the first word of the alias expansion. This could be misleading for those who alias a command with options (e.g. with "[alias] cpn = cherry-pick -n", "git cpn --help" would show the manual of "cherry-pick", and the reader would not be told to pay close attention to the part that describes the "--no-commit" option until closing the pager that showed the contents of the manual, if the pager is configured to restore the original screen, or would not be told at all, if the pager simply makes the message on the standard error scroll away. * rv/alias-help: git-help.txt: document "git help cmd" vs "git cmd --help" for aliases git.c: handle_alias: prepend alias info when first argument is -h help: redirect to aliased commands for "git cmd --help"
2018-10-26Merge branch 'sb/diff-emit-line-ws-markup-cleanup'Libravatar Junio C Hamano1-7/+5
Code clean-up. * sb/diff-emit-line-ws-markup-cleanup: diff.c: pass sign_index to emit_line_ws_markup
2018-10-26Merge branch 'du/get-tar-commit-id-is-plumbing'Libravatar Junio C Hamano1-1/+1
Doc update to mark "git get-tar-commit-id" as a plumbing command. * du/get-tar-commit-id-is-plumbing: doc: move git-get-tar-commit-id to plumbing
2018-10-26Merge branch 'mm/doc-no-dashed-git'Libravatar Junio C Hamano2-3/+3
Doc update. * mm/doc-no-dashed-git: doc: fix a typo and clarify a sentence
2018-10-26Merge branch 'du/rev-parse-is-plumbing'Libravatar Junio C Hamano1-1/+1
Doc update. * du/rev-parse-is-plumbing: doc: move git-rev-parse from porcelain to plumbing
2018-10-26Merge branch 'np/log-graph-octopus-fix'Libravatar Junio C Hamano2-15/+145
"git log --graph" showing an octopus merge sometimes miscounted the number of display columns it is consuming to show the merge and its parent commits, which has been corrected. * np/log-graph-octopus-fix: log: fix coloring of certain octopus merge shapes
2018-10-26Merge branch 'sg/split-index-racefix'Libravatar Junio C Hamano5-42/+360
The codepath to support the experimental split-index mode had remaining "racily clean" issues fixed. * sg/split-index-racefix: split-index: BUG() when cache entry refers to non-existing shared entry split-index: smudge and add racily clean cache entries to split index split-index: don't compare cached data of entries already marked for split index split-index: count the number of deleted entries t1700-split-index: date back files to avoid racy situations split-index: add tests to demonstrate the racy split index problem t1700-split-index: document why FSMONITOR is disabled in this test script
2018-10-26Merge branch 'ds/coverage-diff'Libravatar Junio C Hamano1-0/+108
The result of coverage test can be combined with "git blame" to check the test coverage of code introduced recently with a new 'coverage-diff' tool (in contrib/). * ds/coverage-diff: contrib: add coverage-diff script
2018-10-26Merge branch 'bc/editorconfig'Libravatar Junio C Hamano2-0/+18
To help developers, an EditorConfig file that attempts to follow the project convention has been added. * bc/editorconfig: editorconfig: indicate settings should be kept in sync editorconfig: provide editor settings for Git developers
2018-10-26Merge branch 'ma/t7005-bash-workaround'Libravatar Junio C Hamano1-1/+1
Test fix. * ma/t7005-bash-workaround: t7005-editor: quote filename to fix whitespace-issue
2018-10-26Merge branch 'rs/subtree-fixes'Libravatar Junio C Hamano1-46/+83
Various subtree fixes. * rs/subtree-fixes: subtree: performance improvement for finding unexpected parent commits subtree: improve decision on merges kept in split subtree: use commits before rejoins for splits subtree: make --ignore-joins pay attention to adds subtree: refactor split of a commit into standalone method
2018-10-25range-diff: allow to diff files regardless of submodule configLibravatar Lucas De Marchi2-1/+30
If we have `submodule.diff = log' in the configuration file or `--submodule=log' is given as argument, range-diff fails to compare both diffs and we only get the following output: Submodule a 0000000...0000000 (new submodule) Even if the repository doesn't have any submodule. That's because the mode in diff_filespec is not correct and when flushing the diff, down in builtin_diff() we will enter the condition: if (o->submodule_format == DIFF_SUBMODULE_LOG && (!one->mode || S_ISGITLINK(one->mode)) && (!two->mode || S_ISGITLINK(two->mode))) { show_submodule_summary(o, one->path ? one->path : two->path, &one->oid, &two->oid, two->dirty_submodule); return; It turns out that S_ISGITLINK will return true (mode == 0160000 here). Similar thing happens if submodule.diff is "diff". Do like it's done in grep.c when calling fill_filespec() and force it to be recognized as a file by adding S_IFREG to the mode. Signed-off-by: Lucas De Marchi <lucas.demarchi@intel.com> Acked-by: Johannes Schindelin <johannes.schindelin@gmx.de> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2018-10-25t5410: use longer path for sample scriptLibravatar Jeff King1-1/+1
t5410 creates a sample script "alternate-refs", and sets core.alternateRefsCommand to just "alternate-refs". That shouldn't work, as "." is not in our $PATH, and so we should not find it. However, due to a bug in run-command.c, we sometimes find it anyway! Even more confusing, this bug is only in the fork-based version of run-command. So the test passes on Linux (etc), but fails on Windows. In preparation for fixing the run-command bug, let's use a more complete path here. Reported-by: Johannes Schindelin <Johannes.Schindelin@gmx.de> Signed-off-by: Jeff King <peff@peff.net> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2018-10-25t0061: adjust to test-tool transitionLibravatar Junio C Hamano2-5/+29
2018-10-25run-command: mark path lookup errors with ENOENTLibravatar Jeff King2-5/+29
Since commit e3a434468f (run-command: use the async-signal-safe execv instead of execvp, 2017-04-19), prepare_cmd() does its own PATH lookup for any commands we run (on non-Windows platforms). However, its logic does not match the old execvp call when we fail to find a matching entry in the PATH. Instead of feeding the name directly to execv, execvp would consider that an ENOENT error. By continuing and passing the name directly to execv, we effectively behave as if "." was included at the end of the PATH. This can have confusing and even dangerous results. The fix itself is pretty straight-forward. There's a new test in t0061 to cover this explicitly, and I've also added a duplicate of the ENOENT test to ensure that we return the correct errno for this case. Signed-off-by: Jeff King <peff@peff.net> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2018-10-24Documentation/config.txt: fix typo in core.alternateRefsCommandLibravatar Taylor Blau1-1/+1
In [1] Git learned about 'core.alternateRefsCommand', and with it, the accompanying documentation. However, this documentation included a typo involving the verb tense of "produced". Match the tense of the surrounding bits by correcting this typo. [1]: 89284c1d6c (transport.c: introduce core.alternateRefsCommand, 2018-10-08) Signed-off-by: Taylor Blau <me@ttaylorr.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2018-10-22diff: don't attempt to strip prefix from absolute Windows pathsLibravatar Johannes Sixt2-2/+12
git diff can be invoked with absolute paths. Typically, this triggers the --no-index case. Then the absolute paths remain in the file names that are printed in the output. There is one peculiarity, though: When the command is invoked from a a sub-directory in a repository, then it is attempted to strip the sub-directory from the beginning of relative paths. Yet, to detect a relative path the code just checks for an initial forward slash. This mistakes a Windows style path like "D:/base" as a relative path and the output looks like this, for example: D:\dir\test\one>git -P diff --numstat D:\dir\base D:\dir\diff 1 1 ir/{base => diff}/1.txt where the correct output should be D:\dir\test\one>git -P diff --numstat D:\dir\base D:\dir\diff 1 1 D:/dir/{base => diff}/1.txt If the sub-directory where 'git diff' is invoked is sufficiently deep that the prefix becomes longer than the path to be printed, then the subsequent code accesses the path out of bounds. Use is_absolute_path() to detect Windows style absolute paths. One might wonder whether the check for a directory separator that is visible in the patch context should be changed from == '/' to is_dir_sep() or not. It turns out not to be necessary. That code only ever investigates paths that have undergone pathspec normalization, after which there are only forward slashes even on Windows. Signed-off-by: Johannes Sixt <j6t@kdbg.org> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2018-10-19receive: denyCurrentBranch=updateinstead should not blindly updateLibravatar Junio C Hamano2-4/+16
The handling of receive.denyCurrentBranch=updateInstead was added to a switch statement that handles other values of the variable, but all the other case arms only checked a condition to reject the attempted push, or let later logic in the same function to still intervene, so that a push that does not fast-forward (which is checked after the switch statement in question) is still rejected. But the handling of updateInstead incorrectly took immediate effect, without giving other checks a chance to intervene. Instead of calling update_worktree() that causes the side effect immediately, just note the fact that we will need to call the function later, and first give other checks a chance to reject the request. After the update-hook gets a chance to reject the push (which happens as the last step in a series of checks), call update_worktree() when we earlier detected the need to. Reported-by: Rajesh Madamanchi Signed-off-by: Junio C Hamano <gitster@pobox.com>
2018-10-19pack-objects (mingw): initialize `packing_data` mutex in the correct spotLibravatar Johannes Schindelin3-2/+4
In 9ac3f0e5b3e4 (pack-objects: fix performance issues on packing large deltas, 2018-07-22), a mutex was introduced that is used to guard the call to set the delta size. This commit even added code to initialize it, but at an incorrect spot: in `init_threaded_search()`, while the call to `oe_set_delta_size()` (and hence to `packing_data_lock()`) can happen in the call chain `check_object()` <- `get_object_details()` <- `prepare_pack()` <- `cmd_pack_objects()`, which is long before the `prepare_pack()` function calls `ll_find_deltas()` (which initializes the threaded search). Another tell-tale that the mutex was initialized in an incorrect spot is that the function to initialize it lives in builtin/, while the code that uses the mutex is defined in a libgit.a header file. Let's use a more appropriate function: `prepare_packing_data()`, which not only lives in libgit.a, but *has* to be called before the `packing_data` struct is used that contains that mutex. This fixes https://github.com/git-for-windows/git/issues/1839. Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2018-10-19pack-objects (mingw): demonstrate a segmentation fault with large deltasLibravatar Johannes Schindelin1-0/+32
There is a problem in the way 9ac3f0e5b3e4 (pack-objects: fix performance issues on packing large deltas, 2018-07-22) initializes that mutex in the `packing_data` struct. The problem manifests in a segmentation fault on Windows, when a mutex (AKA critical section) is accessed without being initialized. (With pthreads, you apparently do not really have to initialize them?) This was reported in https://github.com/git-for-windows/git/issues/1839. Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2018-10-19pack-objects: fix typo 'detla' -> 'delta'Libravatar Johannes Schindelin1-1/+1
Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2018-10-19Fifth batch for 2.20Libravatar Junio C Hamano1-0/+82
Signed-off-by: Junio C Hamano <gitster@pobox.com>