summaryrefslogtreecommitdiff
AgeCommit message (Collapse)Author
2017-06-24wildmatch: remove unused wildopts parameterÆvar Arnfjörð Bjarmason
Remove the unused wildopts placeholder struct from being passed to all wildmatch() invocations, or rather remove all the boilerplate NULL parameters. This parameter was added back in commit 9b3497cab9 ("wildmatch: rename constants and update prototype", 2013-01-01) as a placeholder for future use. Over 4 years later nothing has made use of it, let's just remove it. It can be added in the future if we find some reason to start using such a parameter. Signed-off-by: Ævar Arnfjörð Bjarmason <avarab@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2017-06-22Tenth batch for 2.14Junio C Hamano
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2017-06-22Merge branch 'rs/strbuf-addftime-zZ'Junio C Hamano
As there is no portable way to pass timezone information to strftime, some output format from "git log" and friends are impossible to produce. Teach our own strbuf_addftime to replace %z and %Z with caller-supplied values to help working around this. * rs/strbuf-addftime-zZ: date: use localtime() for "-local" time formats t0006: check --date=format zone offsets strbuf: let strbuf_addftime handle %z and %Z itself
2017-06-22Merge branch 'sd/t3200-branch-m-test'Junio C Hamano
New test. * sd/t3200-branch-m-test: t3200: add test for single parameter passed to -m option
2017-06-22Merge branch 'ps/stash-push-pathspec-fix'Junio C Hamano
"git stash push <pathspec>" did not work from a subdirectory at all. Bugfix for a topic in v2.13 * ps/stash-push-pathspec-fix: git-stash: fix pushing stash with pathspec from subdir
2017-06-22Merge branch 'ls/github'Junio C Hamano
Help contributors that visit us at GitHub. * ls/github: Configure Git contribution guidelines for github.com
2017-06-22Merge branch 'sg/revision-parser-skip-prefix'Junio C Hamano
Code clean-up. * sg/revision-parser-skip-prefix: revision.c: use skip_prefix() in handle_revision_pseudo_opt() revision.c: use skip_prefix() in handle_revision_opt() revision.c: stricter parsing of '--early-output' revision.c: stricter parsing of '--no-{min,max}-parents' revision.h: turn rev_info.early_output back into an unsigned int
2017-06-22Merge branch 'mh/fast-import-raise-default-depth'Junio C Hamano
"fast-import" uses a default pack chain depth that is consistent with other parts of the system. * mh/fast-import-raise-default-depth: fast-import: increase the default pack depth to 50
2017-06-22Merge branch 'km/test-mailinfo-b-failure'Junio C Hamano
New tests. * km/test-mailinfo-b-failure: t5100: add some more mailinfo tests
2017-06-22Merge branch 'ah/filter-branch-setup'Junio C Hamano
"filter-branch" learned a pseudo filter "--setup" that can be used to define a common function/variable that can be used by other filters. * ah/filter-branch-setup: filter-branch: add [--] to usage filter-branch: add `--setup` step
2017-06-22Merge branch 'pc/dir-count-slashes'Junio C Hamano
Three instances of the same helper function have been consolidated to one. * pc/dir-count-slashes: dir: create function count_slashes()
2017-06-22Merge branch 'sb/t4005-modernize'Junio C Hamano
Test clean-up. * sb/t4005-modernize: t4005: modernize style and drop hard coded sha1
2017-06-22Merge branch 'nd/fopen-errors'Junio C Hamano
Hotfix for a topic that is already in 'master'. * nd/fopen-errors: configure.ac: loosen FREAD_READS_DIRECTORIES test program
2017-06-19Ninth batch for 2.14Junio C Hamano
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2017-06-19Merge branch 'jk/consistent-h'Junio C Hamano
"git $cmd -h" for builtin commands calls the implementation of the command (i.e. cmd_$cmd() function) without doing any repository set-up, and the commands that expect RUN_SETUP is done by the Git potty needs to be prepared to show the help text without barfing. * jk/consistent-h: t0012: test "-h" with builtins git: add hidden --list-builtins option version: convert to parse-options diff- and log- family: handle "git cmd -h" early submodule--helper: show usage for "-h" remote-{ext,fd}: print usage message on invalid arguments upload-archive: handle "-h" option early credential: handle invalid arguments earlier
2017-06-19Merge branch 'ab/perf-remove-index-lock'Junio C Hamano
When an existing repository is used for t/perf testing, we first create bit-for-bit copy of it, which may grab a transient state of the repository and freeze it into the repository used for testing, which then may cause Git operations to fail. Single out "the index being locked" case and forcibly drop the lock from the copy. * ab/perf-remove-index-lock: perf: work around the tested repo having an index.lock
2017-06-19Merge branch 'bw/object-id'Junio C Hamano
Conversion from uchar[20] to struct object_id continues. * bw/object-id: (33 commits) diff: rename diff_fill_sha1_info to diff_fill_oid_info diffcore-rename: use is_empty_blob_oid tree-diff: convert path_appendnew to object_id tree-diff: convert diff_tree_paths to struct object_id tree-diff: convert try_to_follow_renames to struct object_id builtin/diff-tree: cleanup references to sha1 diff-tree: convert diff_tree_sha1 to struct object_id notes-merge: convert write_note_to_worktree to struct object_id notes-merge: convert verify_notes_filepair to struct object_id notes-merge: convert find_notes_merge_pair_ps to struct object_id notes-merge: convert merge_from_diffs to struct object_id notes-merge: convert notes_merge* to struct object_id tree-diff: convert diff_root_tree_sha1 to struct object_id combine-diff: convert find_paths_* to struct object_id combine-diff: convert diff_tree_combined to struct object_id diff: convert diff_flush_patch_id to struct object_id patch-ids: convert to struct object_id diff: finish conversion for prepare_temp_file to struct object_id diff: convert reuse_worktree_file to struct object_id diff: convert fill_filespec to struct object_id ...
2017-06-19Merge branch 'sb/submodule-rm-absorb'Junio C Hamano
Doc update to a recently graduated topic. * sb/submodule-rm-absorb: Documentation/git-rm: correct submodule description
2017-06-19Merge branch 'ab/pcre-v2'Junio C Hamano
Update "perl-compatible regular expression" support to enable JIT and also allow linking with the newer PCRE v2 library. * ab/pcre-v2: grep: add support for PCRE v2 grep: un-break building with PCRE >= 8.32 without --enable-jit grep: un-break building with PCRE < 8.20 grep: un-break building with PCRE < 8.32 grep: add support for the PCRE v1 JIT API log: add -P as a synonym for --perl-regexp grep: skip pthreads overhead when using one thread grep: don't redundantly compile throwaway patterns under threading
2017-06-19Merge branch 'jk/pathspec-magic-disambiguation'Junio C Hamano
The convention for a command line is to follow "git cmdname --options" with revisions followed by an optional "--" disambiguator and then finally pathspecs. When "--" is not there, we make sure early ones are all interpretable as revs (and do not look like paths) and later ones are the other way around. A pathspec with "magic" (e.g. ":/p/a/t/h" that matches p/a/t/h from the top-level of the working tree, no matter what subdirectory you are working from) are conservatively judged as "not a path", which required disambiguation more often. The command line parser learned to say "it's a pathspec" a bit more often when the syntax looks like so. * jk/pathspec-magic-disambiguation: verify_filename(): flip order of checks verify_filename(): treat ":(magic)" as a pathspec check_filename(): handle ":^" path magic check_filename(): use skip_prefix check_filename(): refactor ":/" handling t4208: add check for ":/" without matching file
2017-06-15date: use localtime() for "-local" time formatsJeff King
When we convert seconds-since-epochs timestamps into a broken-down "struct tm", we do so by adjusting the timestamp according to the known offset and then using gmtime() to break down the result. This means that the resulting struct "knows" that it's in GMT, even though the time it represents is adjusted for a different zone. The fields where it stores this data are not portably accessible, so we have no way to override them to tell them the real zone info. For the most part, this works. Our date-formatting routines don't pay attention to these inaccessible fields, and use the same tz info we provided for adjustment. The one exception is when we call strftime(), whose %Z format reveals this hidden timezone data. We solved that by always showing the empty string for %Z. This is allowed by POSIX, but not very helpful to the user. We can't make this work in the general case, as there's no portable function for setting an arbitrary timezone (and anyway, we don't have the zone name for the author zones, only their offsets). But for the special case of the "-local" formats, we can just skip the adjustment and use localtime() instead of gmtime(). This makes --date=format-local:%Z work correctly, showing the local timezone instead of an empty string. The new test checks the result for "UTC", our default test-lib value for $TZ. Using something like EST5 might be more interesting, but the actual zone string is system-dependent (for instance, on my system it expands to just EST). Hopefully "UTC" is vanilla enough that every system treats it the same. Signed-off-by: Jeff King <peff@peff.net> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2017-06-15t0006: check --date=format zone offsetsJeff King
We already test that "%z" and "%Z" show the right thing, but we don't actually check that the time we display is the correct one. Let's add two new tests: 1. Test that "format:" shows the time in the author's timezone, just like the other time formats. 2. Test that "format-local:" shows time in the local timezone. We don't want to use our normal UTC for this, because its offset is zero (so the result would be "correct" even if the code forgot to apply the offset or applied it in the wrong direction). We'll use the EST5 zone, which is already used elsewhere in the script (and so is assumed to be available everywhere). Signed-off-by: Jeff King <peff@peff.net> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2017-06-15strbuf: let strbuf_addftime handle %z and %Z itselfRené Scharfe
There is no portable way to pass timezone information to strftime. Add parameters for timezone offset and name to strbuf_addftime and let it handle the timezone-related format specifiers %z and %Z internally. Callers can opt out for %Z by passing NULL as timezone name. %z is always handled internally -- this helps on Windows, where strftime would expand it to a timezone name (same as %Z), in violation of POSIX. Modifiers are not handled, e.g. %Ez is still passed to strftime. Use an empty string as timezone name in show_date (the only current caller) for now because we only have the timezone offset in non-local mode. POSIX allows %Z to resolve to an empty string in case of missing information. Helped-by: Ulrich Mueller <ulm@gentoo.org> Helped-by: Jeff King <peff@peff.net> Signed-off-by: Rene Scharfe <l.s.r@web.de> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2017-06-15sub-process: correct path to API docs in a commentChristian Couder
Signed-off-by: Christian Couder <chriscool@tuxfamily.org> Acked-by: Ben Peart <peartben@gmail.com> Reviewed-by: Jonathan Nieder <jrnieder@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2017-06-15Merge branch 'svn-doc' of git://bogomips.org/git-svnJunio C Hamano
* 'svn-doc' of git://bogomips.org/git-svn: git-svn: document special options for commit-diff
2017-06-15configure.ac: loosen FREAD_READS_DIRECTORIES test programJeff King
We added an FREAD_READS_DIRECTORIES Makefile knob long ago in cba22528f (Add compat/fopen.c which returns NULL on attempt to open directory, 2008-02-08) to handle systems where reading from a directory returned garbage. This works by catching the problem at the fopen() stage and returning NULL. More recently, we found that there is a class of systems (including Linux) where fopen() succeeds but fread() fails. Since the solution is the same (having fopen return NULL), they use the same Makefile knob as of e2d90fd1c (config.mak.uname: set FREAD_READS_DIRECTORIES for Linux and FreeBSD, 2017-05-03). This works fine except for one thing: the autoconf test in configure.ac to set FREAD_READS_DIRECTORIES actually checks whether fread succeeds. Which means that on Linux systems, the knob isn't set (and we even override the config.mak.uname default). t1308 catches the failure. We can fix this by tweaking the autoconf test to cover both cases. In theory we might care about the distinction between the traditional "fread reads directories" case and the new "fopen opens directories". But since our solution catches the problem at the fopen stage either way, we don't actually need to know the difference. The "fopen" case is a superset. This does mean the FREAD_READS_DIRECTORIES name is slightly misleading. Probably FOPEN_OPENS_DIRECTORIES would be more accurate. But it would be disruptive to simply change the name (people's existing build configs would fail), and it's not worth the complexity of handling both. Let's just add a comment in the knob description. Reported-by: Øyvind A. Holm <sunny@sunbase.org> Signed-off-by: Jeff King <peff@peff.net> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2017-06-15git-svn: document special options for commit-diffAndreas Heiduk
Some options specific for `git svn commit-diff` where not documented so far. Signed-off-by: Andreas Heiduk <asheiduk@gmail.com> Signed-off-by: Eric Wong <e@80x24.org>
2017-06-13Sync with maintJunio C Hamano
2017-06-13Eighth batch for 2.14Junio C Hamano
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2017-06-13Merge branch 'jk/pack-idx-corruption-safety'Junio C Hamano
A flaky test has been corrected. * jk/pack-idx-corruption-safety: t5313: make extended-table test more deterministic
2017-06-13Merge branch 'nd/fopen-errors'Junio C Hamano
We often try to open a file for reading whose existence is optional, and silently ignore errors from open/fopen; report such errors if they are not due to missing files. * nd/fopen-errors: mingw_fopen: report ENOENT for invalid file names mingw: verify that paths are not mistaken for remote nicknames log: fix memory leak in open_next_file() rerere.c: move error_errno() closer to the source system call print errno when reporting a system call error wrapper.c: make warn_on_inaccessible() static wrapper.c: add and use fopen_or_warn() wrapper.c: add and use warn_on_fopen_errors() config.mak.uname: set FREAD_READS_DIRECTORIES for Darwin, too config.mak.uname: set FREAD_READS_DIRECTORIES for Linux and FreeBSD clone: use xfopen() instead of fopen() use xfopen() in more places git_fopen: fix a sparse 'not declared' warning
2017-06-13Merge branch 'rf/completion'Junio C Hamano
Completion updates. * rf/completion: completion: add git config credentialCache.ignoreSIGHUP completion: add git config credential completions completion: add git config advice completions completion: add git config am.threeWay completion completion: add git config core completions completion: add git config gc completions
2017-06-13Merge branch 'jc/diff-tree-stale-comment'Junio C Hamano
Comment fix. * jc/diff-tree-stale-comment: diff-tree: update stale in-code comments
2017-06-13Merge branch 'sb/submodule-blanket-recursive'Junio C Hamano
Many commands learned to pay attention to submodule.recurse configuration. * sb/submodule-blanket-recursive: builtin/fetch.c: respect 'submodule.recurse' option builtin/push.c: respect 'submodule.recurse' option builtin/grep.c: respect 'submodule.recurse' option Introduce 'submodule.recurse' option for worktree manipulators submodule loading: separate code path for .gitmodules and config overlay reset/checkout/read-tree: unify config callback for submodule recursion submodule test invocation: only pass additional arguments submodule recursing: do not write a config variable twice
2017-06-13Merge branch 'jc/noent-notdir'Junio C Hamano
Our code often opens a path to an optional file, to work on its contents when we can successfully open it. We can ignore a failure to open if such an optional file does not exist, but we do want to report a failure in opening for other reasons (e.g. we got an I/O error, or the file is there, but we lack the permission to open). The exact errors we need to ignore are ENOENT (obviously) and ENOTDIR (less obvious). Instead of repeating comparison of errno with these two constants, introduce a helper function to do so. * jc/noent-notdir: treewide: use is_missing_file_error() where ENOENT and ENOTDIR are checked compat-util: is_missing_file_error()
2017-06-13Prepare for 2.13.2Junio C Hamano
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2017-06-13Merge branch 'ad/pull-remote-doc' into maintJunio C Hamano
Docfix. * ad/pull-remote-doc: docs: fix formatting and grammar
2017-06-13Merge branch 'jk/drop-free-refspecs' into maintJunio C Hamano
Code clean-up. * jk/drop-free-refspecs: remote: drop free_refspecs() function
2017-06-13Merge branch 'jk/connect-symref-info-leak-fix' into maintJunio C Hamano
Leakfix. * jk/connect-symref-info-leak-fix: connect.c: fix leak in parse_one_symref_info()
2017-06-13Merge branch 'rf/completion-config-commit' into maintJunio C Hamano
Completion update. * rf/completion-config-commit: completion: add completions for git config commit
2017-06-13Merge branch 'ab/t3070-test-dedup' into maintJunio C Hamano
Test cleanup. * ab/t3070-test-dedup: wildmatch test: remove redundant duplicate test
2017-06-13Merge branch 'jh/memihash-opt' into maintJunio C Hamano
perf-test update. * jh/memihash-opt: p0004: don't error out if test repo is too small p0004: don't abort if multi-threaded is too slow p0004: use test_perf p0004: avoid using pipes p0004: simplify calls of test-lazy-init-name-hash
2017-06-13Merge branch 'tb/pull-ff-rebase-autostash' into maintJunio C Hamano
"git pull --rebase --autostash" didn't auto-stash when the local history fast-forwards to the upstream. * tb/pull-ff-rebase-autostash: pull: ff --rebase --autostash works in dirty repo
2017-06-13Merge branch 'jh/close-index-before-stat' into maintJunio C Hamano
The timestamp of the index file is now taken after the file is closed, to help Windows, on which a stale timestamp is reported by fstat() on a file that is opened for writing and data was written but not yet closed. * jh/close-index-before-stat: read-cache: close index.lock in do_write_index
2017-06-13Merge branch 'sl/clean-d-ignored-fix' into maintJunio C Hamano
"git clean -d" used to clean directories that has ignored files, even though the command should not lose ignored ones without "-x". "git status --ignored" did not list ignored and untracked files without "-uall". These have been corrected. * sl/clean-d-ignored-fix: clean: teach clean -d to preserve ignored paths dir: expose cmp_name() and check_contains() dir: hide untracked contents of untracked dirs dir: recurse into untracked dirs for ignored files t7061: status --ignored should search untracked dirs t7300: clean -d should skip dirs with ignored files
2017-06-13Merge branch 'dk/send-email-avoid-net-smtp-ssl-when-able' into maintJunio C Hamano
A hotfix to a topic in 'master'. * dk/send-email-avoid-net-smtp-ssl-when-able: send-email: Net::SMTP::starttls was introduced in v2.34 send-email: Net::SMTP::SSL is obsolete, use only when necessary
2017-06-13Merge branch 'jc/skip-test-in-the-middle' into maintJunio C Hamano
A recent update to t5545-push-options.sh started skipping all the tests in the script when a web server testing is disabled or unavailable, not just the ones that require a web server. Non HTTP tests have been salvaged to always run in this script. * jc/skip-test-in-the-middle: t5545: enhance test coverage when no http server is installed test: allow skipping the remainder
2017-06-13Merge branch 'bw/forking-and-threading' into maintJunio C Hamano
The "run-command" API implementation has been made more robust against dead-locking in a threaded environment. * bw/forking-and-threading: usage.c: drop set_error_handle() run-command: restrict PATH search to executable files run-command: expose is_executable function run-command: block signals between fork and execve run-command: add note about forking and threading run-command: handle dup2 and close errors in child run-command: eliminate calls to error handling functions in child run-command: don't die in child when duping /dev/null run-command: prepare child environment before forking string-list: add string_list_remove function run-command: use the async-signal-safe execv instead of execvp run-command: prepare command before forking t0061: run_command executes scripts without a #! line t5550: use write_script to generate post-update hook
2017-06-13Merge branch 'jk/bug-to-abort' into maintJunio C Hamano
Introduce the BUG() macro to improve die("BUG: ..."). * jk/bug-to-abort: usage: add NORETURN to BUG() function definitions config: complain about --local outside of a git repo setup_git_env: convert die("BUG") to BUG() usage.c: add BUG() function
2017-06-13Merge branch 'sb/checkout-recurse-submodules' into maintJunio C Hamano
"git checkout --recurse-submodules" did not quite work with a submodule that itself has submodules. * sb/checkout-recurse-submodules: submodule: properly recurse for read-tree and checkout submodule: avoid auto-discovery in new working tree manipulator code submodule_move_head: reuse child_process structure for futher commands