summaryrefslogtreecommitdiff
AgeCommit message (Collapse)AuthorFilesLines
2017-03-21Merge branch 'nd/commit-hook-doc-fix'Libravatar Junio C Hamano1-1/+1
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'Libravatar Junio C Hamano1-0/+2
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'Libravatar Junio C Hamano2-2/+2
Doc fix. * ab/doc-no-option-notation-fix: doc: change erroneous --[no]-whatever into --[no-]whatever
2017-03-21Merge branch 'sb/wt-status-cleanup'Libravatar Junio C Hamano1-15/+5
Code clean-up. * sb/wt-status-cleanup: wt-status: simplify by using for_each_string_list_item
2017-03-21Merge branch 'js/rebase-helper'Libravatar Junio C Hamano1-1/+2
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'Libravatar Junio C Hamano3-8/+218
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'Libravatar Junio C Hamano6-46/+57
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'Libravatar Junio C Hamano1-1/+1
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'Libravatar Junio C Hamano1-0/+3
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'Libravatar Junio C Hamano1-52/+57
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-20Sync with 2.12.1Libravatar Junio C Hamano1-1/+2
2017-03-20Merge branch 'js/difftool-builtin'Libravatar Junio C Hamano2-7/+111
"git difftool --dir-diff" used to die a controlled death giving a "fatal" message when encountering a locally modified symbolic link, but it started segfaulting since v2.12. This has been fixed. * js/difftool-builtin: difftool: handle modified symlinks in dir-diff mode t7800: cleanup cruft left behind by tests t7800: remove whitespace before redirect
2017-03-20Git 2.12.1Libravatar Junio C Hamano1-1/+2
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2017-03-20push: mention "push.default=tracking" in the documentationLibravatar Ævar Arnfjörð Bjarmason1-0/+2
Change the documentation for push.tracking=* to re-include a mention of what "tracking" does. The "tracking" option was renamed to "upstream" back in 53c4031 ("push.default: Rename 'tracking' to 'upstream'", 2011-02-16), this section was then subsequently rewritten in 87a70e4 ("config doc: rewrite push.default section", 2013-06-19) to remove any mention of "tracking". Maybe we should just warn or die nowadays if this option is in the config, but I had some old config of mine use this option, I'd forgotten that it was a synonym, and nothing in git's documentation mentioned that. That's bad, either we shouldn't support it at all, or we should document what it does. This patch does the latter. Signed-off-by: Ævar Arnfjörð Bjarmason <avarab@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2017-03-20git-commit.txt: list post-rewrite in HOOKS sectionLibravatar Nguyễn Thái Ngọc Duy1-1/+1
The hook was added in a86ed83cce (Merge branch 'tr/notes-display' - 2010-03-24), which updated githooks.txt but not git-commit.txt. git-commit.txt was later updated in e858af6d50 (commit: document a couple of options - 2012-06-08). Since this commit focused on command line options, this section was probably forgotten. Signed-off-by: Nguyễn Thái Ngọc Duy <pclouds@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2017-03-20doc: change erroneous --[no]-whatever into --[no-]whateverLibravatar Ævar Arnfjörð Bjarmason2-2/+2
Change these two obvious typos to be in line with the rest of the documentation, which uses the correct --[no-]whatever form. Signed-off-by: Ævar Arnfjörð Bjarmason <avarab@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2017-03-17Fifth batch for 2.13Libravatar Junio C Hamano1-9/+54
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2017-03-17Merge branch 'jk/cherry-pick-0-mainline'Libravatar Junio C Hamano2-1/+29
"git revert -m 0 $merge_commit" complained that reverting a merge needs to say relative to which parent the reversion needs to happen, as if "-m 0" weren't given. The correct diagnosis is that "-m 0" does not refer to the first parent ("-m 1" does). This has been fixed. * jk/cherry-pick-0-mainline: cherry-pick: detect bogus arguments to --mainline
2017-03-17Merge branch 'js/early-config'Libravatar Junio C Hamano7-111/+313
The start-up sequence of "git" needs to figure out some configured settings before it finds and set itself up in the location of the repository and was quite messy due to its "chicken-and-egg" nature. The code has been restructured. * js/early-config: setup.c: mention unresolved problems t1309: document cases where we would want early config not to die() setup_git_directory_gently_1(): avoid die()ing t1309: test read_early_config() read_early_config(): really discover .git/ read_early_config(): avoid .git/config hack when unneeded setup: make read_early_config() reusable setup: introduce the discover_git_directory() function setup_git_directory_1(): avoid changing global state setup: prepare setup_discovered_git_dir() for the root directory setup_git_directory(): use is_dir_sep() helper t7006: replace dubious test
2017-03-17Merge branch 'bc/sha1-header-selection-with-cpp-macros'Libravatar Junio C Hamano3-8/+20
Our source code has used the SHA1_HEADER cpp macro after "#include" in the C code to switch among the SHA-1 implementations. Instead, list the exact header file names and switch among implementations using "#ifdef BLK_SHA1/#include "block-sha1/sha1.h"/.../#endif"; this helps some IDE tools. * bc/sha1-header-selection-with-cpp-macros: hash.h: move SHA-1 implementation selection into a header file
2017-03-17Merge branch 'mg/status-porcelain-no-i18n'Libravatar Junio C Hamano1-4/+4
"git status --porcelain" is supposed to give a stable output, but a few strings were left as translatable by mistake. * mg/status-porcelain-no-i18n: git-status: make porcelain more robust
2017-03-17Merge branch 'jk/add-i-use-pathspecs'Libravatar Junio C Hamano2-11/+45
"git add -p <pathspec>" unnecessarily expanded the pathspec to a list of individual files that matches the pathspec by running "git ls-files <pathspec>", before feeding it to "git diff-index" to see which paths have changes, because historically the pathspec language supported by "diff-index" was weaker. These days they are equivalent and there is no reason to internally expand it. This helps both performance and avoids command line argument limit on some platforms. * jk/add-i-use-pathspecs: add--interactive: do not expand pathspecs with ls-files
2017-03-17Merge branch 'jk/http-walker-buffer-underflow-fix'Libravatar Junio C Hamano1-4/+7
"Dumb http" transport used to misparse a nonsense http-alternates response, which has been fixed. * jk/http-walker-buffer-underflow-fix: http-walker: fix buffer underflow processing remote alternates
2017-03-17Merge branch 'bw/attr-pathspec'Libravatar Junio C Hamano7-10/+446
The pathspec mechanism learned to further limit the paths that match the pattern to those that have specified attributes attached via the gitattributes mechanism. * bw/attr-pathspec: pathspec: allow escaped query values pathspec: allow querying for attributes
2017-03-17Merge branch 'jk/ref-filter-flags-cleanup'Libravatar Junio C Hamano2-31/+44
"git tag --contains" used to (ab)use the object bits to keep track of the state of object reachability without clearing them after use; this has been cleaned up and made to use the newer commit-slab facility. * jk/ref-filter-flags-cleanup: ref-filter: use separate cache for contains_tag_algo ref-filter: die on parse_commit errors ref-filter: use contains_result enum consistently ref-filter: move ref_cbdata definition into ref-filter.c
2017-03-17Merge branch 'sb/rev-parse-show-superproject-root'Libravatar Junio C Hamano5-0/+117
From a working tree of a repository, a new option of "rev-parse" lets you ask if the repository is used as a submodule of another project, and where the root level of the working tree of that project (i.e. your superproject) is. * sb/rev-parse-show-superproject-root: rev-parse: add --show-superproject-working-tree
2017-03-17Merge branch 'bc/object-id'Libravatar Junio C Hamano33-462/+494
"uchar [40]" to "struct object_id" conversion continues. * bc/object-id: wt-status: convert to struct object_id builtin/merge-base: convert to struct object_id Convert object iteration callbacks to struct object_id sha1_file: introduce an nth_packed_object_oid function refs: simplify parsing of reflog entries refs: convert each_reflog_ent_fn to struct object_id reflog-walk: convert struct reflog_info to struct object_id builtin/replace: convert to struct object_id Convert remaining callers of resolve_refdup to object_id builtin/merge: convert to struct object_id builtin/clone: convert to struct object_id builtin/branch: convert to struct object_id builtin/grep: convert to struct object_id builtin/fmt-merge-message: convert to struct object_id builtin/fast-export: convert to struct object_id builtin/describe: convert to struct object_id builtin/diff-tree: convert to struct object_id builtin/commit: convert to struct object_id hex: introduce parse_oid_hex
2017-03-17Merge branch 'rs/blame-code-cleanup'Libravatar Junio C Hamano1-17/+8
Code clean-up. * rs/blame-code-cleanup: blame: move blame_entry duplication to add_blame_entry()
2017-03-17Merge branch 'jk/interop-test'Libravatar Junio C Hamano8-1/+270
Picking two versions of Git and running tests to make sure the older one and the newer one interoperate happily has now become possible. * jk/interop-test: t/interop: add test of old clients against modern git-daemon t: add an interoperability test harness
2017-03-17Merge branch 'cc/split-index-config'Libravatar Junio C Hamano11-131/+540
The experimental "split index" feature has gained a few configuration variables to make it easier to use. * cc/split-index-config: (22 commits) Documentation/git-update-index: explain splitIndex.* Documentation/config: add splitIndex.sharedIndexExpire read-cache: use freshen_shared_index() in read_index_from() read-cache: refactor read_index_from() t1700: test shared index file expiration read-cache: unlink old sharedindex files config: add git_config_get_expiry() from gc.c read-cache: touch shared index files when used sha1_file: make check_and_freshen_file() non static Documentation/config: add splitIndex.maxPercentChange t1700: add tests for splitIndex.maxPercentChange read-cache: regenerate shared index if necessary config: add git_config_get_max_percent_split_change() Documentation/git-update-index: talk about core.splitIndex config var Documentation/config: add information for core.splitIndex t1700: add tests for core.splitIndex update-index: warn in case of split-index incoherency read-cache: add and then use tweak_split_index() split-index: add {add,remove}_split_index() functions config: add git_config_get_split_index() ...
2017-03-17wt-status: simplify by using for_each_string_list_itemLibravatar Stefan Beller1-15/+5
Improve readability by using the for_each_string_list_item helper instead of manually iterating with an integer counter. Signed-off-by: Stefan Beller <sbeller@google.com> Reviewed-by: Jonathan Nieder <jrnieder@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2017-03-17sequencer: drop "warning:" when stopping for editLibravatar Jeff King1-1/+2
Since the conversion from shell to C in 56dc3ab04 (sequencer (rebase -i): implement the 'edit' command, 2017-01-02), stopping at an "edit" instruction went from: $ git rebase -i Stopped at 6ce6b914a... odb_pack_keep(): stop generating keepfile name You can amend the commit now, with [...more instructions...] to: $ git rebase -i warning: stopped at 6ce6b914a... odb_pack_keep(): stop generating keepfile name You can amend the commit now, with [...more instructions...] The "warning" implies that it's something unexpected, but it's not. Let's switch back to the original message. Signed-off-by: Jeff King <peff@peff.net> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2017-03-16Sync with 'maint'Libravatar Junio C Hamano1-0/+41
* maint: Preparing for 2.12.1
2017-03-16Preparing for 2.12.1Libravatar Junio C Hamano3-2/+43
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2017-03-16Merge branch 'js/realpath-pathdup-fix' into maintLibravatar Junio C Hamano10-18/+26
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. ... and then to down to 'maint'. * 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-16Merge branch 'mm/two-more-xstrfmt' into maintLibravatar Junio C Hamano2-11/+9
Code clean-up and a string truncation fix. * mm/two-more-xstrfmt: bisect_next_all: convert xsnprintf to xstrfmt stop_progress_msg: convert xsnprintf to xstrfmt
2017-03-16Merge branch 'vn/line-log-memcpy-size-fix' into maintLibravatar 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-16Merge branch 'ax/line-log-range-merge-fix' into maintLibravatar 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-16Merge branch 'jk/add-i-patch-do-prompt' into maintLibravatar 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-16Merge branch 'jt/http-base-url-update-upon-redirect' into maintLibravatar 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-16Merge branch 'js/travis-32bit-linux' into maintLibravatar Junio C Hamano2-0/+51
Add 32-bit Linux variant to the set of platforms to be tested with Travis CI. * js/travis-32bit-linux: Travis: also test on 32-bit Linux
2017-03-16Merge branch 'jh/mingw-openssl-sha1' into maintLibravatar 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-16Merge branch 'jk/http-auth' into maintLibravatar 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-16index-pack: make pointer-alias fallbacks saferLibravatar Jeff King1-8/+12
The final() function accepts a NULL value for certain parameters, and falls back to writing into a reusable "name" buffer, and then either: 1. For "keep_name", requiring all uses to do "keep_name ? keep_name : name.buf". This is awkward, and it's easy to accidentally look at the maybe-NULL keep_name. 2. For "final_index_name" and "final_pack_name", aliasing those pointers to the "name" buffer. This is easier to use, but the aliased pointers become invalid after the buffer is reused (this isn't a bug now, but it's a potential pitfall). One way to make this safer would be to introduce an extra pointer to do the aliasing, and have its lifetime match the validity of the "name" buffer. But it's still easy to accidentally use the wrong name (i.e., to use "final_pack_name" instead of the aliased pointer). Instead, let's use three separate buffers that will remain valid through the function. That makes it safe to alias the pointers and use them consistently. The extra allocations shouldn't matter, as this function is not performance sensitive. Signed-off-by: Jeff King <peff@peff.net> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2017-03-16replace snprintf with odb_pack_name()Libravatar Jeff King2-31/+24
In several places we write the name of the pack filename into a fixed-size buffer using snprintf(), but do not check the return value. As a result, a very long object directory could cause us to quietly truncate the pack filename (potentially leading to a corrupted repository, as a newly written packfile could be missing its .pack extension). We can use odb_pack_name() to do this with a strbuf (and shorten the code, as well). Signed-off-by: Jeff King <peff@peff.net> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2017-03-16odb_pack_keep(): stop generating keepfile nameLibravatar Jeff King4-12/+12
The odb_pack_keep() function generates the name of a .keep file and opens it. This has two problems: 1. It requires a fixed-size buffer to create the filename and doesn't notice when the result is truncated. 2. Of the two callers, one sometimes wants to open a filename it already has, which makes things awkward (it has to do so manually, and skips the leading-directory creation). Instead, let's have odb_pack_keep() just open the file. Generating the name isn't hard, and a future patch will switch callers over to odb_pack_name() anyway. Signed-off-by: Jeff King <peff@peff.net> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2017-03-16sha1_file.c: make pack-name helper globally accessibleLibravatar Jeff King2-11/+15
We provide sha1_pack_name() and sha1_pack_index_name(), but the more generic form (which takes its own strbuf and an arbitrary extension) is only used to implement the other two. Let's make it available, but clean up a few things: 1. Name it odb_pack_name(), as the original sha1_get_pack_name() is long but not all that descriptive. 2. Switch the strbuf argument to the beginning, so that it matches similar path-building functions like git_path_buf(). 3. Clean up the out-dated docstring and move it to the public declaration. Signed-off-by: Jeff King <peff@peff.net> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2017-03-16move odb_* declarations out of git-compat-util.hLibravatar Jeff King2-2/+12
These functions were originally conceived as wrapper functions similar to xmkstemp(). They were later moved by 463db9b10 (wrapper: move odb_* to environment.c, 2010-11-06). The more appropriate place for a declaration is in cache.h. While we're at it, let's add some basic docstrings. Signed-off-by: Jeff King <peff@peff.net> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2017-03-15rev-parse: simplify parsing of ref optionsLibravatar Jeff King1-29/+16
All of these options do the same thing "--foo" iterates over the "foo" refs, and "--foo=<glob>" does the same with a glob. We can factor this into its own function to avoid repeating ourselves. There are two subtleties to note: - the original called for_each_branch_ref(), etc, in the non-glob case. Now we will call for_each_ref_in("refs/heads/") which is exactly what for_each_branch_ref() did under the hood. - for --glob, we'll call for_each_glob_ref_in() with a NULL "prefix" argument. Which is exactly what for_each_glob_ref() was doing already. So both cases should behave identically, and it seems reasonable to assume that this will remain the same. The functions we are calling now are the more-generic ones, and the ones we are dropping are just convenience wrappers. Signed-off-by: Jeff King <peff@peff.net> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2017-03-15rev-parse: add helper for parsing "--foo/--foo="Libravatar Jeff King1-10/+28
We can't just use a bare skip_prefix() for these cases, because we need to match both the "--foo" form and the "--foo=<value>" form (and tell the difference between the two in the caller). We can wrap this in a simple helper which has two obvious callsites, and will gain some more in the next patch. Note that the error output for abbrev-ref changes slightly, as we don't keep our original "arg" pointer. However, the new output should hopefully be more clear: [before] fatal: unknown mode for --abbrev-ref=foo [after] fatal: unknown mode for --abbrev-ref: foo Signed-off-by: Jeff King <peff@peff.net> Signed-off-by: Junio C Hamano <gitster@pobox.com>