summaryrefslogtreecommitdiff
AgeCommit message (Collapse)AuthorFilesLines
2017-03-14Merge branch 'dp/filter-branch-prune-empty'Libravatar Junio C Hamano4-8/+50
"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
2017-03-14Merge branch 'jt/perf-updates'Libravatar Junio C Hamano3-3/+7
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
2017-03-14Merge branch 'mm/fetch-show-error-message-on-unadvertised-object'Libravatar Junio C Hamano7-30/+66
"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
2017-03-14Merge branch 'jk/interpret-branch-name'Libravatar Junio C Hamano10-51/+249
"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}
2017-03-14Merge branch 'ab/cond-skip-tests'Libravatar Junio C Hamano3-1/+16
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
2017-03-12Third batch after 2.12Libravatar Junio C Hamano1-0/+39
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2017-03-12Merge branch 'ah/doc-ls-files-quotepath'Libravatar Junio C Hamano9-39/+48
Documentation for "git ls-files" did not refer to core.quotePath * ah/doc-ls-files-quotepath: Documentation: improve description for core.quotePath
2017-03-12Merge branch 'jc/diff-populate-filespec-size-only-fix'Libravatar Junio C Hamano2-1/+27
"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()
2017-03-12Merge branch 'vn/line-log-memcpy-size-fix'Libravatar Junio C Hamano1-1/+2
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
2017-03-12Merge branch 'jk/ewah-use-right-type-in-sizeof'Libravatar Junio C Hamano1-2/+2
Code clean-up. * jk/ewah-use-right-type-in-sizeof: ewah: fix eword_t/uint64_t confusion
2017-03-12Merge branch 'ax/line-log-range-merge-fix'Libravatar Junio C Hamano2-8/+17
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
2017-03-12Merge branch 'ss/remote-bzr-hg-placeholder-wo-python'Libravatar Junio C Hamano2-18/+14
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
2017-03-12Merge branch 'js/realpath-pathdup-fix'Libravatar Junio C Hamano9-17/+25
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. * 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
2017-03-12Merge branch 'jk/add-i-patch-do-prompt'Libravatar Junio C Hamano2-4/+22
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"
2017-03-12Merge branch 'jh/mingw-openssl-sha1'Libravatar Junio C Hamano1-1/+0
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
2017-03-10Second batch after 2.12Libravatar Junio C Hamano1-0/+65
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2017-03-10Merge branch 'rs/log-email-subject'Libravatar Junio C Hamano6-31/+32
Code clean-up. * rs/log-email-subject: pretty: use fmt_output_email_subject() log-tree: factor out fmt_output_email_subject()
2017-03-10Merge branch 'tg/stash-push'Libravatar Junio C Hamano4-30/+274
"git stash save" takes a pathspec so that the local changes can be stashed away only partially. * tg/stash-push: stash: allow pathspecs in the no verb form stash: use stash_push for no verb form stash: teach 'push' (and 'create_stash') to honor pathspec stash: refactor stash_create stash: add test for the create command line arguments stash: introduce push verb
2017-03-10Merge branch 'sb/submodule-init-url-selection'Libravatar Junio C Hamano2-19/+27
When "git submodule init" decides that the submodule in the working tree is its upstream, it now gives a warning as it is not a very common setup. * sb/submodule-init-url-selection: submodule init: warn about falling back to a local path
2017-03-10Merge branch 'rj/remove-unused-mktemp'Libravatar Junio C Hamano6-60/+0
Code cleanup. * rj/remove-unused-mktemp: wrapper.c: remove unused gitmkstemps() function wrapper.c: remove unused git_mkstemp() function
2017-03-10Merge branch 'ew/markdown-url-in-readme'Libravatar Junio C Hamano1-3/+3
Doc update. * ew/markdown-url-in-readme: README: create HTTP/HTTPS links from URLs in Markdown
2017-03-10Merge branch 'ps/docs-diffcore'Libravatar Junio C Hamano1-5/+5
Doc update. * ps/docs-diffcore: docs/diffcore: unquote "Complete Rewrites" in headers docs/diffcore: fix grammar in diffcore-rename header
2017-03-10Merge branch 'jt/http-base-url-update-upon-redirect'Libravatar Junio C Hamano3-0/+21
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
2017-03-10Merge branch 'jk/http-auth'Libravatar Junio C Hamano1-4/+46
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
2017-03-10Merge branch 'jh/send-email-one-cc'Libravatar Junio C Hamano2-5/+4
"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
2017-03-10Merge branch 'rs/strbuf-add-real-path'Libravatar Junio C Hamano6-2/+49
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
2017-03-10Merge branch 'rs/sha1-file-plug-fallback-base-leak'Libravatar Junio C Hamano1-0/+4
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()
2017-03-10Merge branch 'rs/commit-parsing-optim'Libravatar Junio C Hamano1-12/+10
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
2017-03-10Merge branch 'jk/t6300-cleanup'Libravatar Junio C Hamano1-1/+1
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
2017-03-10Merge branch 'jk/parse-config-key-cleanup'Libravatar Junio C Hamano3-11/+16
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
2017-03-10Merge branch 'sb/parse-hide-refs-config-cleanup'Libravatar Junio C Hamano1-3/+4
Code clean-up. * sb/parse-hide-refs-config-cleanup: refs: parse_hide_refs_config to use parse_config_key
2017-03-10Merge branch 'jt/upload-pack-error-report'Libravatar Junio C Hamano1-1/+5
"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
2017-03-10Merge branch 'jk/ident-empty'Libravatar Junio C Hamano2-19/+66
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
2017-03-10Merge branch 'jc/config-case-cmdline-take-2'Libravatar Junio C Hamano2-97/+163
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. * jc/config-case-cmdline-take-2: config: use git_config_parse_key() in git_config_parse_parameter() config: move a few helper functions up
2017-03-08real_pathdup(): fix callsites that wanted it to die on errorLibravatar Johannes Schindelin9-18/+18
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>
2017-03-08t1501: demonstrate NULL pointer access with invalid GIT_WORK_TREELibravatar Johannes Schindelin1-0/+8
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>
2017-03-07git svn: fix authentication with 'branch'Libravatar Hiroshi Shirosaki1-3/+3
Authentication fails with svn branch while svn rebase and svn dcommit work fine without authentication failures. $ git svn branch v7_3 Copying https://xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx at r27519 to https://xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx/v7_3... Can't create session: Unable to connect to a repository at URL 'https://xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx': No more credentials or we tried too many times. Authentication failed at C:\Program Files\Git\mingw64/libexec/git-core\git-svn line 1200. We add auth configuration to SVN::Client->new() to fix the issue. Signed-off-by: Hiroshi Shirosaki <h.shirosaki@gmail.com> Signed-off-by: Eric Wong <e@80x24.org>
2017-03-06ewah: fix eword_t/uint64_t confusionLibravatar Jeff King1-2/+2
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>
2017-03-06line-log: use COPY_ARRAY to fix mis-sized memcpyLibravatar Vegard Nossum1-1/+2
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>
2017-03-03p7000: add test for filter-branch with --prune-emptyLibravatar Devin J. Pohly1-0/+5
Signed-off-by: Devin J. Pohly <djpohly@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2017-03-03filter-branch: fix --prune-empty on parentless commitsLibravatar Devin J. Pohly3-10/+10
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>
2017-03-03t7003: ensure --prune-empty removes entire branch when applicableLibravatar Devin J. Pohly1-0/+7
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>
2017-03-03t7003: ensure --prune-empty can prune root commitLibravatar Devin J. Pohly1-0/+30
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>
2017-03-03line-log.c: prevent crash during union of too many rangesLibravatar Allan Xavier2-8/+17
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>
2017-03-03contrib: git-remote-{bzr,hg} placeholders don't need PythonLibravatar Sebastian Schuberth2-18/+14
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>
2017-03-03t/perf: add fallback for pre-bin-wrappers versions of gitLibravatar Jeff King1-0/+3
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>
2017-03-03t/perf: use $MODERN_GIT for all repo-copying stepsLibravatar Jeff King1-2/+2
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>
2017-03-03t/perf: export variable used in other blocksLibravatar Jonathan Tan1-1/+2
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>
2017-03-02Documentation: improve description for core.quotePathLibravatar Andreas Heiduk9-39/+48
Linking the description for pathname quoting to the configuration variable "core.quotePath" removes inconstistent and incomplete sections while also giving two hints how to deal with it: Either with "-c core.quotePath=false" or with "-z". Signed-off-by: Andreas Heiduk <asheiduk@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2017-03-02fetch-pack: add specific error for fetching an unadvertised objectLibravatar Matt McCutchen3-18/+35
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>