sort by:
Revision Author Date Message Commit Date
fd3ab91 Merge branch 'jk/execv-dashed-external' into maint Fix for NO_PTHREADS build. * jk/execv-dashed-external: run-command: fix segfault when cleaning forked async process 28 March 2017, 20:52:23 UTC
c953cf9 Merge branch 'ew/http-alternates-as-redirects-warning' into maint Recent versions of Git treats http alternates (used in dumb http transport) just like HTTP redirects and requires the client to enable following it, due to security concerns. But we forgot to give a warning when we decide not to honor the alternates. * ew/http-alternates-as-redirects-warning: http: release strbuf on disabled alternates http: inform about alternates-as-redirects behavior 28 March 2017, 20:52:23 UTC
bfee58c Merge branch 'dp/filter-branch-prune-empty' into maint "git filter-branch --prune-empty" drops a single-parent commit that becomes a no-op, but did not drop a root commit whose tree is empty. * dp/filter-branch-prune-empty: p7000: add test for filter-branch with --prune-empty filter-branch: fix --prune-empty on parentless commits t7003: ensure --prune-empty removes entire branch when applicable t7003: ensure --prune-empty can prune root commit 28 March 2017, 20:52:22 UTC
2b69d31 Merge branch 'mm/fetch-show-error-message-on-unadvertised-object' into maint "git fetch" that requests a commit by object name, when the other side does not allow such an request, failed without much explanation. * mm/fetch-show-error-message-on-unadvertised-object: fetch-pack: add specific error for fetching an unadvertised object fetch_refs_via_pack: call report_unmatched_refs fetch-pack: move code to report unmatched refs to a function 28 March 2017, 20:52:22 UTC
41534b6 Merge branch 'jk/interpret-branch-name' into maint "git branch @" created refs/heads/@ as a branch, and in general the code that handled @{-1} and @{upstream} was a bit too loose in disambiguating. * jk/interpret-branch-name: checkout: restrict @-expansions when finding branch strbuf_check_ref_format(): expand only local branches branch: restrict @-expansions when deleting t3204: test git-branch @-expansion corner cases interpret_branch_name: allow callers to restrict expansions strbuf_branchname: add docstring strbuf_branchname: drop return value interpret_branch_name: move docstring to header file interpret_branch_name(): handle auto-namelen for @{-1} 28 March 2017, 20:52:22 UTC
e25c122 Merge branch 'ab/cond-skip-tests' into maint A few tests were run conditionally under (rare) conditions where they cannot be run (like running cvs tests under 'root' account). * ab/cond-skip-tests: gitweb tests: skip tests when we don't have Time::HiRes gitweb tests: change confusing "skip_all" phrasing cvs tests: skip tests that call "cvs commit" when running as root 28 March 2017, 20:52:21 UTC
bb622de Merge branch 'jk/ident-empty' into maint user.email that consists of only cruft chars should consistently error out, but didn't. * jk/ident-empty: ident: do not ignore empty config name/email ident: reject all-crud ident name ident: handle NULL email when complaining of empty name ident: mark error messages for translation 28 March 2017, 20:52:21 UTC
252ef8f Merge branch 'jk/delta-chain-limit' into maint "git repack --depth=<n>" for a long time busted the specified depth when reusing delta from existing packs. This has been corrected. * jk/delta-chain-limit: pack-objects: convert recursion to iteration in break_delta_chain() pack-objects: enforce --depth limit in reused deltas 28 March 2017, 20:52:21 UTC
9304052 Merge branch 'sg/test-with-stdin' into maint Teach the "debug" helper used in the test framework that allows a command to run under "gdb" to make the session interactive. * sg/test-with-stdin: tests: make the 'test_pause' helper work in non-verbose mode tests: create an interactive gdb session with the 'debug' helper 28 March 2017, 20:52:20 UTC
c34aa34 Merge branch 'jk/interop-test' into maint Picking two versions of Git and running tests to make sure the older one and the newer one interoperate happily has now become possible. * jk/interop-test: t/interop: add test of old clients against modern git-daemon t: add an interoperability test harness 28 March 2017, 20:52:20 UTC
e0c74e6 Merge branch 'jt/perf-updates' into maint The t/perf performance test suite was not prepared to test not so old versions of Git, but now it covers versions of Git that are not so ancient. * jt/perf-updates: t/perf: add fallback for pre-bin-wrappers versions of git t/perf: use $MODERN_GIT for all repo-copying steps t/perf: export variable used in other blocks 28 March 2017, 20:52:19 UTC
cd27bc7 Merge branch 'rs/strbuf-add-real-path' into maint An helper function to make it easier to append the result from real_path() to a strbuf has been added. * rs/strbuf-add-real-path: strbuf: add strbuf_add_real_path() cocci: use ALLOC_ARRAY 28 March 2017, 20:52:19 UTC
c772d1b Merge branch 'jk/parse-config-key-cleanup' into maint The "parse_config_key()" API function has been cleaned up. * jk/parse-config-key-cleanup: parse_hide_refs_config: tell parse_config_key we don't want a subsection parse_config_key: allow matching single-level config parse_config_key: use skip_prefix instead of starts_with refs: parse_hide_refs_config to use parse_config_key 28 March 2017, 20:52:19 UTC
8f9aeb0 Git 2.12.2 Signed-off-by: Junio C Hamano <gitster@pobox.com> 24 March 2017, 19:59:15 UTC
75d4476 Merge branch 'ab/doc-no-option-notation-fix' into maint Doc fix. * ab/doc-no-option-notation-fix: doc: change erroneous --[no]-whatever into --[no-]whatever 24 March 2017, 19:57:55 UTC
ce9e617 Merge branch 'ab/push-default-doc-fix' into maint Doc fix. * ab/push-default-doc-fix: push: mention "push.default=tracking" in the documentation 24 March 2017, 19:57:54 UTC
7bd881f Merge branch 'nd/commit-hook-doc-fix' into maint Doc fix. * nd/commit-hook-doc-fix: git-commit.txt: list post-rewrite in HOOKS section 24 March 2017, 19:57:54 UTC
eb4e87c Merge branch 'jc/config-case-cmdline-take-2' into maint The code to parse "git -c VAR=VAL cmd" and set configuration variable for the duration of cmd had two small bugs, which have been fixed. This supersedes jc/config-case-cmdline topic that has been discarded. * jc/config-case-cmdline-take-2: config: use git_config_parse_key() in git_config_parse_parameter() config: move a few helper functions up 24 March 2017, 19:57:54 UTC
ea7aa5a Merge branch 'jk/grep-no-index-fix' into maint The code to parse the command line "git grep <patterns>... <rev> [[--] <pathspec>...]" has been cleaned up, and a handful of bugs have been fixed (e.g. we used to check "--" if it is a rev). * jk/grep-no-index-fix: grep: treat revs the same for --untracked as for --no-index grep: do not diagnose misspelt revs with --no-index grep: avoid resolving revision names in --no-index case grep: fix "--" rev/pathspec disambiguation grep: re-order rev-parsing loop grep: do not unnecessarily query repo for "--" grep: move thread initialization a little lower 24 March 2017, 19:57:53 UTC
411a179 Merge branch 'jn/remote-helpers-with-git-dir' into maint "git ls-remote" and "git archive --remote" are designed to work without being in a directory under Git's control. However, recent updates revealed that we randomly look into a directory called .git/ without actually doing necessary set-up when working in a repository. Stop doing so. * jn/remote-helpers-with-git-dir: remote helpers: avoid blind fall-back to ".git" when setting GIT_DIR remote: avoid reading $GIT_DIR config in non-repo 24 March 2017, 19:57:53 UTC
f3d5bbb Merge branch 'sb/submodule-config-parse-ignore-fix' into maint Code to read submodule.<name>.ignore config did not state the variable name correctly when giving an error message diagnosing misconfiguration. * sb/submodule-config-parse-ignore-fix: submodule-config: correct error reporting for invalid ignore value 24 March 2017, 19:57:52 UTC
f4d3af1 Merge branch 'jk/push-deadlock-regression-fix' into maint "git push" had a handful of codepaths that could lead to a deadlock when unexpected error happened, which has been fixed. * jk/push-deadlock-regression-fix: send-pack: report signal death of pack-objects send-pack: read "unpack" status even on pack-objects failure send-pack: improve unpack-status error messages send-pack: use skip_prefix for parsing unpack status send-pack: extract parsing of "unpack" response receive-pack: fix deadlock when we cannot create tmpdir 24 March 2017, 19:57:52 UTC
296ab78 mailmap: use Michael J Gruber's new address Map both old addresses to the new, hopefully more permanent one. Signed-off-by: Michael J Gruber <git@drmicha.warpmail.net> Signed-off-by: Michael J Gruber <git@grubix.eu> Signed-off-by: Junio C Hamano <gitster@pobox.com> 24 March 2017, 19:30:27 UTC
8624735 Prepare for 2.12.2 Signed-off-by: Junio C Hamano <gitster@pobox.com> 21 March 2017, 22:04:12 UTC
71da2fb Merge branch 'jh/send-email-one-cc' into maint "Cc:" on the trailer part does not have to conform to RFC strictly, unlike in the e-mail header. "git send-email" has been updated to ignore anything after '>' when picking addresses, to allow non-address cruft like " # stable 4.4" after the address. * jh/send-email-one-cc: send-email: only allow one address per body tag 21 March 2017, 22:03:30 UTC
7e02ec2 Merge branch 'jk/t6300-cleanup' into maint A test that creates a confusing branch whose name is HEAD has been corrected not to do so. * jk/t6300-cleanup: t6300: avoid creating refs/heads/HEAD 21 March 2017, 22:03:30 UTC
d6bc22e Merge branch 'rs/commit-parsing-optim' into maint The code that parses header fields in the commit object has been updated for (micro)performance and code hygiene. * rs/commit-parsing-optim: commit: don't check for space twice when looking for header commit: be more precise when searching for headers 21 March 2017, 22:03:29 UTC
93abd17 Merge branch 'jk/show-branch-lift-name-len-limit' into maint "git show-branch" expected there were only very short branch names in the repository and used a fixed-length buffer to hold them without checking for overflow. * jk/show-branch-lift-name-len-limit: show-branch: use skip_prefix to drop magic numbers show-branch: store resolved head in heap buffer show-branch: drop head_len variable 21 March 2017, 22:03:29 UTC
f63df94 Merge branch 'jk/tempfile-ferror-fclose-confusion' into maint A caller of tempfile API that uses stdio interface to write to files may ignore errors while writing, which is detected when tempfile is closed (with a call to ferror()). By that time, the original errno that may have told us what went wrong is likely to be long gone and was overwritten by an irrelevant value. close_tempfile() now resets errno to EIO to make errno at least predictable. * jk/tempfile-ferror-fclose-confusion: tempfile: set errno to a known value before calling ferror() 21 March 2017, 22:03:28 UTC
0d9f942 Merge branch 'rl/remote-allow-missing-branch-name-merge' into maint "git remote rm X", when a branch has remote X configured as the value of its branch.*.remote, tried to remove branch.*.remote and branch.*.merge and failed if either is unset. * rl/remote-allow-missing-branch-name-merge: remote: ignore failure to remove missing branch.<name>.merge 21 March 2017, 22:03:28 UTC
d30ec1b Merge branch 'dt/gc-ignore-old-gc-logs' into maint A "gc.log" file left by a backgrounded "gc --auto" disables further automatic gc; it has been taught to run at least once a day (by default) by ignoring a stale "gc.log" file that is too old. * dt/gc-ignore-old-gc-logs: gc: ignore old gc.log files 21 March 2017, 22:03:28 UTC
f4470f2 Merge branch 'jt/upload-pack-error-report' into maint "git upload-pack", which is a counter-part of "git fetch", did not report a request for a ref that was not advertised as invalid. This is generally not a problem (because "git fetch" will stop before making such a request), but is the right thing to do. * jt/upload-pack-error-report: upload-pack: report "not our ref" to client 21 March 2017, 22:03:27 UTC
e36e28e Merge branch 'rs/sha1-file-plug-fallback-base-leak' into maint A leak in a codepath to read from a packed object in (rare) cases has been plugged. * rs/sha1-file-plug-fallback-base-leak: sha1_file: release fallback base's memory in unpack_entry() 21 March 2017, 22:03:27 UTC
d46d432 Merge branch 'ss/remote-bzr-hg-placeholder-wo-python' into maint There is no need for Python only to give a few messages to the standard error stream, but we somehow did. * ss/remote-bzr-hg-placeholder-wo-python: contrib: git-remote-{bzr,hg} placeholders don't need Python 21 March 2017, 22:03:27 UTC
cc8e385 Merge branch 'jc/diff-populate-filespec-size-only-fix' into maint "git diff --quiet" relies on the size field in diff_filespec to be correctly populated, but diff_populate_filespec() helper function made an incorrect short-cut when asked only to populate the size field for paths that need to go through convert_to_git() (e.g. CRLF conversion). * jc/diff-populate-filespec-size-only-fix: diff: do not short-cut CHECK_SIZE_ONLY check in diff_populate_filespec() 21 March 2017, 22:03:26 UTC
36238fc Merge branch 'jk/http-walker-buffer-underflow-fix' into maint "Dumb http" transport used to misparse a nonsense http-alternates response, which has been fixed. * jk/http-walker-buffer-underflow-fix: http-walker: fix buffer underflow processing remote alternates 21 March 2017, 22:03:25 UTC
1a61be2 Merge branch 'mg/status-porcelain-no-i18n' into maint "git status --porcelain" is supposed to give a stable output, but a few strings were left as translatable by mistake. * mg/status-porcelain-no-i18n: git-status: make porcelain more robust 21 March 2017, 22:03:25 UTC
5c6bc96 Merge branch 'ps/docs-diffcore' into maint Doc update. * ps/docs-diffcore: docs/diffcore: unquote "Complete Rewrites" in headers docs/diffcore: fix grammar in diffcore-rename header 21 March 2017, 22:03:25 UTC
c157ae9 Merge branch 'ew/markdown-url-in-readme' into maint Doc update. * ew/markdown-url-in-readme: README: create HTTP/HTTPS links from URLs in Markdown 21 March 2017, 22:03:24 UTC
f56a439 Merge branch 'rj/remove-unused-mktemp' into maint Code cleanup. * rj/remove-unused-mktemp: wrapper.c: remove unused gitmkstemps() function wrapper.c: remove unused git_mkstemp() function 21 March 2017, 22:03:24 UTC
06c0ed7 Merge branch 'jk/ewah-use-right-type-in-sizeof' into maint Code clean-up. * jk/ewah-use-right-type-in-sizeof: ewah: fix eword_t/uint64_t confusion 21 March 2017, 22:03:24 UTC
1f6b1af Git 2.12.1 Signed-off-by: Junio C Hamano <gitster@pobox.com> 20 March 2017, 20:17:08 UTC
e4e016f push: mention "push.default=tracking" in the documentation Change the documentation for push.tracking=* to re-include a mention of what "tracking" does. The "tracking" option was renamed to "upstream" back in 53c4031 ("push.default: Rename 'tracking' to 'upstream'", 2011-02-16), this section was then subsequently rewritten in 87a70e4 ("config doc: rewrite push.default section", 2013-06-19) to remove any mention of "tracking". Maybe we should just warn or die nowadays if this option is in the config, but I had some old config of mine use this option, I'd forgotten that it was a synonym, and nothing in git's documentation mentioned that. That's bad, either we shouldn't support it at all, or we should document what it does. This patch does the latter. Signed-off-by: Ævar Arnfjörð Bjarmason <avarab@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com> 20 March 2017, 17:59:43 UTC
baced9e git-commit.txt: list post-rewrite in HOOKS section The hook was added in a86ed83cce (Merge branch 'tr/notes-display' - 2010-03-24), which updated githooks.txt but not git-commit.txt. git-commit.txt was later updated in e858af6d50 (commit: document a couple of options - 2012-06-08). Since this commit focused on command line options, this section was probably forgotten. Signed-off-by: Nguyễn Thái Ngọc Duy <pclouds@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com> 20 March 2017, 17:53:29 UTC
2c7ee98 doc: change erroneous --[no]-whatever into --[no-]whatever Change these two obvious typos to be in line with the rest of the documentation, which uses the correct --[no-]whatever form. Signed-off-by: Ævar Arnfjörð Bjarmason <avarab@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com> 20 March 2017, 17:04:57 UTC
7b91929 run-command: fix segfault when cleaning forked async process Callers of the run-command API may mark a child as "clean_on_exit"; it gets added to a list and killed when the main process dies. Since commit 46df6906f (execv_dashed_external: wait for child on signal death, 2017-01-06), we respect an extra "wait_after_clean" flag, which we expect to find in the child_process struct. When Git is built with NO_PTHREADS, we start "struct async" processes by forking rather than spawning a thread. The resulting processes get added to the cleanup list but they don't have a child_process struct, and the cleanup function ends up dereferencing NULL. We should notice this case and assume that the processes do not need to be waited for (i.e., the same behavior they had before 46df6906f). Reported-by: Brandon Williams <bmwill@google.com> Signed-off-by: Jeff King <peff@peff.net> Reviewed-by: Jonathan Nieder <jrnieder@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com> 18 March 2017, 17:29:15 UTC
59210dd tests: make the 'test_pause' helper work in non-verbose mode When the 'test_pause' helper function invokes the shell mid-test, it explicitly redirects the shell's stdout and stderr to file descriptors 3 and 4, which are the stdout and stderr of the tests (i.e. where they would be connected anyway without those redirections). These file descriptors are only attached to the terminal in verbose mode, hence the restriction of 'test_pause' to work only with '-v'. Redirect the shell's stdout and stderr to the test environment's original stdout and stderr, allowing it to work properly even in non-verbose mode, and the restriction can be lifted. Signed-off-by: SZEDER Gábor <szeder.dev@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com> 18 March 2017, 17:18:22 UTC
4ecae3c tests: create an interactive gdb session with the 'debug' helper The 'debug' test helper is supposed to facilitate debugging by running a command of the test suite under gdb. Unfortunately, its usefulness is severely limited, because that gdb session is not interactive, since the test's, and thus gdb's standard input is redirected from /dev/null (for a good reason, see 781f76b15 (test-lib: redirect stdin of tests, 2011-12-15)). Redirect gdb's standard file descriptors from/to the test environment's stdin, stdout and stderr in the 'debug' helper, thus creating an interactive gdb session (even in non-verbose mode), which is much, much more useful. Signed-off-by: SZEDER Gábor <szeder.dev@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com> 18 March 2017, 17:18:20 UTC
7c9c2f8 Preparing for 2.12.1 Signed-off-by: Junio C Hamano <gitster@pobox.com> 16 March 2017, 21:01:20 UTC
2846ef3 Merge branch 'js/realpath-pathdup-fix' into maint Git v2.12 was shipped with an embarrassing breakage where various operations that verify paths given from the user stopped dying when seeing an issue, and instead later triggering segfault. ... and then to down to 'maint'. * js/realpath-pathdup-fix: real_pathdup(): fix callsites that wanted it to die on error t1501: demonstrate NULL pointer access with invalid GIT_WORK_TREE 16 March 2017, 20:57:00 UTC
f989ac2 Merge branch 'mm/two-more-xstrfmt' into maint Code clean-up and a string truncation fix. * mm/two-more-xstrfmt: bisect_next_all: convert xsnprintf to xstrfmt stop_progress_msg: convert xsnprintf to xstrfmt 16 March 2017, 20:56:43 UTC
3d0449d Merge branch 'vn/line-log-memcpy-size-fix' into maint The command-line parsing of "git log -L" copied internal data structures using incorrect size on ILP32 systems. * vn/line-log-memcpy-size-fix: line-log: use COPY_ARRAY to fix mis-sized memcpy 16 March 2017, 20:56:42 UTC
c5bd9e5 Merge branch 'ax/line-log-range-merge-fix' into maint The code to parse "git log -L..." command line was buggy when there are many ranges specified with -L; overrun of the allocated buffer has been fixed. * ax/line-log-range-merge-fix: line-log.c: prevent crash during union of too many ranges 16 March 2017, 20:56:42 UTC
abe62a4 Merge branch 'jk/add-i-patch-do-prompt' into maint The patch subcommand of "git add -i" was meant to have paths selection prompt just like other subcommand, unlike "git add -p" directly jumps to hunk selection. Recently, this was broken and "add -i" lost the paths selection dialog, but it now has been fixed. * jk/add-i-patch-do-prompt: add--interactive: fix missing file prompt for patch mode with "-i" 16 March 2017, 20:56:42 UTC
68e12d7 Merge branch 'jt/http-base-url-update-upon-redirect' into maint When a redirected http transport gets an error during the redirected request, we ignored the error we got from the server, and ended up giving a not-so-useful error message. * jt/http-base-url-update-upon-redirect: http: attempt updating base URL only if no error 16 March 2017, 20:56:42 UTC
8e87cbc Merge branch 'js/travis-32bit-linux' into maint Add 32-bit Linux variant to the set of platforms to be tested with Travis CI. * js/travis-32bit-linux: Travis: also test on 32-bit Linux 16 March 2017, 20:56:42 UTC
890d765 Merge branch 'jh/mingw-openssl-sha1' into maint Windows port wants to use OpenSSL's implementation of SHA-1 routines, so let them. * jh/mingw-openssl-sha1: mingw: use OpenSSL's SHA-1 routines 16 March 2017, 20:56:41 UTC
d880bfd Merge branch 'jk/http-auth' into maint Reduce authentication round-trip over HTTP when the server supports just a single authentication method. * jk/http-auth: http: add an "auto" mode for http.emptyauth http: restrict auth methods to what the server advertises 16 March 2017, 20:56:41 UTC
5ea3048 submodule-config: correct error reporting for invalid ignore value As 'var' contains the whole value we get error messages that repeat the section and key currently: warning: Invalid parameter 'true' for config option 'submodule.submodule.plugins/hooks.ignore.ignore' Fix this by only giving the section name in the warning. Signed-off-by: Stefan Beller <sbeller@google.com> Signed-off-by: Junio C Hamano <gitster@pobox.com> 15 March 2017, 18:26:08 UTC
b9e2bc5 git-status: make porcelain more robust git status provides a porcelain mode for porcelain writers with a supposedly stable (plumbing) interface. 7a76c28ff2 ("status: disable translation when --porcelain is used", 2014-03-20) made sure that ahead/behind info is not translated (i.e. is stable). Make sure that the remaining two strings (initial commit, detached head) are stable, too. These changes are for the v1 porcelain interface. While we do have a perfectly stable v2 porcelain interface now, some tools (such as powerline-gitstatus) are written against v1 and profit from fixing v1 without any changes on their side. Signed-off-by: Michael J Gruber <git@drmicha.warpmail.net> Signed-off-by: Junio C Hamano <gitster@pobox.com> 14 March 2017, 20:15:18 UTC
d61434a http-walker: fix buffer underflow processing remote alternates If we parse a remote alternates (or http-alternates), we expect relative lines like: ../../foo.git/objects which we convert into "$URL/../foo.git/" (and then use that as a base for fetching more objects). But if the remote feeds us nonsense like just: ../ we will try to blindly strip the last 7 characters, assuming they contain the string "objects". Since we don't _have_ 7 characters at all, this results in feeding a small negative value to strbuf_add(), which converts it to a size_t, resulting in a big positive value. This should consistently fail (since we can't generall allocate the max size_t minus 7 bytes), so there shouldn't be any security implications. Let's fix this by using strbuf_strip_suffix() to drop the characters we want. If they're not present, we'll ignore the alternate (in theory we could use it as-is, but the rest of the http-walker code unconditionally tacks "objects/" back on, so it is it not prepared to handle such a case). Signed-off-by: Jeff King <peff@peff.net> Signed-off-by: Junio C Hamano <gitster@pobox.com> 13 March 2017, 17:20:29 UTC
bd4d9d9 t/interop: add test of old clients against modern git-daemon This test just checks that old clients can clone and fetch from a newer git-daemon. The opposite should also be true, but it's hard to test ancient versions of git-daemon because they lack basic options like "--listen". Note that we have to make a slight tweak to the lib-git-daemon helper from the regular tests, so that it starts the daemon with our correct git.a version. Signed-off-by: Jeff King <peff@peff.net> Signed-off-by: Junio C Hamano <gitster@pobox.com> 10 March 2017, 22:30:25 UTC
3d89361 t: add an interoperability test harness The current test suite is good at letting you test a particular version of Git. But it's not very good at letting you test _two_ versions and seeing how they interact (e.g., one cloning from the other). This commit adds a test harness that will build two arbitrary versions of git and make it easy to call them from inside your tests. See the README and the example script for details. Signed-off-by: Jeff King <peff@peff.net> Signed-off-by: Junio C Hamano <gitster@pobox.com> 10 March 2017, 22:30:25 UTC
ce83ead real_pathdup(): fix callsites that wanted it to die on error In 4ac9006f832 (real_path: have callers use real_pathdup and strbuf_realpath, 2016-12-12), we changed the xstrdup(real_path()) pattern to use real_pathdup() directly. The problem with this change is that real_path() calls strbuf_realpath() with die_on_error = 1 while real_pathdup() calls it with die_on_error = 0. Meaning that in cases where real_path() causes Git to die() with an error message, real_pathdup() is silent and returns NULL instead. The callers, however, are ill-prepared for that change, as they expect the return value to be non-NULL (and otherwise the function died with an appropriate error message). Fix this by extending real_pathdup()'s signature to accept the die_on_error flag and simply pass it through to strbuf_realpath(), and then adjust all callers after a careful audit whether they would handle NULLs well. Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de> Signed-off-by: Junio C Hamano <gitster@pobox.com> 08 March 2017, 22:38:41 UTC
aac3eaa t1501: demonstrate NULL pointer access with invalid GIT_WORK_TREE When GIT_WORK_TREE does not specify a valid path, we should error out, instead of crashing. Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de> Signed-off-by: Junio C Hamano <gitster@pobox.com> 08 March 2017, 22:38:22 UTC
d1a13d3 send-pack: report signal death of pack-objects If our pack-objects sub-process dies of a signal, then it likely didn't have a chance to write anything useful to stderr. The user may be left scratching their head why the push failed. Let's detect this situation and write something to stderr. Signed-off-by: Jeff King <peff@peff.net> Signed-off-by: Junio C Hamano <gitster@pobox.com> 07 March 2017, 22:58:36 UTC
ba69f92 send-pack: read "unpack" status even on pack-objects failure If the local pack-objects of a push fails, we'll tell the user about it. But one likely cause is that the remote index-pack stopped reading for some reason (because it didn't like our input, or encountered another error). In that case we'd expect the remote to report more details to us via the "unpack ..." status line. However, the current code just hangs up completely, and the user never sees it. Instead, let's call receive_unpack_status(), which will complain on stderr with whatever reason the remote told us. Note that if our pack-objects fails because the connection was severed or the remote just crashed entirely, then our packet_read_line() call may fail with "the remote end hung up unexpectedly". That's OK. It's a more accurate description than what we get now (which is just "some refs failed to push"). This should be safe from any deadlocks. At the point we make this call we'll have closed the writing end of the connection to the server (either by handing it off to a pack-objects which exited, explicitly in the stateless_rpc case, or by doing a half-duplex shutdown for a socket). So there should be no chance that the other side is waiting for the rest of our pack-objects input. Signed-off-by: Jeff King <peff@peff.net> Signed-off-by: Junio C Hamano <gitster@pobox.com> 07 March 2017, 22:57:39 UTC
40d05d0 send-pack: improve unpack-status error messages When the remote tells us that the "unpack" step failed, we show an error message. However, unless you are familiar with the internals of send-pack and receive-pack, it was not clear that this represented an error on the remote side. Let's re-word to make that more obvious. Likewise, when we got an unexpected packet from the other end, we complained with a vague message but did not actually show the packet. Let's fix that. And finally, neither message was marked for translation. The message from the remote probably won't be translated, but there's no reason we can't do better for the local half. Signed-off-by: Jeff King <peff@peff.net> Signed-off-by: Junio C Hamano <gitster@pobox.com> 07 March 2017, 22:54:48 UTC
f7cd74d send-pack: use skip_prefix for parsing unpack status This avoids repeating ourselves, and the use of magic numbers. Signed-off-by: Jeff King <peff@peff.net> Signed-off-by: Junio C Hamano <gitster@pobox.com> 07 March 2017, 22:54:14 UTC
7c39df2 send-pack: extract parsing of "unpack" response After sending the pack, we call receive_status() which gets both the "unpack" line and the ref status. Let's break these into two functions so we can call the first part independently. Signed-off-by: Jeff King <peff@peff.net> Signed-off-by: Junio C Hamano <gitster@pobox.com> 07 March 2017, 22:51:20 UTC
6cdad1f receive-pack: fix deadlock when we cannot create tmpdir The err_fd descriptor passed to the unpack() function is intended to be handed off to the child index-pack, and our async muxer will read until it gets EOF. However, if we encounter an error before handing off the descriptor, we must manually close(err_fd). Otherwise we will be waiting for our muxer to finish, while the muxer is waiting for EOF on err_fd. We fixed an identical deadlock already in 49ecfa13f (receive-pack: close sideband fd on early pack errors, 2013-04-19). But since then, the function grew a new early-return in 722ff7f87 (receive-pack: quarantine objects until pre-receive accepts, 2016-10-03), when we fail to create a temporary directory. This return needs the same treatment. Reported-by: Horst Schirmeier <horst@schirmeier.com> Signed-off-by: Jeff King <peff@peff.net> Signed-off-by: Junio C Hamano <gitster@pobox.com> 07 March 2017, 22:51:03 UTC
3255e51 ewah: fix eword_t/uint64_t confusion The ewah subsystem typedefs eword_t to be uint64_t, but some code uses a bare uint64_t. This isn't a bug now, but it's a potential maintenance problem if the definition of eword_t ever changes. Let's use the correct type. Note that we can't use COPY_ARRAY() here because the source and destination point to objects of different sizes. For that reason we'll also skip the usual "sizeof(*dst)" and use the real type, which should make it more clear that there's something tricky going on. Signed-off-by: Jeff King <peff@peff.net> Signed-off-by: Junio C Hamano <gitster@pobox.com> 06 March 2017, 20:03:40 UTC
07f546c line-log: use COPY_ARRAY to fix mis-sized memcpy This memcpy meant to get the sizeof a "struct range", not a "range_set", as the former is what our array holds. Rather than swap out the types, let's convert this site to COPY_ARRAY, which avoids the problem entirely (and confirms that the src and dst types match). Note for curiosity's sake that this bug doesn't trigger on I32LP64 systems, but does on ILP32 systems. The mistaken "struct range_set" has two ints and a pointer. That's 16 bytes on LP64, or 12 on ILP32. The correct "struct range" type has two longs, which is also 16 on LP64, but only 8 on ILP32. Likewise an IL32P64 system would experience the bug. Signed-off-by: Jeff King <peff@peff.net> Signed-off-by: Vegard Nossum <vegard.nossum@oracle.com> Signed-off-by: Junio C Hamano <gitster@pobox.com> 06 March 2017, 20:01:02 UTC
88dedd5 Travis: also test on 32-bit Linux When Git v2.9.1 was released, it had a bug that showed only on Windows and on 32-bit systems: our assumption that `unsigned long` can hold 64-bit values turned out to be wrong. This could have been caught earlier if we had a Continuous Testing set up that includes a build and test run on 32-bit Linux. Let's do this (and take care of the Windows build later). This patch asks Travis CI to install a Docker image with 32-bit libraries and then goes on to build and test Git using this 32-bit setup. Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de> Signed-off-by: Lars Schneider <larsxschneider@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com> 06 March 2017, 19:19:09 UTC
5cae73d http: release strbuf on disabled alternates This likely has no real-world impact on memory usage, but it is cleaner for future readers. Fixes: abcbdc03895f ("http: respect protocol.*.allow=user for http-alternates") Signed-off-by: Eric Wong <e@80x24.org> Reviewed-by: Jeff King <peff@peff.net> Signed-off-by: Junio C Hamano <gitster@pobox.com> 06 March 2017, 18:52:57 UTC
de46138 http: inform about alternates-as-redirects behavior It is disconcerting for users to not notice the behavior change in handling alternates from commit cb4d2d35c4622ec2 ("http: treat http-alternates like redirects") Give the user a hint about the config option so they can see the URL and decide whether or not they want to enable http.followRedirects in their config. Signed-off-by: Eric Wong <e@80x24.org> Reviewed-by: Jeff King <peff@peff.net> Signed-off-by: Junio C Hamano <gitster@pobox.com> 06 March 2017, 18:52:15 UTC
32da746 p7000: add test for filter-branch with --prune-empty Signed-off-by: Devin J. Pohly <djpohly@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com> 03 March 2017, 20:43:37 UTC
a582a82 filter-branch: fix --prune-empty on parentless commits Previously, the git_commit_non_empty_tree function would always pass any commit with no parents to git-commit-tree, regardless of whether the tree was nonempty. The new commit would then be recorded in the filter-branch revision map, and subsequent commits which leave the tree untouched would be correctly filtered. With this change, parentless commits with an empty tree are correctly pruned, and an empty file is recorded in the revision map, signifying that it was rewritten to "no commits." This works naturally with the parent mapping for subsequent commits. Signed-off-by: Devin J. Pohly <djpohly@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com> 03 March 2017, 20:43:37 UTC
4dacc8f t7003: ensure --prune-empty removes entire branch when applicable Sanity check before changing the logic in git_commit_non_empty_tree. Signed-off-by: Devin J. Pohly <djpohly@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com> 03 March 2017, 20:43:37 UTC
377a354 t7003: ensure --prune-empty can prune root commit New test to expose a bug in filter-branch whereby the root commit is never pruned, even though its tree is empty and --prune-empty is given. The setup isn't exactly pretty, but I couldn't think of a simpler way to create a parallel commit graph sans the first commit. Signed-off-by: Devin J. Pohly <djpohly@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com> 03 March 2017, 20:43:37 UTC
aaae0bf line-log.c: prevent crash during union of too many ranges The existing implementation of range_set_union does not correctly reallocate memory, leading to a heap overflow when it attempts to union more than 24 separate line ranges. For struct range_set *out to grow correctly it must have out->nr set to the current size of the buffer when it is passed to range_set_grow. However, the existing implementation of range_set_union only updates out->nr at the end of the function, meaning that it is always zero before this. This results in range_set_grow never growing the buffer, as well as some of the union logic itself being incorrect as !out->nr is always true. The reason why 24 is the limit is that the first allocation of size 1 ends up allocating a buffer of size 24 (due to the call to alloc_nr in ALLOC_GROW). This goes some way to explain why this hasn't been caught before. Fix the problem by correctly updating out->nr after reallocating the range_set. As this results in out->nr containing the same value as the variable o, replace o with out->nr as well. Finally, add a new test to help prevent the problem reoccurring in the future. Thanks to Vegard Nossum for writing the test. Signed-off-by: Allan Xavier <allan.x.xavier@oracle.com> Reviewed-by: Jeff King <peff@peff.net> Signed-off-by: Junio C Hamano <gitster@pobox.com> 03 March 2017, 19:16:20 UTC
b8686c6 contrib: git-remote-{bzr,hg} placeholders don't need Python It does not make sense for these placeholder scripts to depend on Python just because the real scripts do. At the example of Git for Windows, we would not even be able to see those warnings as it does not ship with Python. So just use plain shell scripts instead. Signed-off-by: Sebastian Schuberth <sschuberth@gmail.com> Reviewed-by: Jeff King <peff@peff.net> Signed-off-by: Junio C Hamano <gitster@pobox.com> 03 March 2017, 19:09:34 UTC
28e1fb5 t/perf: add fallback for pre-bin-wrappers versions of git It's tempting to say: ./run v1.0.0 HEAD to see how we've sped up Git over the years. Unfortunately, this doesn't quite work because versions of Git prior to v1.7.0 lack bin-wrappers, so our "run" script doesn't correctly put them in the PATH. Worse, it means we silently find whatever other "git" is in the PATH, and produce test results that have no bearing on what we asked for. Let's fallback to the main git directory when bin-wrappers isn't present. Many modern perf scripts won't run with such an antique version of Git, of course, but at least those failures are detected and reported (and you're free to write a limited perf script that works across many versions). Signed-off-by: Jeff King <peff@peff.net> Signed-off-by: Junio C Hamano <gitster@pobox.com> 03 March 2017, 18:55:27 UTC
83d4a40 t/perf: use $MODERN_GIT for all repo-copying steps Since 1a0962dee (t/perf: fix regression in testing older versions of git, 2016-06-22), we point "$MODERN_GIT" to a copy of git that matches the t/perf script itself, and which can be used for tasks outside of the actual timings. This is needed because the setup done by perf scripts keeps moving forward in time, and may use features that the older versions of git we are testing do not have. That commit used $MODERN_GIT to fix a case where we relied on the relatively recent --git-path option. But if you go back further still, there are more problems. Since 7501b5921 (perf: make the tests work in worktrees, 2016-05-13), we use "git -C", but versions of git older than 44e1e4d67 (git: run in a directory given with -C option, 2013-09-09) don't know about "-C". So testing an old version of git with a new version of t/perf will fail the setup step. We can fix this by using $MODERN_GIT during the setup; there's no need to use the antique version, since it doesn't affect the timings. Likewise, we'll adjust the "init" invocation; antique versions of git called this "init-db". Signed-off-by: Jeff King <peff@peff.net> Signed-off-by: Junio C Hamano <gitster@pobox.com> 03 March 2017, 18:55:26 UTC
67f2825 t/perf: export variable used in other blocks In p0001, a variable was created in a test_expect_success block to be used in later test_perf blocks, but was not exported. This caused the variable to not appear in those blocks (this can be verified by writing 'test -n "$commit"' in those blocks), resulting in a slightly different invocation than what was intended. Export that variable. Signed-off-by: Jonathan Tan <jonathantanmy@google.com> Reviewed-by: Jeff King <peff@peff.net> Signed-off-by: Junio C Hamano <gitster@pobox.com> 03 March 2017, 18:54:42 UTC
d56583d fetch-pack: add specific error for fetching an unadvertised object Enhance filter_refs (which decides whether a request for an unadvertised object should be sent to the server) to record a new match status on the "struct ref" when a request is not allowed, and have report_unmatched_refs check for this status and print a special error message, "Server does not allow request for unadvertised object". Signed-off-by: Matt McCutchen <matt@mattmccutchen.net> Signed-off-by: Junio C Hamano <gitster@pobox.com> 02 March 2017, 19:12:53 UTC
e70a65c fetch_refs_via_pack: call report_unmatched_refs "git fetch" currently doesn't bother to check that it got all refs it sought, because the common case of requesting a nonexistent ref triggers a die() in get_fetch_map. However, there's at least one case that slipped through: "git fetch REMOTE SHA1" if the server doesn't allow requests for unadvertised objects. Make fetch_refs_via_pack (which is on the "git fetch" code path) call report_unmatched_refs so that we at least get an error message in that case. Signed-off-by: Matt McCutchen <matt@mattmccutchen.net> Signed-off-by: Junio C Hamano <gitster@pobox.com> 02 March 2017, 19:12:53 UTC
e860d96 fetch-pack: move code to report unmatched refs to a function Prepare to reuse this code in transport.c for "git fetch". While we're here, internationalize the existing error message. Signed-off-by: Matt McCutchen <matt@mattmccutchen.net> Signed-off-by: Junio C Hamano <gitster@pobox.com> 02 March 2017, 19:12:53 UTC
fd4692f checkout: restrict @-expansions when finding branch When we parse "git checkout $NAME", we try to interpret $NAME as a local branch-name. If it is, then we point HEAD to that branch. Otherwise, we detach the HEAD at whatever commit $NAME points to. We do the interpretation by calling strbuf_branchname(), and then blindly sticking "refs/heads/" on the front. This leads to nonsense results when expansions like "@{upstream}" or "@" point to something besides a local branch. We end up with a local branch name like "refs/heads/origin/master" or "refs/heads/HEAD". Normally this has no user-visible effect because those branches don't exist, and so we fallback to feeding the result to get_sha1(), which resolves them correctly. But as the new test in t3204 shows, there are corner cases where the effect is observable, and we check out the wrong local branch rather than detaching to the correct one. Signed-off-by: Jeff King <peff@peff.net> Signed-off-by: Junio C Hamano <gitster@pobox.com> 02 March 2017, 19:05:04 UTC
7d5c960 strbuf_check_ref_format(): expand only local branches This function asks strbuf_branchname() to expand any @-marks in the branchname, and then we blindly stick refs/heads/ in front of the result. This is obviously nonsense if the expansion is "HEAD" or a ref in refs/remotes/. The most obvious end-user effect is that creating or renaming a branch with an expansion may have confusing results (e.g., creating refs/heads/origin/master from "@{upstream}" when the operation should be disallowed). We can fix this by telling strbuf_branchname() that we are only interested in local expansions. Any unexpanded bits are then fed to check_ref_format(), which either disallows them (in the case of "@{upstream}") or lets them through ("refs/heads/@" is technically valid, if a bit silly). Signed-off-by: Jeff King <peff@peff.net> Signed-off-by: Junio C Hamano <gitster@pobox.com> 02 March 2017, 19:05:04 UTC
6b145e0 branch: restrict @-expansions when deleting We use strbuf_branchname() to expand the branch name from the command line, so you can delete the branch given by @{-1}, for example. However, we allow other nonsense like "@", and we do not respect our "-r" flag (so we may end up deleting an oddly-named local ref instead of a remote one). We can fix this by passing the appropriate "allowed" flag to strbuf_branchname(). Signed-off-by: Jeff King <peff@peff.net> Signed-off-by: Junio C Hamano <gitster@pobox.com> 02 March 2017, 19:05:04 UTC
a356e8e t3204: test git-branch @-expansion corner cases git-branch feeds the branch names from the command line to strbuf_branchname(), but we do not yet tell that function which kinds of expansions should be allowed. Let's create a set of tests that cover both the allowed and disallowed cases. That shows off some breakages where we currently create or delete the wrong ref (and will make sure that we do not break any cases that _should_ be working when we do add more restrictions). Note that we check branch creation and deletion, but do not bother with renames. Those follow the same code path as creation. Signed-off-by: Jeff King <peff@peff.net> Signed-off-by: Junio C Hamano <gitster@pobox.com> 02 March 2017, 19:05:04 UTC
0e9f62d interpret_branch_name: allow callers to restrict expansions The interpret_branch_name() function converts names like @{-1} and @{upstream} into branch names. The expanded ref names are not fully qualified, and may be outside of the refs/heads/ namespace (e.g., "@" expands to "HEAD", and "@{upstream}" is likely to be in "refs/remotes/"). This is OK for callers like dwim_ref() which are primarily interested in resolving the resulting name, no matter where it is. But callers like "git branch" treat the result as a branch name in refs/heads/. When we expand to a ref outside that namespace, the results are very confusing (e.g., "git branch @" tries to create refs/heads/HEAD, which is nonsense). Callers can't know from the returned string how the expansion happened (e.g., did the user really ask for a branch named "HEAD", or did we do a bogus expansion?). One fix would be to return some out-parameters describing the types of expansion that occurred. This has the benefit that the caller can generate precise error messages ("I understood @{upstream} to mean origin/master, but that is a remote tracking branch, so you cannot create it as a local name"). However, out-parameters make the function interface somewhat cumbersome. Instead, let's do the opposite: let the caller tell us which elements to expand. That's easier to pass in, and none of the callers give more precise error messages than "@{upstream} isn't a valid branch name" anyway (which should be sufficient). The strbuf_branchname() function needs a similar parameter, as most of the callers access interpret_branch_name() through it. We can break the callers down into two groups: 1. Callers that are happy with any kind of ref in the result. We pass "0" here, so they continue to work without restrictions. This includes merge_name(), the reflog handling in add_pending_object_with_path(), and substitute_branch_name(). This last is what powers dwim_ref(). 2. Callers that have funny corner cases (mostly in git-branch and git-checkout). These need to make use of the new parameter, but I've left them as "0" in this patch, and will address them individually in follow-on patches. Signed-off-by: Jeff King <peff@peff.net> Signed-off-by: Junio C Hamano <gitster@pobox.com> 02 March 2017, 19:05:04 UTC
0705fe2 strbuf_branchname: add docstring This function and its companion, strbuf_check_branch_ref(), did not have their purpose or semantics explained. Let's do so. Signed-off-by: Jeff King <peff@peff.net> Signed-off-by: Junio C Hamano <gitster@pobox.com> 02 March 2017, 19:05:04 UTC
311fc74 strbuf_branchname: drop return value The return value from strbuf_branchname() is confusing and useless: it's 0 if the whole name was consumed by an @-mark, but otherwise is the length of the original name we fed. No callers actually look at the return value, so let's just get rid of it. Signed-off-by: Jeff King <peff@peff.net> Signed-off-by: Junio C Hamano <gitster@pobox.com> 02 March 2017, 19:05:04 UTC
e322b60 interpret_branch_name: move docstring to header file We generally put docstrings with function declarations, because it's the callers who need to know how the function works. Let's do so for interpret_branch_name(). Signed-off-by: Jeff King <peff@peff.net> Signed-off-by: Junio C Hamano <gitster@pobox.com> 02 March 2017, 19:05:03 UTC
13228c3 interpret_branch_name(): handle auto-namelen for @{-1} The interpret_branch_name() function takes a ptr/len pair for the name, but you can pass "0" for "namelen", which will cause it to check the length with strlen(). However, before we do that auto-namelen magic, we call interpret_nth_prior_checkout(), which gets fed the bogus "0". This was broken by 8cd4249c4 (interpret_branch_name: always respect "namelen" parameter, 2014-01-15). Though to be fair to that commit, it was broken in the _opposite_ direction before, where we would always treat "name" as a string even if a length was passed. You can see the bug with "git log -g @{-1}". That code path always passes "0", and without this patch it cannot figure out which branch's reflog to show. We can fix it by a small reordering of the code. Signed-off-by: Jeff King <peff@peff.net> Signed-off-by: Junio C Hamano <gitster@pobox.com> 02 March 2017, 19:04:57 UTC
12426e1 diff: do not short-cut CHECK_SIZE_ONLY check in diff_populate_filespec() Callers of diff_populate_filespec() can choose to ask only for the size of the blob without grabbing the blob data, and the function, after running lstat() when the filespec points at a working tree file, returns by copying the value in size field of the stat structure into the size field of the filespec when this is the case. However, this short-cut cannot be taken if the contents from the path needs to go through convert_to_git(), whose resulting real blob data may be different from what is in the working tree file. As "git diff --quiet" compares the .size fields of filespec structures to skip content comparison, this bug manifests as a false "there are differences" for a file that needs eol conversion, for example. Reported-by: Mike Crowe <mac@mcrowe.com> Helped-by: Torsten Bögershausen <tboegi@web.de> Signed-off-by: Junio C Hamano <gitster@pobox.com> 02 March 2017, 18:48:06 UTC
c852bd5 add--interactive: fix missing file prompt for patch mode with "-i" When invoked as "git add -i", each menu interactive menu option prompts the user to select a list of files. This includes the "patch" option, which gets the list before starting the hunk-selection loop. As "git add -p", it behaves differently, and jumps straight to the hunk selection loop. Since 0539d5e6d (i18n: add--interactive: mark patch prompt for translation, 2016-12-14), the "add -i" case mistakenly jumps to straight to the hunk-selection loop. Prior to that commit the distinction between the two cases was managed by the $patch_mode variable. That commit used $patch_mode for something else, and moved the old meaning to the "$cmd" variable. But it forgot to update the $patch_mode check inside patch_update_cmd() which controls the file-list behavior. The simplest fix would be to change that line to check $cmd. But while we're here, let's use a less obscure name for this flag: $patch_mode_only, a boolean which tells whether we are in full-interactive mode or only in patch-mode. Reported-by: Henrik Grubbström <grubba@grubba.org> Signed-off-by: Jeff King <peff@peff.net> Signed-off-by: Junio C Hamano <gitster@pobox.com> 02 March 2017, 18:10:38 UTC
bcd886d README: create HTTP/HTTPS links from URLs in Markdown Markdown supports automatic links by surrounding URLs with angle brackets, as documented in <https://daringfireball.net/projects/markdown/syntax#autolink> While we're at it, update URLs to avoid redirecting clients for git-scm.com (by using HTTPS) and public-inbox.org (by adding a trailing slash). Signed-off-by: Eric Wong <e@80x24.org> Signed-off-by: Junio C Hamano <gitster@pobox.com> 01 March 2017, 22:45:45 UTC
back to top