summaryrefslogtreecommitdiff
AgeCommit message (Collapse)Author
2018-05-08Merge branch 'nd/warn-more-for-devs'Junio C Hamano
The build procedure "make DEVELOPER=YesPlease" learned to enable a bit more warning options depending on the compiler used to help developers more. There also is "make DEVOPTS=tokens" knob available now, for those who want to help fixing warnings we usually ignore, for example. * nd/warn-more-for-devs: Makefile: add a DEVOPTS to get all of -Wextra Makefile: add a DEVOPTS to suppress -Werror under DEVELOPER Makefile: detect compiler and enable more warnings in DEVELOPER=1 connect.c: mark die_initial_contact() NORETURN
2018-05-08Merge branch 'sb/object-store-replace'Junio C Hamano
The effort to pass the repository in-core structure throughout the API continues. This round deals with the code that implements the refs/replace/ mechanism. * sb/object-store-replace: replace-object: allow lookup_replace_object to handle arbitrary repositories replace-object: allow do_lookup_replace_object to handle arbitrary repositories replace-object: allow prepare_replace_object to handle arbitrary repositories refs: allow for_each_replace_ref to handle arbitrary repositories refs: store the main ref store inside the repository struct replace-object: add repository argument to lookup_replace_object replace-object: add repository argument to do_lookup_replace_object replace-object: add repository argument to prepare_replace_object refs: add repository argument to for_each_replace_ref refs: add repository argument to get_main_ref_store replace-object: check_replace_refs is safe in multi repo environment replace-object: eliminate replace objects prepared flag object-store: move lookup_replace_object to replace-object.h replace-object: move replace_map to object store replace_object: use oidmap
2018-05-08Merge branch 'ds/commit-graph'Junio C Hamano
Precompute and store information necessary for ancestry traversal in a separate file to optimize graph walking. * ds/commit-graph: commit-graph: implement "--append" option commit-graph: build graph from starting commits commit-graph: read only from specific pack-indexes commit: integrate commit graph with commit parsing commit-graph: close under reachability commit-graph: add core.commitGraph setting commit-graph: implement git commit-graph read commit-graph: implement git-commit-graph write commit-graph: implement write_commit_graph() commit-graph: create git-commit-graph builtin graph: add commit graph design document commit-graph: add format document csum-file: refactor finalize_hashfile() method csum-file: rename hashclose() to finalize_hashfile()
2018-05-08Merge branch 'js/empty-config-section-fix'Junio C Hamano
"git config --unset a.b", when "a.b" is the last variable in an otherwise empty section "a", left an empty section "a" behind, and worse yet, a subsequent "git config a.c value" did not reuse that empty shell and instead created a new one. These have been (partially) corrected. * js/empty-config-section-fix: git_config_set: reuse empty sections git config --unset: remove empty sections (in the common case) git_config_set: make use of the config parser's event stream git_config_set: do not use a state machine config_set_store: rename some fields for consistency config: avoid using the global variable `store` config: introduce an optional event stream while parsing t1300: `--unset-all` can leave an empty section behind (bug) t1300: add a few more hairy examples of sections becoming empty t1300: remove unreasonable expectation from TODO t1300: avoid relying on a bug config --replace-all: avoid extra line breaks t1300: demonstrate that --replace-all can "invent" newlines t1300: rename it to reflect that `repo-config` was deprecated git_config_set: fix off-by-two
2018-05-08Merge branch 'ot/libify-get-ref-atom-value'Junio C Hamano
Code restructuring, in preparation for further work. * ot/libify-get-ref-atom-value: ref-filter: libify get_ref_atom_value() ref-filter: add return value to parsers ref-filter: change parsing function error handling ref-filter: add return value && strbuf to handlers ref-filter: start adding strbufs with errors ref-filter: add shortcut to work with strbufs
2018-05-08Merge branch 'sb/submodule-move-nested'Junio C Hamano
Moving a submodule that itself has submodule in it with "git mv" forgot to make necessary adjustment to the nested sub-submodules; now the codepath learned to recurse into the submodules. * sb/submodule-move-nested: submodule: fixup nested submodules after moving the submodule submodule-config: remove submodule_from_cache submodule-config: add repository argument to submodule_from_{name, path} submodule-config: allow submodule_free to handle arbitrary repositories grep: remove "repo" arg from non-supporting funcs submodule.h: drop declaration of connect_work_tree_and_git_dir
2018-05-08Merge branch 'dj/runtime-prefix'Junio C Hamano
A build-time option has been added to allow Git to be told to refer to its associated files relative to the main binary, in the same way that has been possible on Windows for quite some time, for Linux, BSDs and Darwin. * dj/runtime-prefix: Makefile: quote $INSTLIBDIR when passing it to sed Makefile: remove unused @@PERLLIBDIR@@ substitution variable mingw/msvc: use the new-style RUNTIME_PREFIX helper exec_cmd: provide a new-style RUNTIME_PREFIX helper for Windows exec_cmd: RUNTIME_PREFIX on some POSIX systems Makefile: add Perl runtime prefix support Makefile: generate Perl header from template file
2018-05-08Merge branch 'ab/simplify-perl-makefile'Junio C Hamano
Recent simplification of build procedure forgot a bit of tweak to the build procedure of contrib/mw-to-git/ * ab/simplify-perl-makefile: Makefile: mark perllibdir as a .PHONY target perl: fix installing modules from contrib
2018-05-08Merge branch 'bw/protocol-v2'Junio C Hamano
The beginning of the next-gen transfer protocol. * bw/protocol-v2: (35 commits) remote-curl: don't request v2 when pushing remote-curl: implement stateless-connect command http: eliminate "# service" line when using protocol v2 http: don't always add Git-Protocol header http: allow providing extra headers for http requests remote-curl: store the protocol version the server responded with remote-curl: create copy of the service name pkt-line: add packet_buf_write_len function transport-helper: introduce stateless-connect transport-helper: refactor process_connect_service transport-helper: remove name parameter connect: don't request v2 when pushing connect: refactor git_connect to only get the protocol version once fetch-pack: support shallow requests fetch-pack: perform a fetch using v2 upload-pack: introduce fetch server command push: pass ref prefixes when pushing fetch: pass ref prefixes when fetching ls-remote: pass ref prefixes when requesting a remote's refs transport: convert transport_get_remote_refs to take a list of ref prefixes ...
2018-05-08mailmap: update brian m. carlson's email addressbrian m. carlson
An earlier change, cdb6b5ac (".mailmap: Combine more (name, email) to individual persons", 2013-08-12), noted that there were two name spellings and two email addresses and mapped the crustytoothpaste.net address to the crustytoothpaste.ath.cx address. The latter is an older, obsolete address, while the former is current, so switch the order of the addresses so that git log displays the correct address. Signed-off-by: brian m. carlson <sandals@crustytoothpaste.net> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2018-05-02coccinelle: avoid wrong transformation suggestions from commit.cocciSZEDER Gábor
The semantic patch 'contrib/coccinelle/commit.cocci' added in 2e27bd7731 (treewide: replace maybe_tree with accessor methods, 2018-04-06) is supposed to "ensure that all references to the 'maybe_tree' member of struct commit are either mutations or accesses through get_commit_tree()". So get_commit_tree() clearly must be able to directly access the 'maybe_tree' member, and 'commit.cocci' has a bit of a roundabout workaround to ensure that get_commit_tree()'s direct access in its return statement is not transformed: after all references to 'maybe_tree' have been transformed to a call to get_commit_tree(), including the reference in get_commit_tree() itself, the last rule transforms back a 'return get_commit_tree()' statement, back then found only in get_commit_tree() itself, to a direct access. Unfortunately, already the very next commit shows that this workaround is insufficient: 7b8a21dba1 (commit-graph: lazy-load trees for commits, 2018-04-06) extends get_commit_tree() with a condition directly accessing the 'maybe_tree' member, and Coccinelle with 'commit.cocci' promptly detects it and suggests a transformation to avoid it. This transformation is clearly wrong, because calling get_commit_tree() to access 'maybe_tree' _in_ get_commit_tree() would obviously lead to recursion. Furthermore, the same commit added another, more specialized getter function get_commit_tree_in_graph(), whose legitimate direct access to 'maybe_tree' triggers a similar wrong transformation suggestion. Exclude both of these getter functions from the general rule in 'commit.cocci' that matches their direct accesses to 'maybe_tree'. Also exclude load_tree_for_commit(), which, as static helper funcion of get_commit_tree_in_graph(), has legitimate direct access to 'maybe_tree' as well. The last rule transforming back 'return get_commit_tree()' statements to direct accesses thus became unnecessary, remove it. Signed-off-by: SZEDER Gábor <szeder.dev@gmail.com> Acked-by: Derrick Stolee <dstolee@microsoft.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2018-04-25The fourth batch for 2.18Junio C Hamano
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2018-04-25Merge branch 'jm/mem-pool'Junio C Hamano
An reusable "memory pool" implementation has been extracted from fast-import.c, which in turn has become the first user of the mem-pool API. * jm/mem-pool: mem-pool: move reusable parts of memory pool into its own file fast-import: introduce mem_pool type fast-import: rename mem_pool type to mp_block
2018-04-25Merge branch 'tg/use-git-contacts'Junio C Hamano
Doc update. * tg/use-git-contacts: SubmittingPatches: mention the git contacts command
2018-04-25Merge branch 'sb/filenames-with-dashes'Junio C Hamano
Rename bunch of source files to more consistently use dashes instead of underscores to connect words. * sb/filenames-with-dashes: replace_object.c: rename to use dash in file name sha1_file.c: rename to use dash in file name sha1_name.c: rename to use dash in file name exec_cmd: rename to use dash in file name unicode_width.h: rename to use dash in file name write_or_die.c: rename to use dashes in file name
2018-04-25Merge branch 'cc/perf-bisect'Junio C Hamano
Performance measuring framework in t/perf learned to help bisecting performance regressions. * cc/perf-bisect: t/perf: add scripts to bisect performance regressions perf/run: add --subsection option
2018-04-25Merge branch 'bp/fsmonitor-prime-index'Junio C Hamano
The index file is updated to record the fsmonitor section after a full scan was made, to avoid wasting the effort that has already spent. * bp/fsmonitor-prime-index: fsmonitor: force index write after full scan
2018-04-25Merge branch 'bp/fsmonitor-bufsize-fix'Junio C Hamano
Fix an unexploitable (because the oversized contents are not under attacker's control) buffer overflow. * bp/fsmonitor-bufsize-fix: fsmonitor: fix incorrect buffer size when printing version number
2018-04-25Merge branch 'cb/bash-completion-ls-files-processing'Junio C Hamano
Shell completion (in contrib) that gives list of paths have been optimized somewhat. * cb/bash-completion-ls-files-processing: completion: improve ls-files filter performance
2018-04-25Merge branch 'es/worktree-docs'Junio C Hamano
Doc updates. * es/worktree-docs: git-worktree.txt: unify command-line prompt in example blocks git-worktree.txt: recommend 'git worktree remove' over manual deletion
2018-04-25Merge branch 'es/fread-reads-dir-autoconf-fix'Junio C Hamano
Small fix to the autoconf build procedure. * es/fread-reads-dir-autoconf-fix: configure.ac: fix botched FREAD_READS_DIRECTORIES check
2018-04-25Merge branch 'ps/test-chmtime-get'Junio C Hamano
Test cleanup. * ps/test-chmtime-get: t/helper: 'test-chmtime (--get|-g)' to print only the mtime
2018-04-25Merge branch 'js/t5404-path-fix'Junio C Hamano
Test fix. * js/t5404-path-fix: t5404: relax overzealous test
2018-04-25Merge branch 'jk/ref-array-push'Junio C Hamano
API clean-up aournd ref-filter code. * jk/ref-array-push: ref-filter: factor ref_array pushing into its own function ref-filter: make ref_array_item allocation more consistent ref-filter: use "struct object_id" consistently
2018-04-25Merge branch 'en/doc-typoes'Junio C Hamano
Docfix. * en/doc-typoes: Documentation: normalize spelling of 'normalised' Documentation: fix several one-character-off spelling errors
2018-04-25Merge branch 'lw/daemon-log-destination'Junio C Hamano
Recent introduction of "--log-destination" option to "git daemon" did not work well when the daemon was run under "--inetd" mode. * lw/daemon-log-destination: daemon.c: fix condition for redirecting stderr
2018-04-25Merge branch 'mn/send-email-credential-doc'Junio C Hamano
Doc update. * mn/send-email-credential-doc: send-email: simplify Gmail example in the documentation
2018-04-25Merge branch 'ak/bisect-doc-typofix'Junio C Hamano
Docfix. * ak/bisect-doc-typofix: Documentation/git-bisect.txt: git bisect term → git bisect terms
2018-04-25Merge branch 'br/mergetools-guiffy'Junio C Hamano
"git mergetools" learned talking to guiffy. * br/mergetools-guiffy: mergetools: add support for guiffy
2018-04-25Merge branch 'nd/worktree-move'Junio C Hamano
Test update. * nd/worktree-move: t2028: tighten grep expression to make "move worktree" test more robust
2018-04-25Merge branch 'ks/branch-list-detached-rebase-i'Junio C Hamano
"git branch --list" during an interrupted "rebase -i" now lets users distinguish the case where a detached HEAD is being rebased and a normal branch is being rebased. * ks/branch-list-detached-rebase-i: t3200: verify "branch --list" sanity when rebasing from detached HEAD branch --list: print useful info whilst interactive rebasing a detached HEAD
2018-04-25Merge branch 'jk/t5561-missing-curl'Junio C Hamano
Test fixes. * jk/t5561-missing-curl: t5561: skip tests if curl is not available t5561: drop curl stderr redirects
2018-04-25Merge branch 'bw/commit-partial-from-subdirectory-fix'Junio C Hamano
"cd sub/dir && git commit ../path" ought to record the changes to the file "sub/path", but this regressed long time ago. * bw/commit-partial-from-subdirectory-fix: commit: allow partial commits with relative paths
2018-04-25Merge branch 'jk/relative-directory-fix'Junio C Hamano
Some codepaths, including the refs API, get and keep relative paths, that go out of sync when the process does chdir(2). The chdir-notify API is introduced to let these codepaths adjust these cached paths to the new current directory. * jk/relative-directory-fix: refs: use chdir_notify to update cached relative paths set_work_tree: use chdir_notify add chdir-notify API trace.c: export trace_setup_key set_git_dir: die when setenv() fails
2018-04-25Merge branch 'jk/flockfile-stdio'Junio C Hamano
Code clean-up. * jk/flockfile-stdio: config: move flockfile() closer to unlocked functions
2018-04-25Merge branch 'pw/rebase-signoff'Junio C Hamano
"git rebase" has learned to honor "--signoff" option when using backends other than "am" (but not "--preserve-merges"). * pw/rebase-signoff: rebase --keep-empty: always use interactive rebase rebase -p: error out if --signoff is given rebase: extend --signoff support
2018-04-25Merge branch 'pw/rebase-keep-empty-fixes'Junio C Hamano
"git rebase --keep-empty" still removed an empty commit if the other side contained an empty commit (due to the "does an equivalent patch exist already?" check), which has been corrected. * pw/rebase-keep-empty-fixes: rebase: respect --no-keep-empty rebase -i --keep-empty: don't prune empty commits rebase --root: stop assuming squash_onto is unset
2018-04-25Merge branch 'cb/git-gui-ttk-style'Junio C Hamano
"git gui" has been taught to work with old versions of tk (like 8.5.7) that do not support "ttk::style theme use" as a way to query the current theme. * cb/git-gui-ttk-style: git-gui: workaround ttk:style theme use
2018-04-25Merge branch 'bp/git-gui-bind-kp-enter'Junio C Hamano
"git gui" performs commit upon CTRL/CMD+ENTER but the CTRL/CMD+KP_ENTER (i.e. enter key on the numpad) did not have the same key binding. It now does. * bp/git-gui-bind-kp-enter: git-gui: bind CTRL/CMD+numpad ENTER to do_commit
2018-04-25Merge branch 'bb/git-gui-ssh-key-files'Junio C Hamano
"git gui" learned that "~/.ssh/id_ecdsa.pub" and "~/.ssh/id_ed25519.pub" are also possible SSH key files. * bb/git-gui-ssh-key-files: git-gui: search for all current SSH key types
2018-04-24Avoid multiple PREFIX definitionsPhilip Oakley
The short and sweet PREFIX can be confused when used in many places. Rename both usages to better describe their purpose. EXEC_CMD_PREFIX is used in full to disambiguate it from the nearby GIT_EXEC_PATH. The PREFIX in sideband.c, while nominally independant of the exec_cmd PREFIX, does reside within libgit[1], so the definitions would clash when taken together with a PREFIX given on the command line for use by exec_cmd.c. Noticed when compiling Git for Windows using MSVC/Visual Studio [1] which reports the conflict beteeen the command line definition and the definition in sideband.c within the libgit project. [1] the libgit functions are brought into a single sub-project within the Visual Studio construction script provided in contrib, and hence uses a single command for both exec_cmd.c and sideband.c. Signed-off-by: Philip Oakley <philipoakley@iee.org> Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2018-04-24git_setup_gettext: plug memory leakJohannes Schindelin
The system_path() function returns a freshly-allocated string. We need to release it. Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2018-04-24gettext: avoid initialization if the locale dir is not presentJohannes Schindelin
The runtime of a simple `git.exe version` call on Windows is currently dominated by the gettext setup, adding a whopping ~150ms to the ~210ms total. Given that this cost is added to each and every git.exe invocation goes through common-main's invocation of git_setup_gettext(), and given that scripts have to call git.exe dozens, if not hundreds, of times, this is a substantial performance penalty. This is particularly pointless when considering that Git for Windows ships without localization (to keep the installer's size to a bearable ~34MB): all that time setting up gettext is for naught. To be clear, Git for Windows *needs* to be compiled with localization, for the following reasons: - to allow users to copy add-on localization in case they want it, and - to fix the nasty error message BUG: your vsnprintf is broken (returned -1) by using libgettext's override of vsnprintf() that does not share the behavior of msvcrt.dll's version of vsnprintf(). So let's be smart about it and skip setting up gettext if the locale directory is not even present. Since localization might be missing for not-yet-supported locales, this will not break anything. Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2018-04-24Makefile: quote $INSTLIBDIR when passing it to sedJonathan Nieder
f6a0ad4b (Makefile: generate Perl header from template file, 2018-04-10) moved code for generating the 'use lib' lines at the top of perl scripts from the $(SCRIPT_PERL_GEN) rule to a separate GIT-PERL-HEADER rule. This rule first populates INSTLIBDIR and then substitutes it into the GIT-PERL-HEADER using sed: INSTLIBDIR=... something ... sed -e 's=@@INSTLIBDIR@@='$$INSTLIBDIR'=g' $< > $@ Because $INSTLIBDIR is not surrounded by double quotes, the shell splits it at each space, causing errors if INSTLIBDIR contains an $IFS character: sed: 1: "s=@@INSTLIBDIR@@=/usr/l ...": unescaped newline inside substitute pattern Add back the missing double-quotes to make it work again. Signed-off-by: Jonathan Nieder <jrnieder@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2018-04-24Makefile: remove unused @@PERLLIBDIR@@ substitution variableJonathan Nieder
Junio noticed that this variable is not quoted correctly when it is passed to sed. As a shell-quoted string, it should be inside single-quotes like $(perllibdir_relative_SQ), not outside them like $INSTLIBDIR. In fact, this substitution variable is not used. Simplify by removing it. Reported-by: Junio C Hamano <gitster@pobox.com> Signed-off-by: Jonathan Nieder <jrnieder@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2018-04-24walker: drop fields of `struct walker` which are always 1Martin Ågren
After the previous commit, both users of `struct walker` set `get_tree`, `get_history` and `get_all` to 1. Drop those fields and simplify the walker implementation accordingly. Let's hope that any out-of-tree users will not mind this change. They should notice that the compilation fails as they try to set these fields. (If they do not set them, note that `get_http_walker()` leaves them undefined, so the behavior will have been undefined all the time.) Signed-off-by: Martin Ågren <martin.agren@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2018-04-24http-fetch: make `-a` standard behaviourMartin Ågren
This is a follow-up to a6c786fce8 (Mark http-fetch without -a as deprecated, 2011-08-23). For more than six years, we have been warning when `-a` is not provided, and the documentation has been saying that `-a` will become the default. It is a bit unclear what "default" means here. There is no such thing as `http-fetch --no-a`. But according to my searches, no-one has been asking on the mailing list how they should silence the warning and prepare for overriding the flipped default. So let's assume that everybody is happy with `-a`. They should be, since not using it may break the repo in such a way that Git itself is unable to fix it. Always behave as if `-a` was given. Since `-a` implies `-c` (get commit objects) and `-t` (get trees), all three options are now unnecessary. Document all of these as historical artefacts that have no effect. Leave no-op code for handling these options in http-fetch.c. The options-handling is currently rather loose. If someone tightens it, we will not want these ignored options to accidentally turn into hard errors. Since `-a` was the only safe and sane usage and we have been pushing people towards it for a long time, refrain from warning when it is used "unnecessarily" now. Similarly, do not add anything scary-looking to the man-page about how it will be removed in the future. We can always do so later. (It is not like we are in desperate need of freeing up one-letter arguments.) Signed-off-by: Martin Ågren <martin.agren@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2018-04-24config: document the settings to colorize push errors/hintsJohannes Schindelin
Let's make it easier for users to find out how to customize these colors. Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2018-04-24push: test to verify that push errors are coloredJohannes Schindelin
This actually only tests whether the push errors/hints are colored if the respective color.* config settings are `always`, but in the regular case they default to `auto` (in which case we color the messages when stderr is connected to an interactive terminal), therefore these tests should suffice. Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2018-04-24push: colorize errorsRyan Dammrose
This is an attempt to resolve an issue I experience with people that are new to Git -- especially colleagues in a team setting -- where they miss that their push to a remote location failed because the failure and success both return a block of white text. An example is if I push something to a remote repository and then a colleague attempts to push to the same remote repository and the push fails because it requires them to pull first, but they don't notice because a success and failure both return a block of white text. They then continue about their business, thinking it has been successfully pushed. This patch colorizes the errors and hints (in red and yellow, respectively) so whenever there is a failure when pushing to a remote repository that fails, it is more noticeable. [jes: fixed a couple bugs, added the color.{advice,push,transport} settings, refactored to use want_color_stderr().] Signed-off-by: Ryan Dammrose ryandammrose@gmail.com Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de> Signed-off-by: Junio C Hamano <gitster@pobox.com>