1. 28 Jan, 2017 1 commit
    • Jeff King's avatar
      pack-objects: enforce --depth limit in reused deltas · 7dbabbbe
      Jeff King authored
      Since 898b14ce (pack-objects: rework check_delta_limit usage,
      2007-04-16), we check the delta depth limit only when
      figuring out whether we should make a new delta. We don't
      consider it at all when reusing deltas, which means that
      packing once with --depth=250, and then again with
      --depth=50, the second pack may still contain chains larger
      than 50.
      
      This is generally considered a feature, as the results of
      earlier high-depth repacks are carried forward, used for
      serving fetches, etc. However, since we started using
      cross-pack deltas in c9af708b (pack-objects: use mru list
      when iterating over packs, 2016-08-11), we are no longer
      bounded by the length of an existing delta chain in a single
      pack.
      
      Here's one particular pathological case: a sequence of N
      packs, each with 2 objects, the base of which is stored as a
      delta in a previous pack. If we chain all the deltas
      together, we have a cycle of length N. We break the cycle,
      but the tip delta is still at depth N-1.
      
      This is less unlikely than it might sound. See the included
      test for a reconstruction based on real-world actions.  I
      ran into such a case in the wild, where a client was rapidly
      sending packs, and we had accumulated 10,000 before doing a
      server-side repack.  The pack that "git repack" tried to
      generate had a very deep chain, which caused pack-objects to
      run out of stack space in the recursive write_one().
      
      This patch bounds the length of delta chains in the output
      pack based on --depth, regardless of whether they are caused
      by cross-pack deltas or existed in the input packs. This
      fixes the problem, but does have two possible downsides:
      
        1. High-depth aggressive repacks followed by "normal"
           repacks will throw away the high-depth chains.
      
           In the long run this is probably OK; investigation
           showed that high-depth repacks aren't actually
           beneficial, and we dropped the aggressive depth default
           to match the normal case in 07e7dbf0 (gc: default
           aggressive depth to 50, 2016-08-11).
      
        2. If you really do want to store high-depth deltas on
           disk, they may be discarded and new delta computed when
           serving a fetch, unless you set pack.depth to match
           your high-depth size.
      
      The implementation uses the existing search for delta
      cycles.  That lets us compute the depth of any node based on
      the depth of its base, because we know the base is DFS_DONE
      by the time we look at it (modulo any cycles in the graph,
      but we know there cannot be any because we break them as we
      see them).
      
      There is some subtlety worth mentioning, though. We record
      the depth of each object as we compute it. It might seem
      like we could save the per-object storage space by just
      keeping track of the depth of our traversal (i.e., have
      break_delta_chains() report how deep it went). But we may
      visit an object through multiple delta paths, and on
      subsequent paths we want to know its depth immediately,
      without having to walk back down to its final base (doing so
      would make our graph walk quadratic rather than linear).
      
      Likewise, one could try to record the depth not from the
      base, but from our starting point (i.e., start
      recursion_depth at 0, and pass "recursion_depth + 1" to each
      invocation of break_delta_chains()). And then when
      recursion_depth gets too big, we know that we must cut the
      delta chain.  But that technique is wrong if we do not visit
      the nodes in topological order. In a chain A->B->C, it
      if we visit "C", then "B", then "A", we will never recurse
      deeper than 1 link (because we see at each node that we have
      already visited it).
      Signed-off-by: default avatarJeff King <peff@peff.net>
      Signed-off-by: default avatarJunio C Hamano <gitster@pobox.com>
      7dbabbbe
  2. 17 Jan, 2017 39 commits
    • Junio C Hamano's avatar
      Almost ready for 2.11.1 · ad36dc8b
      Junio C Hamano authored
      Signed-off-by: default avatarJunio C Hamano <gitster@pobox.com>
      ad36dc8b
    • Junio C Hamano's avatar
      Merge branch 'mm/gc-safety-doc' into maint · 647a1bcf
      Junio C Hamano authored
      Doc update.
      
      * mm/gc-safety-doc:
        git-gc.txt: expand discussion of races with other processes
      647a1bcf
    • Junio C Hamano's avatar
      Merge branch 'mm/push-social-engineering-attack-doc' into maint · f976c89a
      Junio C Hamano authored
      Doc update on fetching and pushing.
      
      * mm/push-social-engineering-attack-doc:
        doc: mention transfer data leaks in more places
      f976c89a
    • Junio C Hamano's avatar
      Merge branch 'jt/fetch-no-redundant-tag-fetch-map' into maint · 8ee6fc96
      Junio C Hamano authored
      Code cleanup to avoid using redundant refspecs while fetching with
      the --tags option.
      
      * jt/fetch-no-redundant-tag-fetch-map:
        fetch: do not redundantly calculate tag refmap
      8ee6fc96
    • Junio C Hamano's avatar
      Merge branch 'ls/filter-process' into maint · d4a682d4
      Junio C Hamano authored
      Doc update.
      
      * ls/filter-process:
        t0021: fix flaky test
        docs: warn about possible '=' in clean/smudge filter process values
      d4a682d4
    • Junio C Hamano's avatar
      Merge branch 'kh/tutorial-grammofix' into maint · ef6e8151
      Junio C Hamano authored
      * 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)
      ef6e8151
    • Junio C Hamano's avatar
      Merge branch 'lr/doc-fix-cet' into maint · 34d5a66a
      Junio C Hamano authored
      * lr/doc-fix-cet:
        date-formats.txt: Typo fix
      34d5a66a
    • Junio C Hamano's avatar
      Merge branch 'sb/t3600-cleanup' into maint · 1fb4a112
      Junio C Hamano authored
      Code cleanup.
      
      * sb/t3600-cleanup:
        t3600: slightly modernize style
        t3600: remove useless redirect
      1fb4a112
    • Junio C Hamano's avatar
      Merge branch 'jk/readme-gmane-is-no-more' into maint · bc7547fd
      Junio C Hamano authored
      * jk/readme-gmane-is-no-more:
        README: replace gmane link with public-inbox
      bc7547fd
    • Junio C Hamano's avatar
      Merge branch 'sb/unpack-trees-grammofix' into maint · 1addc197
      Junio C Hamano authored
      * sb/unpack-trees-grammofix:
        unpack-trees: fix grammar for untracked files in directories
      1addc197
    • Junio C Hamano's avatar
      Merge branch 'ls/t0021-fixup' into maint · 13236160
      Junio C Hamano authored
      * ls/t0021-fixup:
        t0021: minor filter process test cleanup
      13236160
    • Junio C Hamano's avatar
      Merge branch 'ak/lazy-prereq-mktemp' into maint · d0366b13
      Junio C Hamano authored
      Test code clean-up.
      
      * ak/lazy-prereq-mktemp:
        t7610: clean up foo.XXXXXX tmpdir
      d0366b13
    • Junio C Hamano's avatar
      Merge branch 'nd/qsort-in-merge-recursive' into maint · 1df2046d
      Junio C Hamano authored
      Code simplification.
      
      * nd/qsort-in-merge-recursive:
        merge-recursive.c: use string_list_sort instead of qsort
      1df2046d
    • Junio C Hamano's avatar
      Merge branch 'dt/smart-http-detect-server-going-away' into maint · 48d23c12
      Junio C Hamano authored
      When the http server gives an incomplete response to a smart-http
      rpc call, it could lead to client waiting for a full response that
      will never come.  Teach the client side to notice this condition
      and abort the transfer.
      
      An improvement counterproposal has failed.
      cf. <20161114194049.mktpsvgdhex2f4zv@sigill.intra.peff.net>
      
      * dt/smart-http-detect-server-going-away:
        upload-pack: optionally allow fetching any sha1
        remote-curl: don't hang when a server dies before any output
      48d23c12
    • Junio C Hamano's avatar
      Merge branch 'mk/mingw-winansi-ttyname-termination-fix' into maint · 8554ee15
      Junio C Hamano authored
      A potential but unlikely buffer overflow in Windows port has been
      fixed.
      
      * mk/mingw-winansi-ttyname-termination-fix:
        mingw: consider that UNICODE_STRING::Length counts bytes
      8554ee15
    • Junio C Hamano's avatar
      Merge branch 'gv/p4-multi-path-commit-fix' into maint · 1d5cb459
      Junio C Hamano authored
      "git p4" that tracks multile p4 paths imported a single changelist
      that touches files in these multiple paths as one commit, followed
      by many empty commits.  This has been fixed.
      
      * gv/p4-multi-path-commit-fix:
        git-p4: fix multi-path changelist empty commits
      1d5cb459
    • Junio C Hamano's avatar
      Merge branch 'jk/difftool-in-subdir' into maint · a558332f
      Junio C Hamano authored
      Even though an fix was attempted in Git 2.9.3 days, but running
      "git difftool --dir-diff" from a subdirectory never worked. This
      has been fixed.
      
      * jk/difftool-in-subdir:
        difftool: rename variables for consistency
        difftool: chdir as early as possible
        difftool: sanitize $workdir as early as possible
        difftool: fix dir-diff index creation when in a subdirectory
      a558332f
    • Junio C Hamano's avatar
      Merge branch 'ld/p4-compare-dir-vs-symlink' into maint · aa83f7a2
      Junio C Hamano authored
      "git p4" misbehaved when swapping a directory and a symbolic link.
      
      * ld/p4-compare-dir-vs-symlink:
        git-p4: avoid crash adding symlinked directory
      aa83f7a2
    • Junio C Hamano's avatar
      Merge branch 'jc/push-default-explicit' into maint · af04b117
      Junio C Hamano authored
      A lazy "git push" without refspec did not internally use a fully
      specified refspec to perform 'current', 'simple', or 'upstream'
      push, causing unnecessary "ambiguous ref" errors.
      
      * jc/push-default-explicit:
        push: test pushing ambiguously named branches
        push: do not use potentially ambiguous default refspec
      af04b117
    • Junio C Hamano's avatar
      Merge branch 'jt/mailinfo-fold-in-body-headers' into maint · 943c9a7b
      Junio C Hamano authored
      Fix for NDEBUG builds.
      
      * jt/mailinfo-fold-in-body-headers:
        mailinfo.c: move side-effects outside of assert
      943c9a7b
    • Junio C Hamano's avatar
      Merge branch 'jk/index-pack-wo-repo-from-stdin' into maint · b984bc58
      Junio C Hamano authored
      "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
      b984bc58
    • Junio C Hamano's avatar
      Merge branch 'jk/parseopt-usage-msg-opt' into maint · 5bc5edba
      Junio C Hamano authored
      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()
      5bc5edba
    • Junio C Hamano's avatar
      Merge branch 'jk/quote-env-path-list-component' into maint · bcaf277b
      Junio C Hamano authored
      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
      bcaf277b
    • Junio C Hamano's avatar
      Merge branch 'nd/shallow-fixup' into maint · fdfec7af
      Junio C Hamano authored
      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
      fdfec7af
    • Junio C Hamano's avatar
      Merge branch 'sb/sequencer-abort-safety' into maint · 7902b727
      Junio C Hamano authored
      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
      7902b727
    • Junio C Hamano's avatar
      Merge branch 'da/mergetool-xxdiff-hotkey' into maint · 6d1f93ac
      Junio C Hamano authored
      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
      6d1f93ac
    • Junio C Hamano's avatar
      Merge branch 'jc/pull-rebase-ff' into maint · e4ec4089
      Junio C Hamano authored
      "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"
      e4ec4089
    • Junio C Hamano's avatar
      Merge branch 'js/normalize-path-copy-ceil' into maint · 07ec05d9
      Junio C Hamano authored
      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
      07ec05d9
    • Junio C Hamano's avatar
      Merge branch 'ak/commit-only-allow-empty' into maint · 9d2a2486
      Junio C Hamano authored
      "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
      9d2a2486
    • Junio C Hamano's avatar
      Merge branch 'da/difftool-dir-diff-fix' into maint · 935a4783
      Junio C Hamano authored
      "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
      935a4783
    • Junio C Hamano's avatar
      Merge branch 'jb/diff-no-index-no-abbrev' into maint · 28c8a447
      Junio C Hamano authored
      "git diff --no-index" did not take "--no-abbrev" option.
      
      * jb/diff-no-index-no-abbrev:
        diff: handle --no-abbrev in no-index case
      28c8a447
    • Junio C Hamano's avatar
      Merge branch 'jk/stash-disable-renames-internally' into maint · 12361d02
      Junio C Hamano authored
      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
      12361d02
    • Junio C Hamano's avatar
      Merge branch 'jk/http-walker-limit-redirect' into maint · 5ce6f51f
      Junio C Hamano authored
      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
        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
      5ce6f51f
    • Junio C Hamano's avatar
      Merge branch 'jc/renormalize-merge-kill-safer-crlf' into maint · 7479ca4b
      Junio C Hamano authored
      Fix a corner case in merge-recursive regression that crept in
      during 2.10 development cycle.
      
      * jc/renormalize-merge-kill-safer-crlf:
        convert: git cherry-pick -Xrenormalize did not work
        merge-recursive: handle NULL in add_cacheinfo() correctly
        cherry-pick: demonstrate a segmentation fault
      7479ca4b
    • Junio C Hamano's avatar
      Merge branch 'ls/p4-empty-file-on-lfs' into maint · cf479b4f
      Junio C Hamano authored
      "git p4" LFS support was broken when LFS stores an empty blob.
      
      * ls/p4-empty-file-on-lfs:
        git-p4: fix empty file processing for large file system backend GitLFS
      cf479b4f
    • Junio C Hamano's avatar
      Merge branch 'da/mergetool-trust-exit-code' into maint · b3dac9c0
      Junio C Hamano authored
      mergetool.<tool>.trustExitCode configuration variable did not apply
      to built-in tools, but now it does.
      
      * da/mergetool-trust-exit-code:
        mergetools/vimdiff: trust Vim's exit code
        mergetool: honor mergetool.$tool.trustExitCode for built-in tools
      b3dac9c0
    • Junio C Hamano's avatar
      Merge branch 'nd/worktree-list-fixup' into maint · 430fd1ca
      Junio C Hamano authored
      The output from "git worktree list" was made in readdir() order,
      and was unstable.
      
      * nd/worktree-list-fixup:
        worktree list: keep the list sorted
        worktree.c: get_worktrees() takes a new flag argument
        get_worktrees() must return main worktree as first item even on error
        worktree: reorder an if statement
        worktree.c: zero new 'struct worktree' on allocation
      430fd1ca
    • Junio C Hamano's avatar
      Merge branch 'bw/push-dry-run' into maint · 3075e40c
      Junio C Hamano authored
      "git push --dry-run --recurse-submodule=on-demand" wasn't
      "--dry-run" in the submodules.
      
      * bw/push-dry-run:
        push: fix --dry-run to not push submodules
        push: --dry-run updates submodules when --recurse-submodules=on-demand
      3075e40c
    • Junio C Hamano's avatar
      Merge branch 'hv/submodule-not-yet-pushed-fix' into maint · 9da9965b
      Junio C Hamano authored
      The code in "git push" to compute if any commit being pushed in the
      superproject binds a commit in a submodule that hasn't been pushed
      out was overly inefficient, making it unusable even for a small
      project that does not have any submodule but have a reasonable
      number of refs.
      
      * hv/submodule-not-yet-pushed-fix:
        submodule_needs_pushing(): explain the behaviour when we cannot answer
        batch check whether submodule needs pushing into one call
        serialize collection of refs that contain submodule changes
        serialize collection of changed submodules
      9da9965b