This project is mirrored from https://github.com/git/git.git. Pull mirroring updated .
  1. 08 Apr, 2021 7 commits
    • Junio C Hamano's avatar
      The eighth batch · 89b43f80
      Junio C Hamano authored
      
      Signed-off-by: default avatarJunio C Hamano <gitster@pobox.com>
      89b43f80
    • Junio C Hamano's avatar
      Merge branch 'ab/make-tags-quiet' · 14cc08de
      Junio C Hamano authored
      Generate [ec]tags under $(QUIET_GEN).
      
      * ab/make-tags-quiet:
        Makefile: add QUIET_GEN to "tags" and "TAGS" targets
      14cc08de
    • Junio C Hamano's avatar
      Merge branch 'rs/daemon-sanitize-dir-sep' · bde35a2a
      Junio C Hamano authored
      "git daemon" has been tightened against systems that take backslash
      as directory separator.
      
      * rs/daemon-sanitize-dir-sep:
        daemon: sanitize all directory separators
      bde35a2a
    • Junio C Hamano's avatar
      Merge branch 'en/ort-perf-batch-9' · 1b31224e
      Junio C Hamano authored
      The ort merge backend has been optimized by skipping irrelevant
      renames.
      
      * en/ort-perf-batch-9:
        diffcore-rename: avoid doing basename comparisons for irrelevant sources
        merge-ort: skip rename detection entirely if possible
        merge-ort: use relevant_sources to filter possible rename sources
        merge-ort: precompute whether directory rename detection is needed
        merge-ort: introduce wrappers for alternate tree traversal
        merge-ort: add data structures for an alternate tree traversal
        merge-ort: precompute subset of sources for which we need rename detection
        diffcore-rename: enable filtering possible rename sources
      1b31224e
    • Junio C Hamano's avatar
      Merge branch 'en/sequencer-edit-upon-conflict-fix' · 82fd285e
      Junio C Hamano authored
      "git cherry-pick/revert" with or without "--[no-]edit" did not spawn
      the editor as expected (e.g. "revert --no-edit" after a conflict
      still asked to edit the message), which has been corrected.
      
      * en/sequencer-edit-upon-conflict-fix:
        sequencer: fix edit handling for cherry-pick and revert messages
      82fd285e
    • Junio C Hamano's avatar
      Merge branch 'll/clone-reject-shallow' · 22eee7f4
      Junio C Hamano authored
      "git clone --reject-shallow" option fails the clone as soon as we
      notice that we are cloning from a shallow repository.
      
      * ll/clone-reject-shallow:
        builtin/clone.c: add --reject-shallow option
      22eee7f4
    • Junio C Hamano's avatar
      Merge branch 'tb/reverse-midx' · e6b971fc
      Junio C Hamano authored
      An on-disk reverse-index to map the in-pack location of an object
      back to its object name across multiple packfiles is introduced.
      
      * tb/reverse-midx:
        midx.c: improve cache locality in midx_pack_order_cmp()
        pack-revindex: write multi-pack reverse indexes
        pack-write.c: extract 'write_rev_file_order'
        pack-revindex: read multi-pack reverse indexes
        Documentation/technical: describe multi-pack reverse indexes
        midx: make some functions non-static
        midx: keep track of the checksum
        midx: don't free midx_name early
        midx: allow marking a pack as preferred
        t/helper/test-read-midx.c: add '--show-objects'
        builtin/multi-pack-index.c: display usage on unrecognized command
        builtin/multi-pack-index.c: don't enter bogus cmd_mode
        builtin/multi-pack-index.c: split sub-commands
        builtin/multi-pack-index.c: define common usage with a macro
        builtin/multi-pack-index.c: don't handle 'progress' separately
        builtin/multi-pack-index.c: inline 'flags' with options
      e6b971fc
  2. 07 Apr, 2021 9 commits
    • Junio C Hamano's avatar
      The seventh batch · a0dda602
      Junio C Hamano authored
      
      Signed-off-by: default avatarJunio C Hamano <gitster@pobox.com>
      a0dda602
    • Junio C Hamano's avatar
      Merge branch 'ab/fsck-api-cleanup' · 5644419d
      Junio C Hamano authored
      Fsck API clean-up.
      
      * ab/fsck-api-cleanup:
        fetch-pack: use new fsck API to printing dangling submodules
        fetch-pack: use file-scope static struct for fsck_options
        fetch-pack: don't needlessly copy fsck_options
        fsck.c: move gitmodules_{found,done} into fsck_options
        fsck.c: add an fsck_set_msg_type() API that takes enums
        fsck.c: pass along the fsck_msg_id in the fsck_error callback
        fsck.[ch]: move FOREACH_FSCK_MSG_ID & fsck_msg_id from *.c to *.h
        fsck.c: give "FOREACH_MSG_ID" a more specific name
        fsck.c: undefine temporary STR macro after use
        fsck.c: call parse_msg_type() early in fsck_set_msg_type()
        fsck.h: re-order and re-assign "enum fsck_msg_type"
        fsck.h: move FSCK_{FATAL,INFO,ERROR,WARN,IGNORE} into an enum
        fsck.c: refactor fsck_msg_type() to limit scope of "int msg_type"
        fsck.c: rename remaining fsck_msg_id "id" to "msg_id"
        fsck.c: remove (mostly) redundant append_msg_id() function
        fsck.c: rename variables in fsck_set_msg_type() for less confusion
        fsck.h: use "enum object_type" instead of "int"
        fsck.h: use designed initializers for FSCK_OPTIONS_{DEFAULT,STRICT}
        fsck.c: refactor and rename common config callback
      5644419d
    • Junio C Hamano's avatar
      Merge branch 'cc/downcase-opt-help' · d637a267
      Junio C Hamano authored
      A few option description strings started with capital letters,
      which were corrected.
      
      * cc/downcase-opt-help:
        column, range-diff: downcase option description
      d637a267
    • Junio C Hamano's avatar
      Merge branch 'js/security-md' · 3cf14f88
      Junio C Hamano authored
      SECURITY.md that is facing individual contributors and end users
      has been introduced.  Also a procedure to follow when preparing
      embargoed releases has been spelled out.
      
      * js/security-md:
        Document how we do embargoed releases
        SECURITY: describe how to report vulnerabilities
      3cf14f88
    • Junio C Hamano's avatar
      Merge branch 'ps/pack-bitmap-optim' · 58840e62
      Junio C Hamano authored
      Optimize "rev-list --use-bitmap-index --objects" corner case that
      uses negative tags as the stopping points.
      
      * ps/pack-bitmap-optim:
        pack-bitmap: avoid traversal of objects referenced by uninteresting tag
      58840e62
    • Junio C Hamano's avatar
      Merge branch 'zh/commit-trailer' · 68e15e0c
      Junio C Hamano authored
      "git commit" learned "--trailer <key>[=<value>]" option; together
      with the interpret-trailers command, this will make it easier to
      support custom trailers.
      
      * zh/commit-trailer:
        commit: add --trailer option
      68e15e0c
    • Junio C Hamano's avatar
      Merge branch 'js/cmake-vsbuild' · a548f3e0
      Junio C Hamano authored
      CMake update for vsbuild.
      
      * js/cmake-vsbuild:
        cmake(install): include vcpkg dlls
        cmake: add a preparatory work-around to accommodate `vcpkg`
        cmake(install): fix double .exe suffixes
        cmake: support SKIP_DASHED_BUILT_INS
      a548f3e0
    • Junio C Hamano's avatar
      Merge branch 'ds/clarify-hashwrite' · 573c5e50
      Junio C Hamano authored
      The hashwrite() API uses a buffering mechanism to avoid calling
      write(2) too frequently. This logic has been refactored to be
      easier to understand.
      
      * ds/clarify-hashwrite:
        csum-file: make hashwrite() more readable
      573c5e50
    • Junio C Hamano's avatar
      Merge branch 'ah/plugleaks' · 642a4001
      Junio C Hamano authored
      Plug or annotate remaining leaks that trigger while running the
      very basic set of tests.
      
      * ah/plugleaks:
        transport: also free remote_refs in transport_disconnect()
        parse-options: don't leak alias help messages
        parse-options: convert bitfield values to use binary shift
        init-db: silence template_dir leak when converting to absolute path
        init: remove git_init_db_config() while fixing leaks
        worktree: fix leak in dwim_branch()
        clone: free or UNLEAK further pointers when finished
        reset: free instead of leaking unneeded ref
        symbolic-ref: don't leak shortened refname in check_symref()
      642a4001
  3. 02 Apr, 2021 5 commits
    • Junio C Hamano's avatar
      The sixth batch · 2e36527f
      Junio C Hamano authored
      
      Signed-off-by: default avatarJunio C Hamano <gitster@pobox.com>
      2e36527f
    • Junio C Hamano's avatar
      Merge branch 'zh/format-patch-fractional-reroll-count' · 8a4394d1
      Junio C Hamano authored
      "git format-patch -v<n>" learned to allow a reroll count that is
      not an integer.
      
      * zh/format-patch-fractional-reroll-count:
        format-patch: allow a non-integral version numbers
      8a4394d1
    • Junio C Hamano's avatar
      Merge branch 'jh/simple-ipc' · 861794b6
      Junio C Hamano authored
      A simple IPC interface gets introduced to build services like
      fsmonitor on top.
      
      * jh/simple-ipc:
        t0052: add simple-ipc tests and t/helper/test-simple-ipc tool
        simple-ipc: add Unix domain socket implementation
        unix-stream-server: create unix domain socket under lock
        unix-socket: disallow chdir() when creating unix domain sockets
        unix-socket: add backlog size option to unix_stream_listen()
        unix-socket: eliminate static unix_stream_socket() helper function
        simple-ipc: add win32 implementation
        simple-ipc: design documentation for new IPC mechanism
        pkt-line: add options argument to read_packetized_to_strbuf()
        pkt-line: add PACKET_READ_GENTLE_ON_READ_ERROR option
        pkt-line: do not issue flush packets in write_packetized_*()
        pkt-line: eliminate the need for static buffer in packet_write_gently()
      861794b6
    • Junio C Hamano's avatar
      Merge branch 'mt/parallel-checkout-part-1' · c47679d0
      Junio C Hamano authored
      Preparatory API changes for parallel checkout.
      
      * mt/parallel-checkout-part-1:
        entry: add checkout_entry_ca() taking preloaded conv_attrs
        entry: move conv_attrs lookup up to checkout_entry()
        entry: extract update_ce_after_write() from write_entry()
        entry: make fstat_output() and read_blob_entry() public
        entry: extract a header file for entry.c functions
        convert: add classification for conv_attrs struct
        convert: add get_stream_filter_ca() variant
        convert: add [async_]convert_to_working_tree_ca() variants
        convert: make convert_attrs() and convert structs public
      c47679d0
    • Ævar Arnfjörð Bjarmason's avatar
      Makefile: add QUIET_GEN to "tags" and "TAGS" targets · 3c80fcb5
      Ævar Arnfjörð Bjarmason authored
      
      
      Don't show the very verbose $(FIND_SOURCE_FILES) command on every
      "make TAGS" invocation.
      
      Let's use "generate into temporary and rename to the final file,
      after seeing the command that generated the output finished
      successfully" pattern, to avoid leaving a file with an incorrect
      output generated by a failed command.
      Signed-off-by: Ævar Arnfjörð Bjarmason's avatarÆvar Arnfjörð Bjarmason <avarab@gmail.com>
      Signed-off-by: default avatarJunio C Hamano <gitster@pobox.com>
      3c80fcb5
  4. 01 Apr, 2021 10 commits
    • Jeff King's avatar
      midx.c: improve cache locality in midx_pack_order_cmp() · 30077524
      Jeff King authored
      
      
      There is a lot of pointer dereferencing in the pre-image version of
      'midx_pack_order_cmp()', which this patch gets rid of.
      
      Instead of comparing the pack preferred-ness and then the pack id, both
      of these checks are done at the same time by using the high-order bit of
      the pack id to represent whether it's preferred. Then the pack id and
      offset are compared as usual.
      
      This produces the same result so long as there are less than 2^31 packs,
      which seems like a likely assumption to make in practice.
      Signed-off-by: default avatarJeff King <peff@peff.net>
      Signed-off-by: default avatarTaylor Blau <me@ttaylorr.com>
      Signed-off-by: default avatarJunio C Hamano <gitster@pobox.com>
      30077524
    • Taylor Blau's avatar
      pack-revindex: write multi-pack reverse indexes · 38ff7cab
      Taylor Blau authored
      
      
      Implement the writing half of multi-pack reverse indexes. This is
      nothing more than the format describe a few patches ago, with a new set
      of helper functions that will be used to clear out stale .rev files
      corresponding to old MIDXs.
      
      Unfortunately, a very similar comparison function as the one implemented
      recently in pack-revindex.c is reimplemented here, this time accepting a
      MIDX-internal type. An effort to DRY these up would create more
      indirection and overhead than is necessary, so it isn't pursued here.
      
      Currently, there are no callers which pass the MIDX_WRITE_REV_INDEX
      flag, meaning that this is all dead code. But, that won't be the case
      for long, since subsequent patches will introduce the multi-pack bitmap,
      which will begin passing this field.
      
      (In midx.c:write_midx_internal(), the two adjacent if statements share a
      conditional, but are written separately since the first one will
      eventually also handle the MIDX_WRITE_BITMAP flag, which does not yet
      exist.)
      Signed-off-by: default avatarTaylor Blau <me@ttaylorr.com>
      Signed-off-by: default avatarJunio C Hamano <gitster@pobox.com>
      38ff7cab
    • Taylor Blau's avatar
      pack-write.c: extract 'write_rev_file_order' · a587b5a7
      Taylor Blau authored
      
      
      Existing callers provide the reverse index code with an array of 'struct
      pack_idx_entry *'s, which is then sorted by pack order (comparing the
      offsets of each object within the pack).
      
      Prepare for the multi-pack index to write a .rev file by providing a way
      to write the reverse index without an array of pack_idx_entry (which the
      MIDX code does not have).
      
      Instead, callers can invoke 'write_rev_index_positions()', which takes
      an array of uint32_t's. The ith entry in this array specifies the ith
      object's (in index order) position within the pack (in pack order).
      
      Expose this new function for use in a later patch, and rewrite the
      existing write_rev_file() in terms of this new function.
      Signed-off-by: default avatarTaylor Blau <me@ttaylorr.com>
      Signed-off-by: default avatarJunio C Hamano <gitster@pobox.com>
      a587b5a7
    • Taylor Blau's avatar
      pack-revindex: read multi-pack reverse indexes · f894081d
      Taylor Blau authored
      
      
      Implement reading for multi-pack reverse indexes, as described in the
      previous patch.
      
      Note that these functions don't yet have any callers, and won't until
      multi-pack reachability bitmaps are introduced in a later patch series.
      In the meantime, this patch implements some of the infrastructure
      necessary to support multi-pack bitmaps.
      
      There are three new functions exposed by the revindex API:
      
        - load_midx_revindex(): loads the reverse index corresponding to the
          given multi-pack index.
      
        - midx_to_pack_pos() and pack_pos_to_midx(): these convert between the
          multi-pack index and pseudo-pack order.
      
      load_midx_revindex() and pack_pos_to_midx() are both relatively
      straightforward.
      
      load_midx_revindex() needs a few functions to be exposed from the midx
      API. One to get the checksum of a midx, and another to get the .rev's
      filename. Similar to recent changes in the packed_git struct, three new
      fields are added to the multi_pack_index struct: one to keep track of
      the size, one to keep track of the mmap'd pointer, and another to point
      past the header and at the reverse index's data.
      
      pack_pos_to_midx() simply reads the corresponding entry out of the
      table.
      
      midx_to_pack_pos() is the trickiest, since it needs to find an object's
      position in the psuedo-pack order, but that order can only be recovered
      in the .rev file itself. This mapping can be implemented with a binary
      search, but note that the thing we're binary searching over isn't an
      array of values, but rather a permuted order of those values.
      
      So, when comparing two items, it's helpful to keep in mind the
      difference. Instead of a traditional binary search, where you are
      comparing two things directly, here we're comparing a (pack, offset)
      tuple with an index into the multi-pack index. That index describes
      another (pack, offset) tuple, and it is _those_ two tuples that are
      compared.
      Signed-off-by: default avatarTaylor Blau <me@ttaylorr.com>
      Signed-off-by: default avatarJunio C Hamano <gitster@pobox.com>
      f894081d
    • Taylor Blau's avatar
      Documentation/technical: describe multi-pack reverse indexes · b25fd24c
      Taylor Blau authored
      
      
      As a prerequisite to implementing multi-pack bitmaps, motivate and
      describe the format and ordering of the multi-pack reverse index.
      
      The subsequent patch will implement reading this format, and the patch
      after that will implement writing it while producing a multi-pack index.
      Co-authored-by: default avatarJeff King <peff@peff.net>
      Signed-off-by: default avatarJeff King <peff@peff.net>
      Signed-off-by: default avatarTaylor Blau <me@ttaylorr.com>
      Signed-off-by: default avatarJunio C Hamano <gitster@pobox.com>
      b25fd24c
    • Taylor Blau's avatar
      midx: make some functions non-static · 62f2c1b5
      Taylor Blau authored
      
      
      In a subsequent commit, pack-revindex.c will become responsible for
      sorting a list of objects in the "MIDX pack order" (which will be
      defined in the following patch). To do so, it will need to be know the
      pack identifier and offset within that pack for each object in the MIDX.
      
      The MIDX code already has functions for doing just that
      (nth_midxed_offset() and nth_midxed_pack_int_id()), but they are
      statically declared.
      
      Since there is no reason that they couldn't be exposed publicly, and
      because they are already doing exactly what the caller in
      pack-revindex.c will want, expose them publicly so that they can be
      reused there.
      Signed-off-by: default avatarTaylor Blau <me@ttaylorr.com>
      Signed-off-by: default avatarJunio C Hamano <gitster@pobox.com>
      62f2c1b5
    • Taylor Blau's avatar
      midx: keep track of the checksum · 9f191611
      Taylor Blau authored
      
      
      write_midx_internal() uses a hashfile to write the multi-pack index, but
      discards its checksum. This makes sense, since nothing that takes place
      after writing the MIDX cares about its checksum.
      
      That is about to change in a subsequent patch, when the optional
      reverse index corresponding to the MIDX will want to include the MIDX's
      checksum.
      
      Store the checksum of the MIDX in preparation for that.
      Signed-off-by: default avatarTaylor Blau <me@ttaylorr.com>
      Signed-off-by: default avatarJunio C Hamano <gitster@pobox.com>
      9f191611
    • Taylor Blau's avatar
      midx: don't free midx_name early · 7240cc4b
      Taylor Blau authored
      
      
      A subsequent patch will need to refer back to 'midx_name' later on in
      the function. In fact, this variable is already free()'d later on, so
      this makes the later free() no longer redundant.
      Signed-off-by: default avatarTaylor Blau <me@ttaylorr.com>
      Signed-off-by: default avatarJunio C Hamano <gitster@pobox.com>
      7240cc4b
    • Taylor Blau's avatar
      midx: allow marking a pack as preferred · 9218c6a4
      Taylor Blau authored
      
      
      When multiple packs in the multi-pack index contain the same object, the
      MIDX machinery must make a choice about which pack it associates with
      that object. Prior to this patch, the lowest-ordered[1] pack was always
      selected.
      
      Pack selection for duplicate objects is relatively unimportant today,
      but it will become important for multi-pack bitmaps. This is because we
      can only invoke the pack-reuse mechanism when all of the bits for reused
      objects come from the reuse pack (in order to ensure that all reused
      deltas can find their base objects in the same pack).
      
      To encourage the pack selection process to prefer one pack over another
      (the pack to be preferred is the one a caller would like to later use as
      a reuse pack), introduce the concept of a "preferred pack". When
      provided, the MIDX code will always prefer an object found in a
      preferred pack over any other.
      
      No format changes are required to store the preferred pack, since it
      will be able to be inferred with a corresponding MIDX bitmap, by looking
      up the pack associated with the object in the first bit position (this
      ordering is described in detail in a subsequent commit).
      
      [1]: the ordering is specified by MIDX internals; for our purposes we
      can consider the "lowest ordered" pack to be "the one with the
      most-recent mtime.
      Signed-off-by: default avatarTaylor Blau <me@ttaylorr.com>
      Signed-off-by: default avatarJunio C Hamano <gitster@pobox.com>
      9218c6a4
    • Li Linchao's avatar
      builtin/clone.c: add --reject-shallow option · 4fe788b1
      Li Linchao authored
      
      
      In some scenarios, users may want more history than the repository
      offered for cloning, which happens to be a shallow repository, can
      give them. But because users don't know it is a shallow repository
      until they download it to local, we may want to refuse to clone
      this kind of repository, without creating any unnecessary files.
      
      The '--depth=x' option cannot be used as a solution; the source may
      be deep enough to give us 'x' commits when cloned, but the user may
      later need to deepen the history to arbitrary depth.
      
      Teach '--reject-shallow' option to "git clone" to abort as soon as
      we find out that we are cloning from a shallow repository.
      Signed-off-by: default avatarLi Linchao <lilinchao@oschina.cn>
      Signed-off-by: default avatarJunio C Hamano <gitster@pobox.com>
      4fe788b1
  5. 31 Mar, 2021 1 commit
    • Elijah Newren's avatar
      sequencer: fix edit handling for cherry-pick and revert messages · 39edfd5c
      Elijah Newren authored
      
      
      save_opts() should save any non-default values.  It was intended to do
      this, but since most options in struct replay_opts default to 0, it only
      saved non-zero values.  Unfortunately, this does not always work for
      options.edit.  Roughly speaking, options.edit had a default value of 0
      for cherry-pick but a default value of 1 for revert.  Make save_opts()
      record a value whenever it differs from the default.
      
      options.edit was also overly simplistic; we had more than two cases.
      The behavior that previously existed was as follows:
      
                             Non-conflict commits    Right after Conflict
          revert             Edit iff isatty(0)      Edit (ignore isatty(0))
          cherry-pick        No edit                 See above
          Specify --edit     Edit (ignore isatty(0)) See above
          Specify --no-edit  (*)                     See above
      
          (*) Before stopping for conflicts, No edit is the behavior.  After
              stopping for conflicts, the --no-edit flag is not saved so see
              the first two rows.
      
      However, the expected behavior is:
      
                             Non-conflict commits    Right after Conflict
          revert             Edit iff isatty(0)      Edit iff isatty(0)
          cherry-pick        No edit                 Edit iff isatty(0)
          Specify --edit     Edit (ignore isatty(0)) Edit (ignore isatty(0))
          Specify --no-edit  No edit                 No edit
      
      In order to get the expected behavior, we need to change options.edit
      to a tri-state: unspecified, false, or true.  When specified, we follow
      what it says.  When unspecified, we need to check whether the current
      commit being created is resolving a conflict as well as consulting
      options.action and isatty(0).  While at it, add a should_edit() utility
      function that compresses options.edit down to a boolean based on the
      additional information for the non-conflict case.
      
      continue_single_pick() is the function responsible for resuming after
      conflict cases, regardless of whether there is one commit being picked
      or many.  Make this function stop assuming edit behavior in all cases,
      so that it can correctly handle !isatty(0) and specific requests to not
      edit the commit message.
      Reported-by: default avatarRenato Botelho <garga@freebsd.org>
      Signed-off-by: Elijah Newren's avatarElijah Newren <newren@gmail.com>
      Reviewed-by: Johannes Schindelin's avatarJohannes Schindelin <johannes.schindelin@gmx.de>
      Signed-off-by: default avatarJunio C Hamano <gitster@pobox.com>
      39edfd5c
  6. 30 Mar, 2021 8 commits