summaryrefslogtreecommitdiff
AgeCommit message (Collapse)Author
2017-03-28builtin/receive-pack: convert portions to struct object_idbrian m. carlson
Convert some hardcoded constants into uses of parse_oid_hex. Additionally, convert all uses of struct command, and miscellaneous other functions necessary for that. This work is necessary to be able to convert sha1_array_append later on. To avoid needing to specify a constant, reject shallow lines with the wrong length instead of simply ignoring them. Note that in queue_command we are guaranteed to have a NUL-terminated buffer or at least one byte of overflow that we can safely read, so the linelen check can be elided. We would die in such a case, but not read invalid memory. Signed-off-by: brian m. carlson <sandals@crustytoothpaste.net> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2017-03-27builtin/pull: convert portions to struct object_idbrian m. carlson
Convert the caller of sha1_array_append to struct object_id. Signed-off-by: brian m. carlson <sandals@crustytoothpaste.net> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2017-03-27builtin/diff: convert to struct object_idbrian m. carlson
Signed-off-by: brian m. carlson <sandals@crustytoothpaste.net> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2017-03-27Convert GIT_SHA1_RAWSZ used for allocation to GIT_MAX_RAWSZbrian m. carlson
Since we will likely be introducing a new hash function at some point, and that hash function might be longer than 20 bytes, use the constant GIT_MAX_RAWSZ, which is designed to be suitable for allocations, instead of GIT_SHA1_RAWSZ. This will ease the transition down the line by distinguishing between places where we need to allocate memory suitable for the largest hash from those where we need to handle the current hash. Signed-off-by: brian m. carlson <sandals@crustytoothpaste.net> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2017-03-27Convert GIT_SHA1_HEXSZ used for allocation to GIT_MAX_HEXSZbrian m. carlson
Since we will likely be introducing a new hash function at some point, and that hash function might be longer than 40 hex characters, use the constant GIT_MAX_HEXSZ, which is designed to be suitable for allocations, instead of GIT_SHA1_HEXSZ. This will ease the transition down the line by distinguishing between places where we need to allocate memory suitable for the largest hash from those where we need to handle the current hash. Signed-off-by: brian m. carlson <sandals@crustytoothpaste.net> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2017-03-27Define new hash-size constants for allocating memorybrian m. carlson
Since we will want to transition to a new hash at some point in the future, and that hash may be larger in size than 160 bits, introduce two constants that can be used for allocating a sufficient amount of memory. They can be increased to reflect the largest supported hash size. Signed-off-by: brian m. carlson <sandals@crustytoothpaste.net> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2017-03-24Sync with 2.12.2Junio C Hamano
2017-03-24Seventh batch for 2.13Junio C Hamano
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2017-03-24Merge branch 'jk/sha1dc'Junio C Hamano
The "detect attempt to create collisions" variant of SHA-1 implementation by Marc Stevens (CWI) and Dan Shumow (Microsoft) has been integrated and made the default. * jk/sha1dc: Makefile: make DC_SHA1 the default t0013: add a basic sha1 collision detection test Makefile: add DC_SHA1 knob sha1dc: disable safe_hash feature sha1dc: adjust header includes for git sha1dc: add collision-detecting sha1 implementation
2017-03-24Merge branch 'sg/test-with-stdin'Junio C Hamano
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
2017-03-24Merge branch 'rs/update-hook-optim'Junio C Hamano
Code clean-up. * rs/update-hook-optim: receive-pack: simplify run_update_post_hook()
2017-03-24Merge branch 'rs/shortlog-cleanup'Junio C Hamano
Code clean-up. * rs/shortlog-cleanup: shortlog: don't set after_subject to an empty string
2017-03-24Merge branch 'rs/path-name-safety-cleanup'Junio C Hamano
Code clean-up. * rs/path-name-safety-cleanup: revision: remove declaration of path_name()
2017-03-24Merge branch 'rs/http-push-cleanup'Junio C Hamano
Code clean-up. * rs/http-push-cleanup: http-push: don't check return value of lookup_unknown_object()
2017-03-24Merge branch 'js/regexec-buf'Junio C Hamano
Fix for potential segv introduced in v2.11.0 and later (also v2.10.2). * js/regexec-buf: pickaxe: fix segfault with '-S<...> --pickaxe-regex'
2017-03-24Merge branch 'jk/execv-dashed-external'Junio C Hamano
Fix for NO_PTHREADS build. * jk/execv-dashed-external: run-command: fix segfault when cleaning forked async process
2017-03-24Merge branch 'dl/credential-cache-socket-in-xdg-cache'Junio C Hamano
The default location "~/.git-credential-cache/socket" for the socket used to communicate with the credential-cache daemon has been moved to "~/.cache/git/credential/socket". * dl/credential-cache-socket-in-xdg-cache: credential-cache: add tests for XDG functionality credential-cache: use XDG_CACHE_HOME for socket path.c: add xdg_cache_home
2017-03-24Git 2.12.2v2.12.2Junio C Hamano
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2017-03-24Merge branch 'ab/doc-no-option-notation-fix' into maintJunio C Hamano
Doc fix. * ab/doc-no-option-notation-fix: doc: change erroneous --[no]-whatever into --[no-]whatever
2017-03-24Merge branch 'ab/push-default-doc-fix' into maintJunio C Hamano
Doc fix. * ab/push-default-doc-fix: push: mention "push.default=tracking" in the documentation
2017-03-24Merge branch 'nd/commit-hook-doc-fix' into maintJunio C Hamano
Doc fix. * nd/commit-hook-doc-fix: git-commit.txt: list post-rewrite in HOOKS section
2017-03-24Merge branch 'jc/config-case-cmdline-take-2' into maintJunio C Hamano
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
2017-03-24Merge branch 'jk/grep-no-index-fix' into maintJunio C Hamano
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
2017-03-24Merge branch 'jn/remote-helpers-with-git-dir' into maintJunio C Hamano
"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
2017-03-24Merge branch 'sb/submodule-config-parse-ignore-fix' into maintJunio C Hamano
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
2017-03-24Merge branch 'jk/push-deadlock-regression-fix' into maintJunio C Hamano
"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
2017-03-24mailmap: use Michael J Gruber's new addressMichael J Gruber
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>
2017-03-23Merge branch 'js/rebase-helper'Junio C Hamano
A hotfix for a regression fix * js/rebase-helper: sequencer: fix missing newline
2017-03-23sequencer: fix missing newlineBrandon Williams
When using rebase --interactive where one of the lines is marked as 'edit' this is the resulting output: Stopped at ec3b9c4... stuffYou can amend the commit now, with git commit --amend Once you are satisfied with your changes, run git rebase --continue A newline character is missing at the end of the "Stopped at ..." line and before the "You can amend ..." line. This patch fixes the malformed output by adding the missing newline character to the end of the "Stopped at ..." line. Signed-off-by: Brandon Williams <bmwill@google.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2017-03-21Sync with maintJunio C Hamano
2017-03-21Sixth batch for 2.13Junio C Hamano
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2017-03-21Merge branch 'nd/commit-hook-doc-fix'Junio C Hamano
Doc fix. * nd/commit-hook-doc-fix: git-commit.txt: list post-rewrite in HOOKS section
2017-03-21Merge branch 'ab/push-default-doc-fix'Junio C Hamano
Doc fix. * ab/push-default-doc-fix: push: mention "push.default=tracking" in the documentation
2017-03-21Merge branch 'ab/doc-no-option-notation-fix'Junio C Hamano
Doc fix. * ab/doc-no-option-notation-fix: doc: change erroneous --[no]-whatever into --[no-]whatever
2017-03-21Merge branch 'sb/wt-status-cleanup'Junio C Hamano
Code clean-up. * sb/wt-status-cleanup: wt-status: simplify by using for_each_string_list_item
2017-03-21Merge branch 'js/rebase-helper'Junio C Hamano
Recent update to "rebase -i" started showing a message that is not a warning with "warning:" prefix by mistake. This has been fixed. * js/rebase-helper: sequencer: drop "warning:" when stopping for edit
2017-03-21Merge branch 'nd/conditional-config-include'Junio C Hamano
The configuration file learned a new "includeIf.<condition>.path" that includes the contents of the given path only when the condition holds. This allows you to say "include this work-related bit only in the repositories under my ~/work/ directory". * nd/conditional-config-include: config: add conditional include config.txt: reflow the second include.path paragraph config.txt: clarify multiple key values in include.path
2017-03-21Merge branch 'jk/pack-name-cleanups'Junio C Hamano
Code clean-up. * jk/pack-name-cleanups: index-pack: make pointer-alias fallbacks safer replace snprintf with odb_pack_name() odb_pack_keep(): stop generating keepfile name sha1_file.c: make pack-name helper globally accessible move odb_* declarations out of git-compat-util.h
2017-03-21Merge branch 'sb/submodule-config-parse-ignore-fix'Junio C Hamano
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
2017-03-21Merge branch 'mg/prompt-describe-tags'Junio C Hamano
The command line prompt (in contrib/) learned a new 'tag' style that can be specified with GIT_PS1_DESCRIBE_STYLE, to describe a detached HEAD with "git describe --tags". * mg/prompt-describe-tags: git-prompt: add a describe style for any tags
2017-03-21Merge branch 'jk/rev-parse-cleanup'Junio C Hamano
Code clean-up. * jk/rev-parse-cleanup: rev-parse: simplify parsing of ref options rev-parse: add helper for parsing "--foo/--foo=" rev-parse: use skip_prefix when parsing options
2017-03-21Prepare for 2.12.2Junio C Hamano
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2017-03-21Merge branch 'jh/send-email-one-cc' into maintJunio C Hamano
"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-21Merge branch 'jk/t6300-cleanup' into maintJunio C Hamano
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-21Merge branch 'rs/commit-parsing-optim' into maintJunio C Hamano
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-21Merge branch 'jk/show-branch-lift-name-len-limit' into maintJunio C Hamano
"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
2017-03-21Merge branch 'jk/tempfile-ferror-fclose-confusion' into maintJunio C Hamano
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()
2017-03-21Merge branch 'rl/remote-allow-missing-branch-name-merge' into maintJunio C Hamano
"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
2017-03-21Merge branch 'dt/gc-ignore-old-gc-logs' into maintJunio C Hamano
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
2017-03-21Merge branch 'jt/upload-pack-error-report' into maintJunio C Hamano
"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