AgeCommit message (Collapse)Author
2017-04-24Merge branch 'rs/misc-cppcheck-fixes'Junio C Hamano
Various small fixes. * rs/misc-cppcheck-fixes: server-info: avoid calling fclose(3) twice in update_info_file() files_for_each_reflog_ent_reverse(): close stream and free strbuf on error am: close stream on error, but not stdin
2017-04-24Merge branch 'jk/snprintf-cleanups'Junio C Hamano
Hotfix for a topic that is already in 'master'. * jk/snprintf-cleanups: replace: plug a memory leak
2017-04-24Merge branch 'xy/format-patch-base'Junio C Hamano
Doc cleanup. * xy/format-patch-base: doc: trivial typo in git-format-patch.txt
2017-04-24Merge branch 'sb/checkout-recurse-submodules'Junio C Hamano
Code cleanup. * sb/checkout-recurse-submodules: submodule: remove a superfluous second check for the "new" variable
2017-04-24Merge branch 'jt/fetch-pack-error-reporting'Junio C Hamano
"git fetch-pack" was not prepared to accept ERR packet that the upload-pack can send with a human-readable error message. It showed the packet contents with ERR prefix, so there was no data loss, but it was redundant to say "ERR" in an error message. * jt/fetch-pack-error-reporting: fetch-pack: show clearer error message upon ERR
2017-04-24Merge branch 'km/t1400-modernization'Junio C Hamano
Code cleanup. * km/t1400-modernization: t1400: use consistent style for test_expect_success calls
2017-04-24Merge branch 'jk/quarantine-received-objects'Junio C Hamano
Add finishing touches to a recent topic. * jk/quarantine-received-objects: refs: reject ref updates while GIT_QUARANTINE_PATH is set receive-pack: document user-visible quarantine effects receive-pack: drop tmp_objdir_env from run_update_hook
2017-04-24Merge branch 'jk/loose-object-fsck'Junio C Hamano
Code cleanup. * jk/loose-object-fsck: sha1_file: remove an used fd variable
2017-04-24Merge branch 'bw/submodule-with-bs-path'Junio C Hamano
"git submodule" script does not work well with strange pathnames. Protect it from a path with slashes in them, at least. * bw/submodule-with-bs-path: submodule: prevent backslash expantion in submodule names
2017-04-24Merge branch 'jh/verify-index-checksum-only-in-fsck'Junio C Hamano
The index file has a trailing SHA-1 checksum to detect file corruption, and historically we checked it every time the index file is used. Omit the validation during normal use, and instead verify only in "git fsck". * jh/verify-index-checksum-only-in-fsck: read-cache: force_verify_index_checksum
2017-04-24Merge branch 'jh/unpack-trees-micro-optim'Junio C Hamano
In a 2- and 3-way merge of trees, more than one source trees often end up sharing an identical subtree; optimize by not reading the same tree multiple times in such a case. * jh/unpack-trees-micro-optim: unpack-trees: avoid duplicate ODB lookups during checkout
2017-04-24Merge branch 'jh/string-list-micro-optim'Junio C Hamano
The string-list API used a custom reallocation strategy that was very inefficient, instead of using the usual ALLOC_GROW() macro, which has been fixed. * jh/string-list-micro-optim: string-list: use ALLOC_GROW macro when reallocing string_list
2017-04-24Merge branch 'nd/conditional-config-include'Junio C Hamano
$GIT_DIR may in some cases be normalized with all symlinks resolved while "gitdir" path expansion in the pattern does not receive the same treatment, leading to incorrect mismatch. This has been fixed. * nd/conditional-config-include: config: resolve symlinks in conditional include's patterns path.c: and an option to call real_path() in expand_user_path()
2017-04-24Merge branch 'dt/http-postbuffer-can-be-large'Junio C Hamano
Allow the http.postbuffer configuration variable to be set to a size that can be expressed in size_t, which can be larger than ulong on some platforms. * dt/http-postbuffer-can-be-large: http.postbuffer: allow full range of ssize_t values
2017-04-24Merge branch 'tb/doc-eol-normalization'Junio C Hamano
Doc update. * tb/doc-eol-normalization: gitattributes.txt: document how to normalize the line endings
2017-04-24Merge branch 'sr/http-proxy-configuration-fix'Junio C Hamano
"http.proxy" set to an empty string is used to disable the usage of proxy. We broke this early last year. * sr/http-proxy-configuration-fix: http: fix the silent ignoring of proxy misconfiguraion http: honor empty http.proxy option to bypass proxy
2017-04-24t/perf: correctly align non-ASCII descriptions in outputÆvar Arnfjörð Bjarmason
Change the test descriptions from being treated as binary blobs by perl to being treated as UTF-8. This ensures that e.g. a test description like "æ" is counted as 1 character, not 2. I have WIP performance tests for non-ASCII grep patterns on another topic that are affected by this. Now instead of: $ ./run [...] 0000.4: export a weird var 0.00(0.00+0.00) 0000.5: éḿíẗ ńöń-ÁŚĆÍÍ ćḧáŕáćẗéŕś 0.00(0.00+0.00) 0000.7: important variables available in subshells 0.00(0.00+0.00) [...] We emit: [...] 0000.4: export a weird var 0.00(0.00+0.00) 0000.5: éḿíẗ ńöń-ÁŚĆÍÍ ćḧáŕáćẗéŕś 0.00(0.00+0.00) 0000.7: important variables available in subshells 0.00(0.00+0.00) [...] Fixes code originally added in 342e9ef2d9 ("Introduce a performance testing framework", 2012-02-17). Signed-off-by: Ævar Arnfjörð Bjarmason <> Signed-off-by: Junio C Hamano <>
2017-04-24completion: optionally disable checkout DWIMJeff King
When we complete branch names for "git checkout", we also complete remote branch names that could trigger the DWIM behavior. Depending on your workflow and project, this can be either convenient or annoying. For instance, my clone of gitster.git contains 74 local "jk/*" branches, but origin contains another 147. When I want to checkout a local branch but can't quite remember the name, tab completion shows me 251 entries. And worse, for a topic that has been picked up for pu, the upstream branch name is likely to be similar to mine, leading to a high probability that I pick the wrong one and accidentally create a new branch. This patch adds a way for the user to tell the completion code not to include DWIM suggestions for checkout. This can already be done by typing: git checkout --no-guess jk/<TAB> but that's rather cumbersome. The downside, of course, is that you no longer get completion support when you _do_ want to invoke the DWIM behavior. But depending on your workflow, that may not be a big loss (for instance, in git.git I am much more likely to want to detach, so I'd type "git checkout origin/jk/<TAB>" anyway). Signed-off-by: Jeff King <> Reviewed-by: SZEDER Gábor <> Signed-off-by: Junio C Hamano <>
2017-04-24completion: expand "push --delete <remote> <ref>" for refs on that <remote>Ævar Arnfjörð Bjarmason
Change the completion of "push --delete <remote> <ref>" to complete refs on that <remote>, not all refs. Before this cloning git.git and doing "git push --delete origin p<TAB>" will complete nothing, since a fresh clone of git.git will have no "pu" branch, whereas origin/p<TAB> will uselessly complete origin/pu, but fully qualified references aren't accepted by "--delete". Now p<TAB> will complete as "pu". The completion of giving --delete later, e.g. "git push origin --delete p<TAB>" remains unchanged, this is a bug, but is a general existing limitation of the bash completion, and not how git-push is documented, so I'm not fixing that case, but adding a failing TODO test for it. The testing code was supplied by SZEDER Gábor in <> with minor setup modifications on my part. Signed-off-by: Ævar Arnfjörð Bjarmason <> Reviewed-by: SZEDER Gábor <> Test-code-by: SZEDER Gábor <> Signed-off-by: Junio C Hamano <>
2017-04-23l10n: sv.po: Update Swedish translation (3199t0f0u)Peter Krefting
Signed-off-by: Peter Krefting <>
2017-04-23l10n: git.pot: v2.13.0 round 1 (96 new, 37 removed)Jiang Xin
Generate po/git.pot from v2.13.0-rc0 for git v2.13.0 l10n round 1. Signed-off-by: Jiang Xin <>
2017-04-21docs/bisect-lk2009: update java code conventions linkJeff King
The old link just redirects to a big index page. I was able to find a new link for the original document via Google. Signed-off-by: Jeff King <> Signed-off-by: Junio C Hamano <>
2017-04-21docs/bisect-lk2009: update nist report linkJeff King
The original NIST press release linked here is no longer available. But it was just a one-page summary of a larger planning report; we can link to the report and point people to the executive summary, which contains the same information. Ideally we'd cite it with a DOI, but I couldn't dig one up for this particular document. I found many URLs pointing to this report, but they all end up redirecting to this one (and it looks somewhat official). Signed-off-by: Jeff King <> Signed-off-by: Junio C Hamano <>
2017-04-21docs/archimport: quote referenceJeff King
git-archimport has an option to register archives at The domain still exists, but that hostname no longer exists. That means this feature is presumably broken. I'll leave the examination and modification of that to people who might actually use archimport. But in the meantime, let's wrap the reference in the documentation in backticks, which will avoid turning it into a broken link (and thus polluting linkchecker results). Signed-off-by: Jeff King <> Signed-off-by: Junio C Hamano <>
2017-04-21gitcore-tutorial: update broken linkJeff King
The slides for the Linux-mentoring presentation are no longer available. Let's point to the wayback version of the page, which works. Note that the referenced diagram is also available on page 15 of [1]. We could link to that instead, but it's not clear from the URL scheme ("uploads") whether it's going to stick around forever. [1] Signed-off-by: Jeff King <> Signed-off-by: Junio C Hamano <>
2017-04-21doc: replace gitwiki link with King
The version of the Git wiki went away long ago, and now just redirects to Signed-off-by: Jeff King <> Signed-off-by: Junio C Hamano <>
2017-04-21doc: use https links to avoid http redirectJeff King
Many sites these days unconditionally redirect http requests to their https equivalents. Let's make our links https in the first place to save the client a redirect. Signed-off-by: Jeff King <> Signed-off-by: Junio C Hamano <>
2017-04-21connect.c: fix leak in handle_ssh_variantJeff King
When we see an error from split_cmdline(), we exit the function without freeing the copy of the command string we made. This was sort-of introduced by 22e5ae5c8 (connect.c: handle errors from split_cmdline, 2017-04-10). The leak existed before that, but before that commit fixed the bug, we could never trigger this else clause in the first place. Signed-off-by: Jeff King <> Signed-off-by: Junio C Hamano <>
2017-04-21am: drop "dir" parameter from am_state_initJeff King
The only caller of this function passes in a static buffer returned from git_path(). This looks dangerous at first glance, but turns out to be OK because the first thing we do is xstrdup() the result. Let's turn this into a git_pathdup(). That's slightly more efficient (no extra copy), and makes it easier to audit for dangerous git_path() invocations. Since there's only a single caller, let's just set this default path inside the init function. That makes the memory ownership clear. Signed-off-by: Jeff King <> Signed-off-by: Junio C Hamano <>
2017-04-21replace strbuf_addstr(git_path()) with git_path_buf()Jeff King
Writing directly into the strbuf avoids a useless copy of the data, and dropping calls to git_path() makes it easier to audit for dangerous calls. Note that git_path() does an implicit strbuf_reset(), but in each of these cases we were either already doing that reset, or writing into a fresh strbuf anyway. Signed-off-by: Jeff King <> Signed-off-by: Junio C Hamano <>
2017-04-21replace xstrdup(git_path(...)) with git_pathdup(...)Jeff King
It's more efficient to use git_pathdup(), as it skips an extra copy of the path. And by removing some calls to git_path(), it makes it easier to audit for dangerous uses. Signed-off-by: Jeff King <> Signed-off-by: Junio C Hamano <>
2017-04-21use git_path_* helper functionsJeff King
Long ago we added functions like git_path_merge_msg() to replace the more dangerous git_path("MERGE_MSG"). Over time some new calls to the latter have crept it. Let's convert them to use the safer form. Signed-off-by: Jeff King <> Signed-off-by: Junio C Hamano <>
2017-04-21branch: add edit_description() helperJeff King
Rather than have a variable with a short name that is fed to git_path(), let's add a helper function that returns the full path. This avoids the dangerous git_path() function. Signed-off-by: Jeff King <> Signed-off-by: Junio C Hamano <>
2017-04-21bisect: add git_path_bisect_terms helperJeff King
This avoids using the dangerous git_path(). Right now there's only one call site (because the writing half is still part of the shell script), but it may come in handy in the future as more of bisect is written in C. It also matches how we access the other BISECT_* files. Signed-off-by: Jeff King <> Signed-off-by: Junio C Hamano <>
2017-04-21read-cache: avoid using git_path() in freshen_shared_index()Christian Couder
When performing an interactive rebase in split-index mode, the commit message that one should rework when squashing commits can contain some garbage instead of the usual concatenation of both of the commit messages. The code uses git_path() to compute the shared index filename, and passes it to check_and_freshen_file() as its argument; there is no guarantee that the rotating pathname buffer passed as argument will stay valid during the life of this call. Make our own copy before calling the function and pass the copy as its argument to avoid this risky pattern. Signed-off-by: Christian Couder <> Signed-off-by: Junio C Hamano <>
2017-04-21worktree add: add --lock optionNguyễn Thái Ngọc Duy
As explained in the document. This option has an advantage over the command sequence "git worktree add && git worktree lock": there will be no gap that somebody can accidentally "prune" the new worktree (or soon, explicitly "worktree remove" it). "worktree add" does keep a lock on while it's preparing the worktree. If --lock is specified, this lock remains after the worktree is created. Suggested-by: David Taylor <> Signed-off-by: Nguyễn Thái Ngọc Duy <> Helped-by: Jeff King <> Signed-off-by: Junio C Hamano <>
2017-04-20Git 2.13-rc0v2.13.0-rc0Junio C Hamano
Signed-off-by: Junio C Hamano <>
2017-04-20Merge branch 'jh/memihash-opt'Junio C Hamano
Hotfix for a topic that is already in 'master'. * jh/memihash-opt: p0004: make perf test executable t3008: skip lazy-init test on a single-core box test-online-cpus: helper to return cpu count name-hash: fix buffer overrun
2017-04-20Merge branch 'vn/revision-shorthand-for-side-branch-log'Junio C Hamano
Doc cleanup. * vn/revision-shorthand-for-side-branch-log: doc/revisions: remove brackets from rev^-n shorthand
2017-04-20Merge branch 'sf/putty-w-args'Junio C Hamano
* sf/putty-w-args: connect.c: handle errors from split_cmdline
2017-04-20Merge branch 'ld/p4-current-branch-fix'Junio C Hamano
"git p4" used "name-rev HEAD" when it wants to learn what branch is checked out; it should use "symbolic-ref HEAD". * ld/p4-current-branch-fix: git-p4: don't use name-rev to get current branch git-p4: add read_pipe_text() internal function git-p4: add failing test for name-rev rather than symbolic-ref
2017-04-20Merge branch 'dt/gc-ignore-old-gc-logs'Junio C Hamano
* dt/gc-ignore-old-gc-logs: t6500: wait for detached auto gc at the end of the test script
2017-04-20Merge branch 'bw/attr-pathspec'Junio C Hamano
* bw/attr-pathspec: pathspec: fix segfault in clear_pathspec
2017-04-20Merge branch 'ab/grep-plug-pathspec-leak'Junio C Hamano
Call clear_pathspec() to release resources immediately before the cmd_grep() function returns. * ab/grep-plug-pathspec-leak: grep: plug a trivial memory leak
2017-04-20Merge branch 'jk/no-looking-at-dotgit-outside-repo'Junio C Hamano
Clean up fallouts from recent tightening of the set-up sequence, where Git barfs when repository information is accessed without first ensuring that it was started in a repository. * jk/no-looking-at-dotgit-outside-repo: test-read-cache: setup git dir has_sha1_file: don't bother if we are not in a repository
2017-04-20Merge branch 'nd/files-backend-git-dir'Junio C Hamano
The "submodule" specific field in the ref_store structure is replaced with a more generic "gitdir" that can later be used also when dealing with ref_store that represents the set of refs visible from the other worktrees. * nd/files-backend-git-dir: (28 commits) refs.h: add a note about sorting order of for_each_ref_* t1406: new tests for submodule ref store t1405: some basic tests on main ref store t/helper: add test-ref-store to test ref-store functions refs: delete pack_refs() in favor of refs_pack_refs() files-backend: avoid ref api targeting main ref store refs: new transaction related ref-store api refs: add new ref-store api refs: rename get_ref_store() to get_submodule_ref_store() and make it public files-backend: replace submodule_allowed check in files_downcast() refs: move submodule code out of files-backend.c path.c: move some code out of strbuf_git_path_submodule() refs.c: make get_main_ref_store() public and use it refs.c: kill register_ref_store(), add register_submodule_ref_store() refs.c: flatten get_ref_store() a bit refs: rename lookup_ref_store() to lookup_submodule_ref_store() refs.c: introduce get_main_ref_store() files-backend: remove the use of git_path() files-backend: add and use files_ref_path() files-backend: add and use files_reflog_path() ...
2017-04-20Merge branch 'bw/submodule-is-active'Junio C Hamano
Error message fix. * bw/submodule-is-active: submodule--helper: fix typo in is_active error message
2017-04-20Merge branch 'va/i18n-perl-scripts'Junio C Hamano
Message fix. * va/i18n-perl-scripts: git-add--interactive.perl: add missing dot in a message
2017-04-20Merge branch 'sb/submodule-rm-absorb'Junio C Hamano
Error message fix. * sb/submodule-rm-absorb: submodule.c: add missing ' in error messages
2017-04-20Merge branch 'ah/diff-files-ours-theirs-doc'Junio C Hamano
The diff options "--ours", "--theirs" exist for quite some time. But so far they were not documented. Now they are. * ah/diff-files-ours-theirs-doc: diff-files: document --ours etc.