1. 08 11月, 2018 7 次提交
    • E
      merge-recursive: use handle_file_collision for add/add conflicts · dcf28150
      Elijah Newren 提交于
      This results in no-net change of behavior, it simply ensures that all
      file-collision conflict handling types are being handled the same by
      calling the same function.
      Signed-off-by: NElijah Newren <newren@gmail.com>
      Signed-off-by: NJunio C Hamano <gitster@pobox.com>
      dcf28150
    • E
      merge-recursive: improve handling for rename/rename(2to1) conflicts · bbafc9c4
      Elijah Newren 提交于
      This makes the rename/rename(2to1) conflicts use the new
      handle_file_collision() function.  Since that function was based
      originally on the rename/rename(2to1) handling code, the main
      differences here are in what was added.  In particular:
      
        * Instead of storing files at collide_path~HEAD and collide_path~MERGE,
          the files are two-way merged and recorded at collide_path.
      
        * Instead of recording the version of the renamed file that existed
          on the renamed side in the index (thus ignoring any changes that
          were made to the file on the side of history without the rename),
          we do a three-way content merge on the renamed path, then store
          that at either stage 2 or stage 3.
      
        * Note that since the content merge for each rename may have conflicts,
          and then we have to merge the two renamed files, we can end up with
          nested conflict markers.
      Signed-off-by: NElijah Newren <newren@gmail.com>
      Signed-off-by: NJunio C Hamano <gitster@pobox.com>
      bbafc9c4
    • E
      merge-recursive: fix rename/add conflict handling · 7f867165
      Elijah Newren 提交于
      This makes the rename/add conflict handling make use of the new
      handle_file_collision() function, which fixes several bugs and improves
      things for the rename/add case significantly.  Previously, rename/add
      would:
      
        * Not leave any higher order stage entries in the index, making it
          appear as if there were no conflict.
        * Would place the rename file at the colliding path, and move the
          added file elsewhere, which combined with the lack of higher order
          stage entries felt really odd.  It's not clear to me why the
          rename should take precedence over the add; if one should be moved
          out of the way, they both probably should.
        * In the recursive case, it would do a two way merge of the added
          file and the version of the renamed file on the renamed side,
          completely excluding modifications to the renamed file on the
          unrenamed side of history.
      
      Use the new handle_file_collision() to fix all of these issues.
      Signed-off-by: NElijah Newren <newren@gmail.com>
      Signed-off-by: NJunio C Hamano <gitster@pobox.com>
      7f867165
    • E
      merge-recursive: new function for better colliding conflict resolutions · 37b65ce3
      Elijah Newren 提交于
      There are three conflict types that represent two (possibly entirely
      unrelated) files colliding at the same location:
        * add/add
        * rename/add
        * rename/rename(2to1)
      
      These three conflict types already share more similarity than might be
      immediately apparent from their description: (1) the handling of the
      rename variants already involves removing any entries from the index
      corresponding to the original file names[*], thus only leaving entries
      in the index for the colliding path; (2) likewise, any trace of the
      original file name in the working tree is also removed.  So, in all
      three cases we're left with how to represent two colliding files in both
      the index and the working copy.
      
      [*] Technically, this isn't quite true because rename/rename(2to1)
      conflicts in the recursive (o->call_depth > 0) case do an "unrename"
      since about seven years ago.  But even in that case, Junio felt
      compelled to explain that my decision to "unrename" wasn't necessarily
      the only or right answer -- search for "Comment from Junio" in t6036 for
      details.
      
      My initial motivation for looking at these three conflict types was that
      if the handling of these three conflict types is the same, at least in
      the limited set of cases where a renamed file is unmodified on the side
      of history where the file is not renamed, then a significant performance
      improvement for rename detection during merges is possible.  However,
      while that served as motivation to look at these three types of
      conflicts, the actual goal of this new function is to try to improve the
      handling for all three cases, not to merely make them the same as each
      other in that special circumstance.
      
      === Handling the working tree ===
      
      The previous behavior for these conflict types in regards to the
      working tree (assuming the file collision occurs at 'foo') was:
        * add/add does a two-way merge of the two files and records it as 'foo'.
        * rename/rename(2to1) records the two different files into two new
          uniquely named files (foo~HEAD and foo~$MERGE), while removing 'foo'
          from the working tree.
        * rename/add records the two different files into two different
          locations, recording the add at foo~$SIDE and, oddly, recording
          the rename at foo (why is the rename more important than the add?)
      
      So, the question for what to write to the working tree boils down to
      whether the two colliding files should be two-way merged and recorded in
      place, or recorded into separate files.  As per discussion on the git
      mailing lit, two-way merging was deemed to always be preferred, as that
      makes these cases all more like content conflicts that users can handle
      from within their favorite editor, IDE, or merge tool.  Note that since
      renames already involve a content merge, rename/add and
      rename/rename(2to1) conflicts could result in nested conflict markers.
      
      === Handling of the index ===
      
      For a typical rename, unpack_trees() would set up the index in the
      following fashion:
                 old_path  new_path
         stage1: 5ca1ab1e  00000000
         stage2: f005ba11  00000000
         stage3: 00000000  b0a710ad
      And merge-recursive would rewrite this to
                 new_path
         stage1: 5ca1ab1e
         stage2: f005ba11
         stage3: b0a710ad
      Removing old_path from the index means the user won't have to `git rm
      old_path` manually every time a renamed path has a content conflict.
      It also means they can use `git checkout [--ours|--theirs|--conflict|-m]
      new_path`, `git diff [--ours|--theirs]` and various other commands that
      would be difficult otherwise.
      
      This strategy becomes a problem when we have a rename/add or
      rename/rename(2to1) conflict, however, because then we have only three
      slots to store blob sha1s and we need either four or six.  Previously,
      this was handled by continuing to delete old_path from the index, and
      just outright ignoring any blob shas from old_path.  That had the
      downside of deleting any trace of changes made to old_path on the other
      side of history.  This function instead does a three-way content merge of
      the renamed file, and stores the blob sha1 for that at either stage2 or
      stage3 for new_path (depending on which side the rename came from).  That
      has the advantage of bringing information about changes on both sides and
      still allows for easy resolution (no need to git rm old_path, etc.), but
      does have the downside that if the content merge had conflict markers,
      then what we store in the index is the sha1 of a blob with conflict
      markers.  While that is a downside, it seems less problematic than the
      downsides of any obvious alternatives, and certainly makes more sense
      than the previous handling.  Further, it has a precedent in that when we
      do recursive merges, we may accept a file with conflict markers as the
      resolution for the merge of the merge-bases, which will then show up in
      the index of the outer merge at stage 1 if a conflict exists at the outer
      level.
      Signed-off-by: NElijah Newren <newren@gmail.com>
      Signed-off-by: NJunio C Hamano <gitster@pobox.com>
      37b65ce3
    • E
      merge-recursive: increase marker length with depth of recursion · b2a7942b
      Elijah Newren 提交于
      Later patches in this series will modify file collision conflict
      handling (e.g. from rename/add and rename/rename(2to1) conflicts) so
      that multiply nested conflict markers can arise even before considering
      conflicts in the virtual merge base.  Including the virtual merge base
      will provide a way to get triply (or higher) nested conflict markers.
      This new way to get nested conflict markers will force the need for a
      more general mechanism to extend the length of conflict markers in order
      to differentiate between different nestings.
      
      Along with this change to conflict marker length handling, we want to
      make sure that we don't regress handling for other types of conflicts
      with nested conflict markers.  Add a more involved testcase using
      merge.conflictstyle=diff3, where not only does the virtual merge base
      contain conflicts, but its virtual merge base does as well (i.e. a case
      with triply nested conflict markers).  While there are multiple
      reasonable ways to handle nested conflict markers in the virtual merge
      base for this type of situation, the easiest approach that dovetails
      well with the new needs for the file collision conflict handling is to
      require that the length of the conflict markers increase with each
      subsequent nesting.
      
      Subsequent patches which change the rename/add and rename/rename(2to1)
      conflict handling will modify the extra_marker_size flag appropriately
      for their new needs.
      Signed-off-by: NElijah Newren <newren@gmail.com>
      Signed-off-by: NJunio C Hamano <gitster@pobox.com>
      b2a7942b
    • E
      t6036, t6042: testcases for rename collision of already conflicting files · b28eeb30
      Elijah Newren 提交于
      When a single file is renamed, it can also be modified, yielding the
      possibility of that renamed file having content conflicts.  If two
      different such files are renamed into the same location, then two-way
      merging those files may result in nested conflicts.  Add a testcase that
      makes sure we get this case correct, and uses different lengths of
      conflict markers to differentiate between the different nestings.
      
      Also add another case with an extra (i.e. third) level of conflict
      markers due to using merge.conflictstyle=diff3 and the virtual merge
      base also having conflicts present.
      Signed-off-by: NElijah Newren <newren@gmail.com>
      Signed-off-by: NJunio C Hamano <gitster@pobox.com>
      b28eeb30
    • E
      t6042: add tests for consistency in file collision conflict handling · bb05c9f7
      Elijah Newren 提交于
      Add testcases dealing with file collisions for the following types of
      conflicts:
        * add/add
        * rename/add
        * rename/rename(2to1)
      
      All these conflict types simplify down to two files "colliding"
      and should thus be handled similarly.  This means that rename/add and
      rename/rename(2to1) conflicts need to be modified to behave the same as
      add/add conflicts currently do: the colliding files should be two-way
      merged (instead of the current behavior of writing the two colliding
      files out to separate temporary unique pathnames).  Add testcases which
      check this; subsequent commits will fix the conflict handling to make
      these tests pass.
      Signed-off-by: NElijah Newren <newren@gmail.com>
      Signed-off-by: NJunio C Hamano <gitster@pobox.com>
      bb05c9f7
  2. 18 10月, 2018 2 次提交
    • E
      merge-recursive: avoid showing conflicts with merge branch before HEAD · 4f445453
      Elijah Newren 提交于
      We want to load unmerged entries from HEAD into the index at stage 2 and
      from MERGE_HEAD into stage 3.  Similarly, folks expect merge conflicts
      to look like
      
          <<<<<<<< HEAD
          content from our side
          ========
          content from their side
          >>>>>>>> MERGE_HEAD
      
      not
      
          <<<<<<<< MERGE_HEAD
          content from their side
          ========
          content from our side
          >>>>>>>> HEAD
      
      The correct order usually comes naturally and for free, but with renames
      we often have data in the form {rename_branch, other_branch}, and
      working relative to the rename first (e.g. for rename/add) is more
      convenient elsewhere in the code.  Address the slight impedance
      mismatch by having some functions re-call themselves with flipped
      arguments when the branch order is reversed.
      
      Note that setup_rename_conflict_info() has one asymmetry in it, in
      setting dst_entry1->processed=0 but not doing similarly for
      dst_entry2->processed.  When dealing with rename/rename and similar
      conflicts, we do not want the processing to happen twice, so the
      desire to only set one of the entries to unprocessed is intentional.
      So, while this change modifies which branch's entry will be marked as
      unprocessed, that dovetails nicely with putting HEAD first so that we
      get the index stage entries and conflict markers in the right order.
      Signed-off-by: NElijah Newren <newren@gmail.com>
      Signed-off-by: NJunio C Hamano <gitster@pobox.com>
      4f445453
    • E
      merge-recursive: improve auto-merging messages with path collisions · 2b168ef3
      Elijah Newren 提交于
      Each individual file involved in a rename could have also been modified
      on both sides of history, meaning it may need to have content merges.
      If two such files are renamed into the same location, then on top of the
      two natural auto-merging messages we also have to two-way merge the
      result, giving us messages that look like
      
        Auto-merging somefile.c (was somecase.c)
        Auto-merging somefile.c (was somefolder.c)
        Auto-merging somefile.c
      
      However, despite the fact that I was the one who put the "(was %s)"
      portions into the messages (and just a few months ago), I was still
      initially confused when running into a rename/rename(2to1) case and
      wondered if somefile.c had been merged three times.  Update this to
      instead be:
      
        Auto-merging version of somefile.c from somecase.c
        Auto-merging version of somefile.c from someportfolio.c
        Auto-merging somefile.c
      
      This is an admittedly long set of messages for a single path, but you
      only get all three messages when dealing with the rare case of a
      rename/rename(2to1) conflict where both sides of both original files
      were also modified, in conflicting ways.
      Signed-off-by: NElijah Newren <newren@gmail.com>
      Signed-off-by: NJunio C Hamano <gitster@pobox.com>
      2b168ef3
  3. 21 9月, 2018 4 次提交
    • E
      merge-recursive: rename merge_file_1() and merge_content() · d9573556
      Elijah Newren 提交于
      Summary:
        merge_file_1()  -> merge_mode_and_contents()
        merge_content() -> handle_content_merge()
      
      merge_file_1() is a very unhelpful name.  Rename it to
      merge_mode_and_contents() to reflect what it does.
      
      merge_content() calls merge_mode_and_contents() to do the main part of
      its work, but most of this function was about higher level stuff, e.g.
      printing out conflict messages, updating skip_worktree bits, checking
      for ability to avoid updating the working tree or for D/F conflicts
      being in the way, etc.  Since there are several handle_*() functions for
      similar levels of checking and handling in merge-recursive.c (e.g.
      handle_change_delete(), handle_rename_rename_2to1()), let's rename this
      function to handle_content_merge().
      Signed-off-by: NElijah Newren <newren@gmail.com>
      Signed-off-by: NJunio C Hamano <gitster@pobox.com>
      d9573556
    • E
      merge-recursive: remove final remaining caller of merge_file_one() · 0270a07a
      Elijah Newren 提交于
      The function names merge_file_one() and merge_file_1() aren't
      particularly intuitive function names, especially since there is no
      associated merge_file() function that these are related to.  The
      previous commit showed that merge_file_one() was prone to be called when
      merge_file_1() should be, and since it is just a thin wrapper around
      merge_file_1() anyway and only has one caller left, let's just remove
      merge_file_one() entirely.
      
      (It also turns out that the one remaining caller of merge_file_one()
      has very broken code that needs to be completely rewritten, but that's
      the subject of a future patch series; for now, we're just translating
      it into a merge_file_1() call.)
      Signed-off-by: NElijah Newren <newren@gmail.com>
      Signed-off-by: NJunio C Hamano <gitster@pobox.com>
      0270a07a
    • E
      merge-recursive: avoid wrapper function when unnecessary and wasteful · 75f3fa79
      Elijah Newren 提交于
      merge_file_one() is a convenience function taking a bunch of oids and
      modes, combining each pair into a diff_filespec, and then calling
      merge_file_1().  When we already start with diff_filespec's, we can
      just call merge_file_1() directly instead of splitting out the oids
      and modes for the wrapper to recombine into what we already had.
      Signed-off-by: NElijah Newren <newren@gmail.com>
      Signed-off-by: NJunio C Hamano <gitster@pobox.com>
      75f3fa79
    • E
      merge-recursive: set paths correctly when three-way merging content · 52396e1d
      Elijah Newren 提交于
      merge_3way() has code to mark different sides of the conflict with info
      about where the content comes from.  If the names of the files involved
      match, it simply uses the branch name.  If the names of the files do not
      match, it uses branchname:filename.  Unfortunately, merge_content()
      previously always called it with one.path = a.path = b.path.  Granted,
      it didn't have other path information available to it for years, but
      that was corrected by passing rename_conflict_info in commit
      3c217c07 ("merge-recursive: Provide more info in conflict markers
      with file renames", 2011-08-11).  In that commit, instead of just fixing
      the bug with the pathnames, it created fake branch names incorporating
      both the branch name and file name.
      
      This "fake branch" workaround was extended further when I pulled that
      logic out into a special function in commit dac47415
      ("merge-recursive: Create function for merging with branchname:file
      markers", 2011-08-11), and a number of other sites outside of
      merge_content() have been added which call into that.  However, this
      Rube-Goldberg-esque setup is not merely duplicate code and unnecessary
      work, it also risked having other callsites invoke it in a way that
      would result in markers of the form branchname:filename:filename (i.e.
      with the filename repeated).
      
      Fix this whole mess by:
        - setting one.path, a.path, and b.path appropriately
        - calling merge_file_1() directly
        - deleting the merge_file_special_markers() workaround wrapper
      Signed-off-by: NElijah Newren <newren@gmail.com>
      Signed-off-by: NJunio C Hamano <gitster@pobox.com>
      52396e1d
  4. 18 9月, 2018 27 次提交
    • J
      Initial batch post 2.19 · 2d3b1c57
      Junio C Hamano 提交于
      2d3b1c57
    • J
      Merge branch 'nd/bisect-show-list-fix' · 1966cda6
      Junio C Hamano 提交于
      Debugging aid update.
      
      * nd/bisect-show-list-fix:
        bisect.c: make show_list() build again
      1966cda6
    • J
      Merge branch 'ab/fetch-tags-noclobber' · d39cab39
      Junio C Hamano 提交于
      The rules used by "git push" and "git fetch" to determine if a ref
      can or cannot be updated were inconsistent; specifically, fetching
      to update existing tags were allowed even though tags are supposed
      to be unmoving anchoring points.  "git fetch" was taught to forbid
      updates to existing tags without the "--force" option.
      
      * ab/fetch-tags-noclobber:
        fetch: stop clobbering existing tags without --force
        fetch: document local ref updates with/without --force
        push doc: correct lies about how push refspecs work
        push doc: move mention of "tag <tag>" later in the prose
        push doc: remove confusing mention of remote merger
        fetch tests: add a test for clobbering tag behavior
        push tests: use spaces in interpolated string
        push tests: make use of unused $1 in test description
        fetch: change "branch" to "reference" in --force -h output
      d39cab39
    • J
      Merge branch 'es/worktree-forced-ops-fix' · 1c515bf7
      Junio C Hamano 提交于
      Fix a bug in which the same path could be registered under multiple
      worktree entries if the path was missing (for instance, was removed
      manually).  Also, as a convenience, expand the number of cases in
      which --force is applicable.
      
      * es/worktree-forced-ops-fix:
        doc-diff: force worktree add
        worktree: delete .git/worktrees if empty after 'remove'
        worktree: teach 'remove' to override lock when --force given twice
        worktree: teach 'move' to override lock when --force given twice
        worktree: teach 'add' to respect --force for registered but missing path
        worktree: disallow adding same path multiple times
        worktree: prepare for more checks of whether path can become worktree
        worktree: generalize delete_git_dir() to reduce code duplication
        worktree: move delete_git_dir() earlier in file for upcoming new callers
        worktree: don't die() in library function find_worktree()
      1c515bf7
    • J
      Merge branch 'sg/doc-trace-appends' · 2af0b1c6
      Junio C Hamano 提交于
      Docfix.
      
      * sg/doc-trace-appends:
        Documentation/git.txt: clarify that GIT_TRACE=/path appends
      2af0b1c6
    • J
      Merge branch 'jk/diff-rendered-docs' · 98509d0f
      Junio C Hamano 提交于
      Dev doc update.
      
      * jk/diff-rendered-docs:
        Revert "doc/Makefile: drop doc-diff worktree and temporary files on "make clean""
        doc/Makefile: drop doc-diff worktree and temporary files on "make clean"
        doc-diff: add --clean mode to remove temporary working gunk
        doc-diff: fix non-portable 'man' invocation
        doc-diff: always use oids inside worktree
        SubmittingPatches: mention doc-diff
      98509d0f
    • J
      Merge branch 'jk/patch-corrupted-delta-fix' · 07703ae0
      Junio C Hamano 提交于
      Malformed or crafted data in packstream can make our code attempt
      to read or write past the allocated buffer and abort, instead of
      reporting an error, which has been fixed.
      
      * jk/patch-corrupted-delta-fix:
        t5303: use printf to generate delta bases
        patch-delta: handle truncated copy parameters
        patch-delta: consistently report corruption
        patch-delta: fix oob read
        t5303: test some corrupt deltas
        test-delta: read input into a heap buffer
      07703ae0
    • J
      Merge branch 'ds/commit-graph-tests' · 06880cff
      Junio C Hamano 提交于
      We can now optionally run tests with commit-graph enabled.
      
      * ds/commit-graph-tests:
        commit-graph: define GIT_TEST_COMMIT_GRAPH
      06880cff
    • J
      Merge branch 'jk/pack-objects-with-bitmap-fix' · b4583001
      Junio C Hamano 提交于
      Hotfix of the base topic.
      
      * jk/pack-objects-with-bitmap-fix:
        pack-bitmap: drop "loaded" flag
        traverse_bitmap_commit_list(): don't free result
        t5310: test delta reuse with bitmaps
        bitmap_has_sha1_in_uninteresting(): drop BUG check
      b4583001
    • J
      Merge branch 'rs/mailinfo-format-flowed' · 6b472d9a
      Junio C Hamano 提交于
      "git mailinfo" used in "git am" learned to make a best-effort
      recovery of a patch corrupted by MUA that sends text/plain with
      format=flawed option.
      
      * rs/mailinfo-format-flowed:
        mailinfo: support format=flowed
      6b472d9a
    • J
      Merge branch 'jk/cocci' · 769af0fd
      Junio C Hamano 提交于
      spatch transformation to replace boolean uses of !hashcmp() to
      newly introduced oideq() is added, and applied, to regain
      performance lost due to support of multiple hash algorithms.
      
      * jk/cocci:
        show_dirstat: simplify same-content check
        read-cache: use oideq() in ce_compare functions
        convert hashmap comparison functions to oideq()
        convert "hashcmp() != 0" to "!hasheq()"
        convert "oidcmp() != 0" to "!oideq()"
        convert "hashcmp() == 0" to hasheq()
        convert "oidcmp() == 0" to oideq()
        introduce hasheq() and oideq()
        coccinelle: use <...> for function exclusion
      769af0fd
    • J
      Merge branch 'tg/rerere-doc-updates' · d88949d8
      Junio C Hamano 提交于
      Clarify a part of technical documentation for rerere.
      
      * tg/rerere-doc-updates:
        rerere: add note about files with existing conflict markers
        rerere: mention caveat about unmatched conflict markers
      d88949d8
    • J
      Merge branch 'es/format-patch-rangediff' · 881c019e
      Junio C Hamano 提交于
      "git format-patch" learned a new "--range-diff" option to explain
      the difference between this version and the previous attempt in
      the cover letter (or after the tree-dashes as a comment).
      
      * es/format-patch-rangediff:
        format-patch: allow --range-diff to apply to a lone-patch
        format-patch: add --creation-factor tweak for --range-diff
        format-patch: teach --range-diff to respect -v/--reroll-count
        format-patch: extend --range-diff to accept revision range
        format-patch: add --range-diff option to embed diff in cover letter
        range-diff: relieve callers of low-level configuration burden
        range-diff: publish default creation factor
        range-diff: respect diff_option.file rather than assuming 'stdout'
      881c019e
    • J
      Merge branch 'es/format-patch-interdiff' · 688cb1c9
      Junio C Hamano 提交于
      "git format-patch" learned a new "--interdiff" option to explain
      the difference between this version and the previous atttempt in
      the cover letter (or after the tree-dashes as a comment).
      
      * es/format-patch-interdiff:
        format-patch: allow --interdiff to apply to a lone-patch
        log-tree: show_log: make commentary block delimiting reusable
        interdiff: teach show_interdiff() to indent interdiff
        format-patch: teach --interdiff to respect -v/--reroll-count
        format-patch: add --interdiff option to embed diff in cover letter
        format-patch: allow additional generated content in make_cover_letter()
      688cb1c9
    • J
      Merge branch 'cc/delta-islands' · f3504ea3
      Junio C Hamano 提交于
      Lift code from GitHub to restrict delta computation so that an
      object that exists in one fork is not made into a delta against
      another object that does not appear in the same forked repository.
      
      * cc/delta-islands:
        pack-objects: move 'layer' into 'struct packing_data'
        pack-objects: move tree_depth into 'struct packing_data'
        t5320: tests for delta islands
        repack: add delta-islands support
        pack-objects: add delta-islands support
        pack-objects: refactor code into compute_layer_order()
        Add delta-islands.{c,h}
      f3504ea3
    • J
      Merge branch 'jk/trailer-fixes' · fba96543
      Junio C Hamano 提交于
      "git interpret-trailers" and its underlying machinery had a buggy
      code that attempted to ignore patch text after commit log message,
      which triggered in various codepaths that will always get the log
      message alone and never get such an input.
      
      * jk/trailer-fixes:
        append_signoff: use size_t for string offsets
        sequencer: ignore "---" divider when parsing trailers
        pretty, ref-filter: format %(trailers) with no_divider option
        interpret-trailers: allow suppressing "---" divider
        interpret-trailers: tighten check for "---" patch boundary
        trailer: pass process_trailer_opts to trailer_info_get()
        trailer: use size_t for iterating trailer list
        trailer: use size_t for string offsets
      fba96543
    • J
      Merge branch 'sb/range-diff-colors' · 30035d1d
      Junio C Hamano 提交于
      The color output support for recently introduced "range-diff"
      command got tweaked a bit.
      
      * sb/range-diff-colors:
        range-diff: indent special lines as context
        range-diff: make use of different output indicators
        diff.c: add --output-indicator-{new, old, context}
        diff.c: rewrite emit_line_0 more understandably
        diff.c: omit check for line prefix in emit_line_0
        diff: use emit_line_0 once per line
        diff.c: add set_sign to emit_line_0
        diff.c: reorder arguments for emit_line_ws_markup
        diff.c: simplify caller of emit_line_0
        t3206: add color test for range-diff --dual-color
        test_decode_color: understand FAINT and ITALIC
      30035d1d
    • J
      Merge branch 'jk/pack-delta-reuse-with-bitmap' · 3ebdef2e
      Junio C Hamano 提交于
      When creating a thin pack, which allows objects to be made into a
      delta against another object that is not in the resulting pack but
      is known to be present on the receiving end, the code learned to
      take advantage of the reachability bitmap; this allows the server
      to send a delta against a base beyond the "boundary" commit.
      
      * jk/pack-delta-reuse-with-bitmap:
        pack-objects: reuse on-disk deltas for thin "have" objects
        pack-bitmap: save "have" bitmap from walk
        t/perf: add perf tests for fetches from a bitmapped server
        t/perf: add infrastructure for measuring sizes
        t/perf: factor out percent calculations
        t/perf: factor boilerplate out of test_perf
      3ebdef2e
    • J
      Merge branch 'nd/unpack-trees-with-cache-tree' · 7e794d0a
      Junio C Hamano 提交于
      The unpack_trees() API used in checking out a branch and merging
      walks one or more trees along with the index.  When the cache-tree
      in the index tells us that we are walking a tree whose flattened
      contents is known (i.e. matches a span in the index), as linearly
      scanning a span in the index is much more efficient than having to
      open tree objects recursively and listing their entries, the walk
      can be optimized, which is done in this topic.
      
      * nd/unpack-trees-with-cache-tree:
        Document update for nd/unpack-trees-with-cache-tree
        cache-tree: verify valid cache-tree in the test suite
        unpack-trees: add missing cache invalidation
        unpack-trees: reuse (still valid) cache-tree from src_index
        unpack-trees: reduce malloc in cache-tree walk
        unpack-trees: optimize walking same trees with cache-tree
        unpack-trees: add performance tracing
        trace.h: support nested performance tracing
      7e794d0a
    • J
      Merge branch 'ds/reachable' · 1b7a91da
      Junio C Hamano 提交于
      The code for computing history reachability has been shuffled,
      obtained a bunch of new tests to cover them, and then being
      improved.
      
      * ds/reachable:
        commit-reach: correct accidental #include of C file
        commit-reach: use can_all_from_reach
        commit-reach: make can_all_from_reach... linear
        commit-reach: replace ref_newer logic
        test-reach: test commit_contains
        test-reach: test can_all_from_reach_with_flags
        test-reach: test reduce_heads
        test-reach: test get_merge_bases_many
        test-reach: test is_descendant_of
        test-reach: test in_merge_bases
        test-reach: create new test tool for ref_newer
        commit-reach: move can_all_from_reach_with_flags
        upload-pack: generalize commit date cutoff
        upload-pack: refactor ok_to_give_up()
        upload-pack: make reachable() more generic
        commit-reach: move commit_contains from ref-filter
        commit-reach: move ref_newer from remote.c
        commit.h: remove method declarations
        commit-reach: move walk methods from commit.c
      1b7a91da
    • J
      Merge branch 'sb/submodule-update-in-c' · 4d6d6ef1
      Junio C Hamano 提交于
      "git submodule update" is getting rewritten piece-by-piece into C.
      
      * sb/submodule-update-in-c:
        submodule--helper: introduce new update-module-mode helper
        submodule--helper: replace connect-gitdir-workingtree by ensure-core-worktree
        builtin/submodule--helper: factor out method to update a single submodule
        builtin/submodule--helper: store update_clone information in a struct
        builtin/submodule--helper: factor out submodule updating
        git-submodule.sh: rename unused variables
        git-submodule.sh: align error reporting for update mode to use path
      4d6d6ef1
    • J
      Merge branch 'tg/rerere' · 39006893
      Junio C Hamano 提交于
      Fixes to "git rerere" corner cases, especially when conflict
      markers cannot be parsed in the file.
      
      * tg/rerere:
        rerere: recalculate conflict ID when unresolved conflict is committed
        rerere: teach rerere to handle nested conflicts
        rerere: return strbuf from handle path
        rerere: factor out handle_conflict function
        rerere: only return whether a path has conflicts or not
        rerere: fix crash with files rerere can't handle
        rerere: add documentation for conflict normalization
        rerere: mark strings for translation
        rerere: wrap paths in output in sq
        rerere: lowercase error messages
        rerere: unify error messages when read_cache fails
      39006893
    • J
      Merge branch 'ds/multi-pack-index' · 49f210fd
      Junio C Hamano 提交于
      When there are too many packfiles in a repository (which is not
      recommended), looking up an object in these would require
      consulting many pack .idx files; a new mechanism to have a single
      file that consolidates all of these .idx files is introduced.
      
      * ds/multi-pack-index: (32 commits)
        pack-objects: consider packs in multi-pack-index
        midx: test a few commands that use get_all_packs
        treewide: use get_all_packs
        packfile: add all_packs list
        midx: fix bug that skips midx with alternates
        midx: stop reporting garbage
        midx: mark bad packed objects
        multi-pack-index: store local property
        multi-pack-index: provide more helpful usage info
        midx: clear midx on repack
        packfile: skip loading index if in multi-pack-index
        midx: prevent duplicate packfile loads
        midx: use midx in approximate_object_count
        midx: use existing midx when writing new one
        midx: use midx in abbreviation calculations
        midx: read objects from multi-pack-index
        config: create core.multiPackIndex setting
        midx: write object offsets
        midx: write object id fanout chunk
        midx: write object ids in a chunk
        ...
      49f210fd
    • J
      Merge branch 'jk/branch-l-1-repurpose' · 7dc341ce
      Junio C Hamano 提交于
      Updated plan to repurpose the "-l" option to "git branch".
      
      * jk/branch-l-1-repurpose:
        doc/git-branch: remove obsolete "-l" references
        branch: make "-l" a synonym for "--list"
      7dc341ce
    • J
      Merge branch 'tg/conflict-marker-size' · 4dd0c4a4
      Junio C Hamano 提交于
      Developer aid.
      
      * tg/conflict-marker-size:
        .gitattributes: add conflict-marker-size for relevant files
      4dd0c4a4
    • J
      Merge branch 'ts/doc-build-manpage-xsl-quietly' · 6709a117
      Junio C Hamano 提交于
      Build tweak.
      
      * ts/doc-build-manpage-xsl-quietly:
        Documentation/Makefile: make manpage-base-url.xsl generation quieter
      6709a117
    • J
      Merge branch 'jk/rev-list-stdin-noop-is-ok' · 8b6f6075
      Junio C Hamano 提交于
      "git rev-list --stdin </dev/null" used to be an error; it now shows
      no output without an error.  "git rev-list --stdin --default HEAD"
      still falls back to the given default when nothing is given on the
      standard input.
      
      * jk/rev-list-stdin-noop-is-ok:
        rev-list: make empty --stdin not an error
      8b6f6075