summaryrefslogtreecommitdiff
AgeCommit message (Collapse)AuthorFilesLines
2017-03-06read-cache: unlink old sharedindex filesLibravatar Christian Couder1-1/+63
Everytime split index is turned on, it creates a "sharedindex.XXXX" file in the git directory. This change makes sure that shared index files that haven't been used for a long time are removed when a new shared index file is created. The new "splitIndex.sharedIndexExpire" config variable is created to tell the delay after which an unused shared index file can be deleted. It defaults to "2.weeks.ago". A previous commit made sure that each time a split index file is created the mtime of the shared index file it references is updated. This makes sure that recently used shared index file will not be deleted. Signed-off-by: Christian Couder <chriscool@tuxfamily.org> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2017-03-01config: add git_config_get_expiry() from gc.cLibravatar Christian Couder3-13/+18
This function will be used in a following commit to get the expiration time of the shared index files from the config, and it is generic enough to be put in "config.c". Signed-off-by: Christian Couder <chriscool@tuxfamily.org> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2017-03-01read-cache: touch shared index files when usedLibravatar Christian Couder1-3/+26
When a split-index file is created, let's update the mtime of the shared index file that the split-index file is referencing. In a following commit we will make shared index file expire depending on their mtime, so updating the mtime makes sure that the shared index file will not be deleted soon. Signed-off-by: Christian Couder <chriscool@tuxfamily.org> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2017-03-01sha1_file: make check_and_freshen_file() non staticLibravatar Christian Couder2-1/+4
This function will be used in a commit soon, so let's make it available globally. Signed-off-by: Christian Couder <chriscool@tuxfamily.org> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2017-03-01Documentation/config: add splitIndex.maxPercentChangeLibravatar Christian Couder1-0/+13
Signed-off-by: Christian Couder <chriscool@tuxfamily.org> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2017-03-01t1700: add tests for splitIndex.maxPercentChangeLibravatar Christian Couder1-0/+72
Signed-off-by: Christian Couder <chriscool@tuxfamily.org> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2017-03-01read-cache: regenerate shared index if necessaryLibravatar Christian Couder2-0/+33
When writing a new split-index and there is a big number of cache entries in the split-index compared to the shared index, it is a good idea to regenerate the shared index. By default when the ratio reaches 20%, we will push back all the entries from the split-index into a new shared index file instead of just creating a new split-index file. The threshold can be configured using the "splitIndex.maxPercentChange" config variable. We need to adjust the existing tests in t1700 by setting "splitIndex.maxPercentChange" to 100 at the beginning of t1700, as the existing tests are assuming that the shared index is regenerated only when `git update-index --split-index` is used. Signed-off-by: Christian Couder <chriscool@tuxfamily.org> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2017-03-01config: add git_config_get_max_percent_split_change()Libravatar Christian Couder2-0/+16
This new function will be used in a following commit to get the value of the "splitIndex.maxPercentChange" config variable. Signed-off-by: Christian Couder <chriscool@tuxfamily.org> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2017-03-01Documentation/git-update-index: talk about core.splitIndex config varLibravatar Christian Couder1-0/+6
Signed-off-by: Christian Couder <chriscool@tuxfamily.org> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2017-03-01Documentation/config: add information for core.splitIndexLibravatar Christian Couder1-0/+4
Signed-off-by: Christian Couder <chriscool@tuxfamily.org> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2017-03-01t1700: add tests for core.splitIndexLibravatar Christian Couder1-0/+37
Signed-off-by: Christian Couder <chriscool@tuxfamily.org> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2017-03-01update-index: warn in case of split-index incoherencyLibravatar Christian Couder1-1/+10
When users are using `git update-index --(no-)split-index`, they may expect the split-index feature to be used or not according to the option they just used, but this might not be the case if the new "core.splitIndex" config variable has been set. In this case let's warn about what will happen and why. Signed-off-by: Christian Couder <chriscool@tuxfamily.org> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2017-03-01read-cache: add and then use tweak_split_index()Libravatar Christian Couder1-0/+17
This will make us use the split-index feature or not depending on the value of the "core.splitIndex" config variable. Signed-off-by: Christian Couder <chriscool@tuxfamily.org> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2017-03-01split-index: add {add,remove}_split_index() functionsLibravatar Christian Couder3-12/+30
Also use the functions in cmd_update_index() in builtin/update-index.c. These functions will be used in a following commit to tweak our use of the split-index feature depending on the setting of a configuration variable. Signed-off-by: Christian Couder <chriscool@tuxfamily.org> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2017-03-01config: add git_config_get_split_index()Libravatar Christian Couder2-0/+11
This new function will be used in a following commit to know if we want to use the split index feature or not. Signed-off-by: Christian Couder <chriscool@tuxfamily.org> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2017-03-01t1700: change here document styleLibravatar Christian Couder1-85/+85
This improves test indentation by getting rid of the outdated here document style. Signed-off-by: Christian Couder <chriscool@tuxfamily.org> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2017-03-01config: mark an error message up for translationLibravatar Christian Couder1-2/+2
Signed-off-by: Christian Couder <chriscool@tuxfamily.org> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2016-12-21Third batch for 2.12Libravatar Junio C Hamano1-0/+40
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2016-12-21Merge branch 'jt/mailinfo-fold-in-body-headers'Libravatar Junio C Hamano1-1/+2
Fix for NDEBUG builds. * jt/mailinfo-fold-in-body-headers: mailinfo.c: move side-effects outside of assert
2016-12-21Merge branch 'jk/index-pack-wo-repo-from-stdin'Libravatar Junio C Hamano7-47/+42
"git index-pack --stdin" needs an access to an existing repository, but "git index-pack file.pack" to generate an .idx file that corresponds to a packfile does not. * jk/index-pack-wo-repo-from-stdin: index-pack: skip collision check when not in repository t: use nongit() function where applicable index-pack: complain when --stdin is used outside of a repo t5000: extract nongit function to test-lib-functions.sh
2016-12-21Merge branch 'jk/parseopt-usage-msg-opt'Libravatar Junio C Hamano1-1/+1
The function usage_msg_opt() has been updated to say "fatal:" before the custom message programs give, when they want to die with a message about wrong command line options followed by the standard usage string. * jk/parseopt-usage-msg-opt: parse-options: print "fatal:" before usage_msg_opt()
2016-12-21Merge branch 'jk/quote-env-path-list-component'Libravatar Junio C Hamano5-12/+102
A recent update to receive-pack to make it easier to drop garbage objects made it clear that GIT_ALTERNATE_OBJECT_DIRECTORIES cannot have a pathname with a colon in it (no surprise!), and this in turn made it impossible to push into a repository at such a path. This has been fixed by introducing a quoting mechanism used when appending such a path to the colon-separated list. * jk/quote-env-path-list-component: t5615-alternate-env: double-quotes in file names do not work on Windows t5547-push-quarantine: run the path separator test on Windows, too tmp-objdir: quote paths we add to alternates alternates: accept double-quoted paths
2016-12-21Merge branch 'vs/submodule-clone-nested-submodules-alternates'Libravatar Junio C Hamano2-2/+83
"git clone --reference $there --recurse-submodules $super" has been taught to guess repositories usable as references for submodules of $super that are embedded in $there while making a clone of the superproject borrow objects from $there; extend the mechanism to also allow submodules of these submodules to borrow repositories embedded in these clones of the submodules embedded in the clone of the superproject. * vs/submodule-clone-nested-submodules-alternates: submodule--helper: set alternateLocation for cloned submodules
2016-12-21Merge branch 'nd/shallow-fixup'Libravatar Junio C Hamano1-19/+20
Code cleanup in shallow boundary computation. * nd/shallow-fixup: shallow.c: remove useless code shallow.c: bit manipulation tweaks shallow.c: avoid theoretical pointer wrap-around shallow.c: make paint_alloc slightly more robust shallow.c: stop abusing COMMIT_SLAB_SIZE for paint_info's memory pools shallow.c: rename fields in paint_info to better express their purposes
2016-12-21Merge branch 'sb/sequencer-abort-safety'Libravatar Junio C Hamano3-2/+61
Unlike "git am --abort", "git cherry-pick --abort" moved HEAD back to where cherry-pick started while picking multiple changes, when the cherry-pick stopped to ask for help from the user, and the user did "git reset --hard" to a different commit in order to re-attempt the operation. * sb/sequencer-abort-safety: Revert "sequencer: remove useless get_dir() function" sequencer: remove useless get_dir() function sequencer: make sequencer abort safer t3510: test that cherry-pick --abort does not unsafely change HEAD am: change safe_to_abort()'s not rewinding error into a warning am: fix filename in safe_to_abort() error message
2016-12-21t5615-alternate-env: double-quotes in file names do not work on WindowsLibravatar Johannes Sixt1-1/+1
Protect a recently added test case with !MINGW. Signed-off-by: Johannes Sixt <j6t@kdbg.org> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2016-12-20mailinfo.c: move side-effects outside of assertLibravatar Kyle J. McKay1-1/+2
Since 6b4b013f18 (mailinfo: handle in-body header continuations, 2016-09-20, v2.11.0) mailinfo.c has contained new code with an assert of the form: assert(call_a_function(...)) The function in question, check_header, has side effects. This means that when NDEBUG is defined during a release build the function call is omitted entirely, the side effects do not take place and tests (fortunately) start failing. Since the only time that mi->inbody_header_accum is appended to is in check_inbody_header, and appending onto a blank mi->inbody_header_accum always happens when is_inbody_header is true, this guarantees a prefix that causes check_header to always return true. Therefore replace the assert with an if !check_header + DIE combination to reflect this. Helped-by: Jonathan Tan <jonathantanmy@google.com> Helped-by: Jeff King <peff@peff.net> Acked-by: Johannes Schindelin <Johannes.Schindelin@gmx.de> Signed-off-by: Kyle J. McKay <mackyle@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2016-12-19Second batch for 2.12Libravatar Junio C Hamano1-3/+90
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2016-12-19Merge branch 'kh/tutorial-grammofix'Libravatar Junio C Hamano1-6/+6
* kh/tutorial-grammofix: doc: omit needless "for" doc: make the intent of sentence clearer doc: add verb in front of command to run doc: add articles (grammar)
2016-12-19Merge branch 'da/mergetool-xxdiff-hotkey'Libravatar Junio C Hamano1-5/+5
The way to specify hotkeys to "xxdiff" that is used by "git mergetool" has been modernized to match recent versions of xxdiff. * da/mergetool-xxdiff-hotkey: mergetools: fix xxdiff hotkeys
2016-12-19Merge branch 'lr/doc-fix-cet'Libravatar Junio C Hamano1-1/+1
* lr/doc-fix-cet: date-formats.txt: Typo fix
2016-12-19Merge branch 'sb/t3600-cleanup'Libravatar Junio C Hamano1-73/+51
Code cleanup. * sb/t3600-cleanup: t3600: slightly modernize style t3600: remove useless redirect
2016-12-19Merge branch 'jc/pull-rebase-ff'Libravatar Junio C Hamano2-4/+35
"git pull --rebase", when there is no new commits on our side since we forked from the upstream, should be able to fast-forward without invoking "git rebase", but it didn't. * jc/pull-rebase-ff: pull: fast-forward "pull --rebase=true"
2016-12-19Merge branch 'ld/p4-worktree'Libravatar Junio C Hamano3-4/+65
"git p4" didn't interact with the internal of .git directory correctly in the modern "git-worktree"-enabled world. * ld/p4-worktree: git-p4: support git worktrees
2016-12-19Merge branch 'jk/make-tags-find-sources-tweak'Libravatar Junio C Hamano1-3/+16
Update the procedure to generate "tags" for developer support. * jk/make-tags-find-sources-tweak: Makefile: exclude contrib from FIND_SOURCE_FILES Makefile: match shell scripts in FIND_SOURCE_FILES Makefile: exclude test cruft from FIND_SOURCE_FILES Makefile: reformat FIND_SOURCE_FILES
2016-12-19Merge branch 'js/normalize-path-copy-ceil'Libravatar Junio C Hamano1-9/+14
A pathname that begins with "//" or "\\" on Windows is special but path normalization logic was unaware of it. * js/normalize-path-copy-ceil: normalize_path_copy(): fix pushing to //server/share/dir on Windows
2016-12-19Merge branch 'bb/unicode-9.0'Libravatar Junio C Hamano6-65/+163
The character width table has been updated to match Unicode 9.0 * bb/unicode-9.0: unicode_width.h: update the width tables to Unicode 9.0 update_unicode.sh: remove the plane filter update_unicode.sh: automatically download newer definition files update_unicode.sh: pin the uniset repo to a known good commit update_unicode.sh: remove an unnecessary subshell level update_unicode.sh: move it into contrib/update-unicode
2016-12-19Merge branch 'jk/readme-gmane-is-no-more'Libravatar Junio C Hamano1-1/+1
* jk/readme-gmane-is-no-more: README: replace gmane link with public-inbox
2016-12-19Merge branch 'jc/lock-report-on-error'Libravatar Junio C Hamano22-36/+49
Git 2.11 had a minor regression in "merge --ff-only" that competed with another process that simultanously attempted to update the index. We used to explain what went wrong with an error message, but the new code silently failed. The error message has been resurrected. * jc/lock-report-on-error: lockfile: LOCK_REPORT_ON_ERROR hold_locked_index(): align error handling with hold_lockfile_for_update() wt-status: implement opportunisitc index update correctly
2016-12-19Merge branch 'jk/xdiff-drop-xdl-fast-hash'Libravatar Junio C Hamano3-118/+0
Retire the "fast hash" that had disastrous performance issues in some corner cases. * jk/xdiff-drop-xdl-fast-hash: xdiff: drop XDL_FAST_HASH
2016-12-19Merge branch 'nd/rebase-forget'Libravatar Junio C Hamano4-4/+37
"git rebase" learned "--quit" option, which allows a user to remove the metadata left by an earlier "git rebase" that was manually aborted without using "git rebase --abort". * nd/rebase-forget: rebase: add --quit to cleanup rebase, leave everything else untouched
2016-12-19Merge branch 'jk/trailers-placeholder-in-pretty'Libravatar Junio C Hamano6-1/+93
In addition to %(subject), %(body), "log --pretty=format:..." learned a new placeholder %(trailers). * jk/trailers-placeholder-in-pretty: ref-filter: add support to display trailers as part of contents pretty: add %(trailers) format for displaying trailers of a commit message
2016-12-19Merge branch 'ak/commit-only-allow-empty'Libravatar Junio C Hamano3-4/+12
"git commit --allow-empty --only" (no pathspec) with dirty index ought to be an acceptable way to create a new commit that does not change any paths, but it was forbidden, perhaps because nobody needed it so far. * ak/commit-only-allow-empty: commit: remove 'Clever' message for --only --amend commit: make --only --allow-empty work without paths
2016-12-19Merge branch 'da/difftool-dir-diff-fix'Libravatar Junio C Hamano2-3/+45
"git difftool --dir-diff" had a minor regression when started from a subdirectory, which has been fixed. * da/difftool-dir-diff-fix: difftool: fix dir-diff index creation when in a subdirectory
2016-12-19Merge branch 'jb/diff-no-index-no-abbrev'Libravatar Junio C Hamano8-1/+39
"git diff --no-index" did not take "--no-abbrev" option. * jb/diff-no-index-no-abbrev: diff: handle --no-abbrev in no-index case
2016-12-19Merge branch 'rj/git-version-gen-do-not-force-abbrev'Libravatar Junio C Hamano1-1/+1
A minor build update. * rj/git-version-gen-do-not-force-abbrev: GIT-VERSION-GEN: do not force abbreviation length used by 'describe'
2016-12-19Merge branch 'jk/stash-disable-renames-internally'Libravatar Junio C Hamano2-1/+10
When diff.renames configuration is on (and with Git 2.9 and later, it is enabled by default, which made it worse), "git stash" misbehaved if a file is removed and another file with a very similar content is added. * jk/stash-disable-renames-internally: stash: prefer plumbing over git-diff
2016-12-19Merge branch 'jk/http-walker-limit-redirect'Libravatar Junio C Hamano2-3/+6
Update the error messages from the dumb-http client when it fails to obtain loose objects; we used to give sensible error message only upon 404 but we now forbid unexpected redirects that needs to be reported with something sensible. * jk/http-walker-limit-redirect: http-walker: complain about non-404 loose object errors
2016-12-19Merge branch 'jk/http-walker-limit-redirect-2.9'Libravatar Junio C Hamano9-25/+159
Transport with dumb http can be fooled into following foreign URLs that the end user does not intend to, especially with the server side redirects and http-alternates mechanism, which can lead to security issues. Tighten the redirection and make it more obvious to the end user when it happens. * jk/http-walker-limit-redirect-2.9: http: treat http-alternates like redirects http: make redirects more obvious remote-curl: rename shadowed options variable http: always update the base URL for redirects http: simplify update_url_from_redirect
2016-12-19Merge branch 'nd/for-each-ref-ignore-case'Libravatar Junio C Hamano10-17/+112
"git branch --list" and friends learned "--ignore-case" option to optionally sort branches and tags case insensitively. * nd/for-each-ref-ignore-case: tag, branch, for-each-ref: add --ignore-case for sorting and filtering