1. 13 Aug, 2018 5 commits
    • Duy Nguyen's avatar
      dir.c: remove an implicit dependency on the_index in pathspec code · 6d2df284
      Duy Nguyen authored
      Make the match_patchspec API and friends take an index_state instead
      of assuming the_index in dir.c. All external call sites are converted
      blindly to keep the patch simple and retain current behavior.
      Individual call sites may receive further updates to use the right
      index instead of the_index.
      Signed-off-by: Duy Nguyen's avatarNguyễn Thái Ngọc Duy <pclouds@gmail.com>
      Signed-off-by: default avatarJunio C Hamano <gitster@pobox.com>
      6d2df284
    • Duy Nguyen's avatar
      convert.c: remove an implicit dependency on the_index · 7f944e26
      Duy Nguyen authored
      Make the convert API take an index_state instead of assuming the_index
      in convert.c. All external call sites are converted blindly to keep
      the patch simple and retain current behavior. Individual call sites
      may receive further updates to use the right index instead of
      the_index.
      Signed-off-by: Duy Nguyen's avatarNguyễn Thái Ngọc Duy <pclouds@gmail.com>
      Signed-off-by: default avatarJunio C Hamano <gitster@pobox.com>
      7f944e26
    • Duy Nguyen's avatar
      attr: remove an implicit dependency on the_index · 7a400a2c
      Duy Nguyen authored
      Make the attr API take an index_state instead of assuming the_index in
      attr code. All call sites are converted blindly to keep the patch
      simple and retain current behavior. Individual call sites may receive
      further updates to use the right index instead of the_index.
      
      There is one ugly temporary workaround added in attr.c that needs some
      more explanation.
      
      Commit c24f3aba (apply: file commited with CRLF should roundtrip
      diff and apply - 2017-08-19) forces one convert_to_git() call to NOT
      read the index at all. But what do you know, we read it anyway by
      falling back to the_index. When "istate" from convert_to_git is now
      propagated down to read_attr_from_array() we will hit segfault
      somewhere inside read_blob_data_from_index.
      
      The right way of dealing with this is to kill "use_index" variable and
      only follow "istate" but at this stage we are not ready for that:
      while most git_attr_set_direction() calls just passes the_index to be
      assigned to use_index, unpack-trees passes a different one which is
      used by entry.c code, which has no way to know what index to use if we
      delete use_index. So this has to be done later.
      Signed-off-by: Duy Nguyen's avatarNguyễn Thái Ngọc Duy <pclouds@gmail.com>
      Signed-off-by: default avatarJunio C Hamano <gitster@pobox.com>
      7a400a2c
    • Duy Nguyen's avatar
      cache-tree: wrap the_index based wrappers with #ifdef · 07096c96
      Duy Nguyen authored
      This puts update_main_cache_tree() and write_cache_as_tree() in the
      same group of "index compat" functions that assume the_index
      implicitly, which should only be used within builtin/ or t/helper.
      
      sequencer.c is also updated to not use these functions. As of now, no
      files outside builtin/ use these functions anymore.
      Signed-off-by: Duy Nguyen's avatarNguyễn Thái Ngọc Duy <pclouds@gmail.com>
      Signed-off-by: default avatarJunio C Hamano <gitster@pobox.com>
      07096c96
    • Duy Nguyen's avatar
      diff.c: move read_index() code back to the caller · ff7fe37b
      Duy Nguyen authored
      This code is only needed for diff-tree (since f0c6b2a2 ([PATCH]
      Optimize diff-tree -[CM] --stdin - 2005-05-27)). Let the caller do the
      preparation instead and avoid read_index() in diff.c code.
      
      read_index() should be avoided (in addition to the_index) because it
      uses get_index_file() underneath to get the path $GIT_DIR/index. This
      effectively pulls the_repository in and may become the only reason to
      pull a 'struct repository *' in diff.c. Let's keep the dependencies as
      few as possible and kick it back to diff-tree.c
      Signed-off-by: Duy Nguyen's avatarNguyễn Thái Ngọc Duy <pclouds@gmail.com>
      Signed-off-by: default avatarJunio C Hamano <gitster@pobox.com>
      ff7fe37b
  2. 03 Aug, 2018 12 commits
  3. 02 Aug, 2018 23 commits
    • Junio C Hamano's avatar
      Fifth batch for 2.19 cycle · 1d89318c
      Junio C Hamano authored
      Signed-off-by: default avatarJunio C Hamano <gitster@pobox.com>
      1d89318c
    • Junio C Hamano's avatar
      Merge branch 'jt/commit-graph-per-object-store' · 78a72ad4
      Junio C Hamano authored
      The singleton commit-graph in-core instance is made per in-core
      repository instance.
      
      * jt/commit-graph-per-object-store:
        commit-graph: add repo arg to graph readers
        commit-graph: store graph in struct object_store
        commit-graph: add free_commit_graph
        commit-graph: add missing forward declaration
        object-store: add missing include
        commit-graph: refactor preparing commit graph
      78a72ad4
    • Junio C Hamano's avatar
      Merge branch 'es/chain-lint-in-subshell' · cfec6133
      Junio C Hamano authored
      Look for broken "&&" chains that are hidden in subshell, many of
      which have been found and corrected.
      
      * es/chain-lint-in-subshell:
        t/chainlint.sed: drop extra spaces from regex character class
        t/chainlint: add chainlint "specialized" test cases
        t/chainlint: add chainlint "complex" test cases
        t/chainlint: add chainlint "cuddled" test cases
        t/chainlint: add chainlint "loop" and "conditional" test cases
        t/chainlint: add chainlint "nested subshell" test cases
        t/chainlint: add chainlint "one-liner" test cases
        t/chainlint: add chainlint "whitespace" test cases
        t/chainlint: add chainlint "basic" test cases
        t/Makefile: add machinery to check correctness of chainlint.sed
        t/test-lib: teach --chain-lint to detect broken &&-chains in subshells
      cfec6133
    • Junio C Hamano's avatar
      Merge branch 'jt/tags-to-promised-blobs-fix' · 09ca6130
      Junio C Hamano authored
      The lazy clone support had a few places where missing but promised
      objects were not correctly tolerated, which have been fixed.
      
      * jt/tags-to-promised-blobs-fix:
        tag: don't warn if target is missing but promised
        revision: tolerate promised targets of tags
      09ca6130
    • Junio C Hamano's avatar
      Merge branch 'jt/fetch-negotiator-skipping' · 7c85ee6c
      Junio C Hamano authored
      Add a server-side knob to skip commits in exponential/fibbonacci
      stride in an attempt to cover wider swath of history with a smaller
      number of iterations, potentially accepting a larger packfile
      transfer, instead of going back one commit a time during common
      ancestor discovery during the "git fetch" transaction.
      
      * jt/fetch-negotiator-skipping:
        negotiator/skipping: skip commits during fetch
      7c85ee6c
    • Junio C Hamano's avatar
      Merge branch 'jm/send-email-tls-auth-on-batch' · d6873a39
      Junio C Hamano authored
      "git send-email" when using in a batched mode that limits the
      number of messages sent in a single SMTP session lost the contents
      of the variable used to choose between tls/ssl, unable to send the
      second and later batches, which has been fixed.
      
      * jm/send-email-tls-auth-on-batch:
        send-email: fix tls AUTH when sending batch
      d6873a39
    • Junio C Hamano's avatar
      Merge branch 'bc/sequencer-export-work-tree-as-well' · cd3f0678
      Junio C Hamano authored
      "git rebase" started exporting GIT_DIR environment variable and
      exposing it to hook scripts when part of it got rewritten in C.
      Instead of matching the old scripted Porcelains' behaviour,
      compensate by also exporting GIT_WORK_TREE environment as well to
      lessen the damage.  This can harm existing hooks that want to
      operate on different repository, but the current behaviour is
      already broken for them anyway.
      
      * bc/sequencer-export-work-tree-as-well:
        sequencer: pass absolute GIT_WORK_TREE to exec commands
      cd3f0678
    • Junio C Hamano's avatar
      Merge branch 'en/t7405-recursive-submodule-conflicts' · c9903306
      Junio C Hamano authored
      Tests to cover conflict cases that involve submodules have been
      added for merge-recursive.
      
      * en/t7405-recursive-submodule-conflicts:
        t7405: verify 'merge --abort' works after submodule/path conflicts
        t7405: add a directory/submodule conflict
        t7405: add a file/submodule conflict
      c9903306
    • Junio C Hamano's avatar
      Merge branch 'en/t6036-merge-recursive-tests' · e6da45c7
      Junio C Hamano authored
      Tests to cover various conflicting cases have been added for
      merge-recursive.
      
      * en/t6036-merge-recursive-tests:
        t6036: add a failed conflict detection case: regular files, different modes
        t6036: add a failed conflict detection case with conflicting types
        t6036: add a failed conflict detection case with submodule add/add
        t6036: add a failed conflict detection case with submodule modify/modify
        t6036: add a failed conflict detection case with symlink add/add
        t6036: add a failed conflict detection case with symlink modify/modify
      e6da45c7
    • Junio C Hamano's avatar
      Merge branch 'en/dirty-merge-fixes' · c18ac30e
      Junio C Hamano authored
      The recursive merge strategy did not properly ensure there was no
      change between HEAD and the index before performing its operation,
      which has been corrected.
      
      * en/dirty-merge-fixes:
        merge: fix misleading pre-merge check documentation
        merge-recursive: enforce rule that index matches head before merging
        t6044: add more testcases with staged changes before a merge is invoked
        merge-recursive: fix assumption that head tree being merged is HEAD
        merge-recursive: make sure when we say we abort that we actually abort
        t6044: add a testcase for index matching head, when head doesn't match HEAD
        t6044: verify that merges expected to abort actually abort
        index_has_changes(): avoid assuming operating on the_index
        read-cache.c: move index_has_changes() from merge.c
      c18ac30e
    • Junio C Hamano's avatar
      Merge branch 'js/rebase-merge-octopus' · 2b9afea3
      Junio C Hamano authored
      "git rebase --rebase-merges" mode now handles octopus merges as
      well.
      
      * js/rebase-merge-octopus:
        rebase --rebase-merges: adjust man page for octopus support
        rebase --rebase-merges: add support for octopus merges
        merge: allow reading the merge commit message from a file
      2b9afea3
    • Junio C Hamano's avatar
      Merge branch 'tb/grep-only-matching' · 87ece7ce
      Junio C Hamano authored
      "git grep" learned the "--only-matching" option.
      
      * tb/grep-only-matching:
        grep.c: teach 'git grep --only-matching'
        grep.c: extract show_line_header()
      87ece7ce
    • Junio C Hamano's avatar
      Merge branch 'kg/gc-auto-windows-workaround' · 562413eb
      Junio C Hamano authored
      "git gc --auto" opens file descriptors for the packfiles before
      spawning "git repack/prune", which would upset Windows that does
      not want a process to work on a file that is open by another
      process.  The issue has been worked around.
      
      * kg/gc-auto-windows-workaround:
        gc --auto: release pack files before auto packing
      562413eb
    • Junio C Hamano's avatar
      Merge branch 'jm/cache-entry-from-mem-pool' · ae533c4a
      Junio C Hamano authored
      For a large tree, the index needs to hold many cache entries
      allocated on heap.  These cache entries are now allocated out of a
      dedicated memory pool to amortize malloc(3) overhead.
      
      * jm/cache-entry-from-mem-pool:
        block alloc: add validations around cache_entry lifecyle
        block alloc: allocate cache entries from mem_pool
        mem-pool: fill out functionality
        mem-pool: add life cycle management functions
        mem-pool: only search head block for available space
        block alloc: add lifecycle APIs for cache_entry structs
        read-cache: teach make_cache_entry to take object_id
        read-cache: teach refresh_cache_entry to take istate
      ae533c4a
    • Junio C Hamano's avatar
      Merge branch 'jt/fetch-nego-tip' · 30bf8d9f
      Junio C Hamano authored
      "git fetch" learned a new option "--negotiation-tip" to limit the
      set of commits it tells the other end as "have", to reduce wasted
      bandwidth and cycles, which would be helpful when the receiving
      repository has a lot of refs that have little to do with the
      history at the remote it is fetching from.
      
      * jt/fetch-nego-tip:
        fetch-pack: support negotiation tip whitelist
      30bf8d9f
    • Junio C Hamano's avatar
      Merge branch 'en/t6042-insane-merge-rename-testcases' · 84e74c64
      Junio C Hamano authored
      Various glitches in the heuristics of merge-recursive strategy have
      been documented in new tests.
      
      * en/t6042-insane-merge-rename-testcases:
        t6042: add testcase covering long chains of rename conflicts
        t6042: add testcase covering rename/rename(2to1)/delete/delete conflict
        t6042: add testcase covering rename/add/delete conflict type
      84e74c64
    • Junio C Hamano's avatar
      Merge branch 'sb/object-store-lookup' · 3a2a1dc1
      Junio C Hamano authored
      lookup_commit_reference() and friends have been updated to find
      in-core object for a specific in-core repository instance.
      
      * sb/object-store-lookup: (32 commits)
        commit.c: allow lookup_commit_reference to handle arbitrary repositories
        commit.c: allow lookup_commit_reference_gently to handle arbitrary repositories
        tag.c: allow deref_tag to handle arbitrary repositories
        object.c: allow parse_object to handle arbitrary repositories
        object.c: allow parse_object_buffer to handle arbitrary repositories
        commit.c: allow get_cached_commit_buffer to handle arbitrary repositories
        commit.c: allow set_commit_buffer to handle arbitrary repositories
        commit.c: migrate the commit buffer to the parsed object store
        commit-slabs: remove realloc counter outside of slab struct
        commit.c: allow parse_commit_buffer to handle arbitrary repositories
        tag: allow parse_tag_buffer to handle arbitrary repositories
        tag: allow lookup_tag to handle arbitrary repositories
        commit: allow lookup_commit to handle arbitrary repositories
        tree: allow lookup_tree to handle arbitrary repositories
        blob: allow lookup_blob to handle arbitrary repositories
        object: allow lookup_object to handle arbitrary repositories
        object: allow object_as_type to handle arbitrary repositories
        tag: add repository argument to deref_tag
        tag: add repository argument to parse_tag_buffer
        tag: add repository argument to lookup_tag
        ...
      3a2a1dc1
    • Junio C Hamano's avatar
      Merge branch 'is/parsing-line-range' · 6566a917
      Junio C Hamano authored
      Parsing of -L[<N>][,[<M>]] parameters "git blame" and "git log"
      take has been tweaked.
      
      * is/parsing-line-range:
        log: prevent error if line range ends past end of file
        blame: prevent error if range ends past end of file
      6566a917
    • Junio C Hamano's avatar
      Merge branch 'jt/fetch-pack-negotiator' · af8ac738
      Junio C Hamano authored
      Code restructuring and a small fix to transport protocol v2 during
      fetching.
      
      * jt/fetch-pack-negotiator:
        fetch-pack: introduce negotiator API
        fetch-pack: move common check and marking together
        fetch-pack: make negotiation-related vars local
        fetch-pack: use ref adv. to prune "have" sent
        fetch-pack: directly end negotiation if ACK ready
        fetch-pack: clear marks before re-marking
        fetch-pack: split up everything_local()
      af8ac738
    • Junio C Hamano's avatar
      Merge branch 'ab/checkout-default-remote' · 50858edd
      Junio C Hamano authored
      "git checkout" and "git worktree add" learned to honor
      checkout.defaultRemote when auto-vivifying a local branch out of a
      remote tracking branch in a repository with multiple remotes that
      have tracking branches that share the same names.
      
      * ab/checkout-default-remote:
        checkout & worktree: introduce checkout.defaultRemote
        checkout: add advice for ambiguous "checkout <branch>"
        builtin/checkout.c: use "ret" variable for return
        checkout: pass the "num_matches" up to callers
        checkout.c: change "unique" member to "num_matches"
        checkout.c: introduce an *_INIT macro
        checkout.h: wrap the arguments to unique_tracking_name()
        checkout tests: index should be clean after dwim checkout
      50858edd
    • Junio C Hamano's avatar
      Merge branch 'sb/diff-color-move-more' · a81575aa
      Junio C Hamano authored
      "git diff --color-moved" feature has further been tweaked.
      
      * sb/diff-color-move-more:
        diff.c: offer config option to control ws handling in move detection
        diff.c: add white space mode to move detection that allows indent changes
        diff.c: factor advance_or_nullify out of mark_color_as_moved
        diff.c: decouple white space treatment from move detection algorithm
        diff.c: add a blocks mode for moved code detection
        diff.c: adjust hash function signature to match hashmap expectation
        diff.c: do not pass diff options as keydata to hashmap
        t4015: avoid git as a pipe input
        xdiff/xdiffi.c: remove unneeded function declarations
        xdiff/xdiff.h: remove unused flags
      a81575aa
    • Junio C Hamano's avatar
      Merge branch 'es/test-fixes' · 7a135475
      Junio C Hamano authored
      Test clean-up and corrections.
      
      * es/test-fixes: (26 commits)
        t5608: fix broken &&-chain
        t9119: fix broken &&-chains
        t9000-t9999: fix broken &&-chains
        t7000-t7999: fix broken &&-chains
        t6000-t6999: fix broken &&-chains
        t5000-t5999: fix broken &&-chains
        t4000-t4999: fix broken &&-chains
        t3030: fix broken &&-chains
        t3000-t3999: fix broken &&-chains
        t2000-t2999: fix broken &&-chains
        t1000-t1999: fix broken &&-chains
        t0000-t0999: fix broken &&-chains
        t9814: simplify convoluted check that command correctly errors out
        t9001: fix broken "invoke hook" test
        t7810: use test_expect_code() instead of hand-rolled comparison
        t7400: fix broken "submodule add/reconfigure --force" test
        t7201: drop pointless "exit 0" at end of subshell
        t6036: fix broken "merge fails but has appropriate contents" tests
        t5505: modernize and simplify hard-to-digest test
        t5406: use write_script() instead of birthing shell script manually
        ...
      7a135475
    • Junio C Hamano's avatar
      Merge branch 'ds/commit-graph-fsck' · b006f01a
      Junio C Hamano authored
      "git fsck" learns to make sure the optional commit-graph file is in
      a sane state.
      
      * ds/commit-graph-fsck: (23 commits)
        coccinelle: update commit.cocci
        commit-graph: update design document
        gc: automatically write commit-graph files
        commit-graph: add '--reachable' option
        commit-graph: use string-list API for input
        fsck: verify commit-graph
        commit-graph: verify contents match checksum
        commit-graph: test for corrupted octopus edge
        commit-graph: verify commit date
        commit-graph: verify generation number
        commit-graph: verify parent list
        commit-graph: verify root tree OIDs
        commit-graph: verify objects exist
        commit-graph: verify corrupt OID fanout and lookup
        commit-graph: verify required chunks are present
        commit-graph: verify catches corrupt signature
        commit-graph: add 'verify' subcommand
        commit-graph: load a root tree from specific graph
        commit: force commit to parse from object database
        commit-graph: parse commit from chosen graph
        ...
      b006f01a