1. 05 Dec, 2017 2 commits
  2. 22 Nov, 2017 6 commits
    • Jeff Hostetler's avatar
      pack-objects: add list-objects filtering · 9535ce73
      Jeff Hostetler authored
      Teach pack-objects to use the filtering provided by the
      traverse_commit_list_filtered() interface to omit unwanted
      objects from the resulting packfile.
      
      Filtering requires the use of the "--stdout" option.
      
      Add t5317 test.
      
      In the future, we will introduce a "partial clone" mechanism
      wherein an object in a repo, obtained from a remote, may
      reference a missing object that can be dynamically fetched from
      that remote once needed.  This "partial clone" mechanism will
      have a way, sometimes slow, of determining if a missing link
      is one of the links expected to be produced by this mechanism.
      
      This patch introduces handling of missing objects to help
      debugging and development of the "partial clone" mechanism,
      and once the mechanism is implemented, for a power user to
      perform operations that are missing-object aware without
      incurring the cost of checking if a missing link is expected.
      Signed-off-by: default avatarJeff Hostetler <[email protected]>
      Reviewed-by: default avatarJonathan Tan <[email protected]>
      Signed-off-by: default avatarJunio C Hamano <[email protected]>
      9535ce73
    • Jeff Hostetler's avatar
      rev-list: add list-objects filtering support · caf3827e
      Jeff Hostetler authored
      Teach rev-list to use the filtering provided by the
      traverse_commit_list_filtered() interface to omit
      unwanted objects from the result.
      
      Object filtering is only allowed when one of the "--objects*"
      options are used.
      
      When the "--filter-print-omitted" option is used, the omitted
      objects are printed at the end.  These are marked with a "~".
      This option can be combined with "--quiet" to get a list of
      just the omitted objects.
      
      Add t6112 test.
      
      In the future, we will introduce a "partial clone" mechanism
      wherein an object in a repo, obtained from a remote, may
      reference a missing object that can be dynamically fetched from
      that remote once needed.  This "partial clone" mechanism will
      have a way, sometimes slow, of determining if a missing link
      is one of the links expected to be produced by this mechanism.
      
      This patch introduces handling of missing objects to help
      debugging and development of the "partial clone" mechanism,
      and once the mechanism is implemented, for a power user to
      perform operations that are missing-object aware without
      incurring the cost of checking if a missing link is expected.
      Signed-off-by: default avatarJeff Hostetler <[email protected]>
      Reviewed-by: default avatarJonathan Tan <[email protected]>
      Signed-off-by: default avatarJunio C Hamano <[email protected]>
      caf3827e
    • Jeff Hostetler's avatar
      list-objects: filter objects in traverse_commit_list · 25ec7bca
      Jeff Hostetler authored
      Create traverse_commit_list_filtered() and add filtering
      interface to allow certain objects to be omitted from the
      traversal.
      
      Update traverse_commit_list() to be a wrapper for the above
      with a null filter to minimize the number of callers that
      needed to be changed.
      
      Object filtering will be used in a future commit by rev-list
      and pack-objects for partial clone and fetch to omit unwanted
      objects from the result.
      
      traverse_bitmap_commit_list() does not work with filtering.
      If a packfile bitmap is present, it will not be used.  It
      should be possible to extend such support in the future (at
      least to simple filters that do not require object pathnames),
      but that is beyond the scope of this patch series.
      Signed-off-by: default avatarJeff Hostetler <[email protected]>
      Reviewed-by: default avatarJonathan Tan <[email protected]>
      Signed-off-by: default avatarJunio C Hamano <[email protected]>
      25ec7bca
    • Jeff Hostetler's avatar
      oidset: add iterator methods to oidset · c3a9ad31
      Jeff Hostetler authored
      Add the usual iterator methods to oidset.
      Add oidset_remove().
      Signed-off-by: default avatarJeff Hostetler <[email protected]>
      Reviewed-by: default avatarJonathan Tan <[email protected]>
      Signed-off-by: default avatarJunio C Hamano <[email protected]>
      c3a9ad31
    • Jeff Hostetler's avatar
      oidmap: add oidmap iterator methods · 314f354e
      Jeff Hostetler authored
      Add the usual map iterator functions to oidmap.
      Signed-off-by: default avatarJeff Hostetler <[email protected]>
      Reviewed-by: default avatarJonathan Tan <[email protected]>
      Signed-off-by: default avatarJunio C Hamano <[email protected]>
      314f354e
    • Jeff Hostetler's avatar
      dir: allow exclusions from blob in addition to file · 578d81d0
      Jeff Hostetler authored
      Refactor add_excludes() to separate the reading of the
      exclude file into a buffer and the parsing of the buffer
      into exclude_list items.
      
      Add add_excludes_from_blob_to_list() to allow an exclude
      file be specified with an OID without assuming a local
      worktree or index exists.
      
      Refactor read_skip_worktree_file_from_index() and add
      do_read_blob() to eliminate duplication of preliminary
      processing of blob contents.
      Signed-off-by: default avatarJeff Hostetler <[email protected]>
      Reviewed-by: default avatarJonathan Tan <[email protected]>
      Signed-off-by: default avatarJunio C Hamano <[email protected]>
      578d81d0
  3. 30 Oct, 2017 2 commits
  4. 29 Oct, 2017 1 commit
  5. 28 Oct, 2017 5 commits
  6. 27 Oct, 2017 2 commits
  7. 26 Oct, 2017 1 commit
    • Junio C Hamano's avatar
      Merge branch 'mh/ref-locking-fix' · 4e40fb30
      Junio C Hamano authored
      Transactions to update multiple references that involves a deletion
      was quite broken in an error codepath and did not abort everything
      correctly.
      
      * mh/ref-locking-fix:
        files_transaction_prepare(): fix handling of ref lock failure
        t1404: add a bunch of tests of D/F conflicts
      4e40fb30
  8. 25 Oct, 2017 3 commits
    • Andrey Okoshkin's avatar
      path.c: use xmalloc() in add_to_trie() · 55d7d158
      Andrey Okoshkin authored
      Add usage of xmalloc() instead of malloc() in add_to_trie() as xmalloc wraps
      and checks memory allocation result.
      Signed-off-by: default avatarAndrey Okoshkin <[email protected]>
      Signed-off-by: default avatarJunio C Hamano <[email protected]>
      55d7d158
    • Michael Haggerty's avatar
      files_transaction_prepare(): fix handling of ref lock failure · da5267f1
      Michael Haggerty authored
      Since dc39e099 (files_ref_store: use a transaction to update packed
      refs, 2017-09-08), failure to lock a reference has been handled
      incorrectly by `files_transaction_prepare()`. If
      `lock_ref_for_update()` fails in the lock-acquisition loop of that
      function, it sets `ret` then breaks out of that loop. Prior to
      dc39e099, that was OK, because the only thing following the loop was
      the cleanup code. But dc39e099 added another blurb of code between
      the loop and the cleanup. That blurb sometimes resets `ret` to zero,
      making the cleanup code think that the locking was successful.
      
      Specifically, whenever
      
      * One or more reference deletions have been processed successfully in
        the lock-acquisition loop. (Processing the first such reference
        causes a packed-ref transaction to be initialized.)
      
      * Then `lock_ref_for_update()` fails for a subsequent reference. Such
        a failure can happen for a number of reasons, such as the old SHA-1
        not being correct, lock contention, etc. This causes a `break` out
        of the lock-acquisition loop.
      
      * The `packed-refs` lock is acquired successfully and
        `ref_transaction_prepare()` succeeds for the packed-ref transaction.
        This has the effect of resetting `ret` back to 0, and making the
        cleanup code think that lock acquisition was successful.
      
      In that case, any reference updates that were processed prior to
      breaking out of the loop would be carried out (loose and packed), but
      the reference that couldn't be locked and any subsequent references
      would silently be ignored.
      
      This can easily cause data loss if, for example, the user was trying
      to push a new name for an existing branch while deleting the old name.
      After the push, the branch could be left unreachable, and could even
      subsequently be garbage-collected.
      
      This problem was noticed in the context of deleting one reference and
      creating another in a single transaction, when the two references D/F
      conflict with each other, like
      
          git update-ref --stdin <<EOF
          delete refs/foo
          create refs/foo/bar HEAD
          EOF
      
      This triggers the above bug because the deletion is processed
      successfully for `refs/foo`, then the D/F conflict causes
      `lock_ref_for_update()` to fail when `refs/foo/bar` is processed. In
      this case the transaction *should* fail, but instead it causes
      `refs/foo` to be deleted without creating `refs/foo`. This could
      easily result in data loss.
      
      The fix is simple: instead of just breaking out of the loop, jump
      directly to the cleanup code. This fixes some tests in t1404 that were
      added in the previous commit.
      Signed-off-by: default avatarMichael Haggerty <[email protected]>
      Signed-off-by: default avatarJunio C Hamano <[email protected]>
      da5267f1
    • Michael Haggerty's avatar
      t1404: add a bunch of tests of D/F conflicts · 2e9de01a
      Michael Haggerty authored
      It is currently not allowed, in a single transaction, to add one
      reference and delete another reference if the two reference names D/F
      conflict with each other (e.g., like `refs/foo/bar` and `refs/foo`).
      The reason is that the code would need to take locks
      
          $GIT_DIR/refs/foo.lock
          $GIT_DIR/refs/foo/bar.lock
      
      But the latter lock couldn't coexist with the loose reference file
      
          $GIT_DIR/refs/foo
      
      , because `$GIT_DIR/refs/foo` cannot be both a directory and a file at
      the same time (hence the name "D/F conflict).
      
      Add a bunch of tests that we cleanly reject such transactions.
      
      In fact, many of the new tests currently fail. They will be fixed in
      the next commit along with an explanation.
      Reported-by: default avatarJeff King <[email protected]>
      Signed-off-by: default avatarMichael Haggerty <[email protected]>
      Signed-off-by: default avatarJunio C Hamano <[email protected]>
      2e9de01a
  9. 24 Oct, 2017 5 commits
  10. 23 Oct, 2017 13 commits
    • Andre Hinrichs's avatar
      l10n: de.po: fix typos · 27e3e095
      Andre Hinrichs authored
      Signed-off-by: default avatarAndre Hinrichs <[email protected]>
      Signed-off-by: default avatarRalf Thielow <[email protected]>
      27e3e095
    • Ralf Thielow's avatar
      l10n: de.po: translate 70 new messages · 38178d7b
      Ralf Thielow authored
      Translate 70 new messages came from git.pot update in 25eab542
      (l10n: git.pot: v2.15.0 round 1 (68 new, 36 removed)) and 9c07fab7
      (l10n: git.pot: v2.15.0 round 2 (2 new, 2 removed)).
      Signed-off-by: default avatarRalf Thielow <[email protected]>
      38178d7b
    • Junio C Hamano's avatar
      Sync with 2.14.3 · c52ca884
      Junio C Hamano authored
      c52ca884
    • Junio C Hamano's avatar
      Git 2.14.3 · fc849d8d
      Junio C Hamano authored
      Signed-off-by: default avatarJunio C Hamano <[email protected]>
      fc849d8d
    • Junio C Hamano's avatar
      Merge branch 'jk/info-alternates-fix' into maint · 95c1a796
      Junio C Hamano authored
      A regression fix for 2.11 that made the code to read the list of
      alternate object stores overrun the end of the string.
      
      * jk/info-alternates-fix:
        read_info_alternates: warn on non-trivial errors
        read_info_alternates: read contents into strbuf
      95c1a796
    • Junio C Hamano's avatar
      Merge branch 'jc/fetch-refspec-doc-update' into maint · 9fc7bc65
      Junio C Hamano authored
      "git fetch <there> <src>:<dst>" allows an object name on the <src>
      side when the other side accepts such a request since Git v2.5, but
      the documentation was left stale.
      
      * jc/fetch-refspec-doc-update:
        fetch doc: src side of refspec could be full SHA-1
      9fc7bc65
    • Junio C Hamano's avatar
      Merge branch 'jk/write-in-full-fix' into maint · 96c6bb56
      Junio C Hamano authored
      Many codepaths did not diagnose write failures correctly when disks
      go full, due to their misuse of write_in_full() helper function,
      which have been corrected.
      
      * jk/write-in-full-fix:
        read_pack_header: handle signed/unsigned comparison in read result
        config: flip return value of store_write_*()
        notes-merge: use ssize_t for write_in_full() return value
        pkt-line: check write_in_full() errors against "< 0"
        convert less-trivial versions of "write_in_full() != len"
        avoid "write_in_full(fd, buf, len) != len" pattern
        get-tar-commit-id: check write_in_full() return against 0
        config: avoid "write_in_full(fd, buf, len) < len" pattern
      96c6bb56
    • Junio C Hamano's avatar
      Merge branch 'rj/no-sign-compare' into maint · 7186408f
      Junio C Hamano authored
      Many codepaths have been updated to squelch -Wsign-compare
      warnings.
      
      * rj/no-sign-compare:
        ALLOC_GROW: avoid -Wsign-compare warnings
        cache.h: hex2chr() - avoid -Wsign-compare warnings
        commit-slab.h: avoid -Wsign-compare warnings
        git-compat-util.h: xsize_t() - avoid -Wsign-compare warnings
      7186408f
    • Junio C Hamano's avatar
      Merge branch 'ma/ts-cleanups' into maint · dd3bfe4f
      Junio C Hamano authored
      Assorted bugfixes and clean-ups.
      
      * ma/ts-cleanups:
        ThreadSanitizer: add suppressions
        strbuf_setlen: don't write to strbuf_slopbuf
        pack-objects: take lock before accessing `remaining`
        convert: always initialize attr_action in convert_attrs
      dd3bfe4f
    • Junio C Hamano's avatar
      Merge branch 'ls/travis-scriptify' into maint · a37b73e9
      Junio C Hamano authored
      The scripts to drive TravisCI has been reorganized and then an
      optimization to avoid spending cycles on a branch whose tip is
      tagged has been implemented.
      
      * ls/travis-scriptify:
        travis-ci: fix "skip_branch_tip_with_tag()" string comparison
        travis: dedent a few scripts that are indented overly deeply
        travis-ci: skip a branch build if equal tag is present
        travis-ci: move Travis CI code into dedicated scripts
      a37b73e9
    • Junio C Hamano's avatar
      Merge branch 'er/fast-import-dump-refs-on-checkpoint' into maint · 031062dc
      Junio C Hamano authored
      The checkpoint command "git fast-import" did not flush updates to
      refs and marks unless at least one object was created since the
      last checkpoint, which has been corrected, as these things can
      happen without any new object getting created.
      
      * er/fast-import-dump-refs-on-checkpoint:
        fast-import: checkpoint: dump branches/tags/marks even if object_count==0
      031062dc
    • Junio C Hamano's avatar
      Merge branch 'jt/fast-export-copy-modify-fix' into maint · 120ce97f
      Junio C Hamano authored
      "git fast-export" with -M/-C option issued "copy" instruction on a
      path that is simultaneously modified, which was incorrect.
      
      * jt/fast-export-copy-modify-fix:
        fast-export: do not copy from modified file
      120ce97f
    • Junio C Hamano's avatar
      Merge branch 'nd/worktree-kill-parse-ref' into maint · 5253ad10
      Junio C Hamano authored
      "git branch -M a b" while on a branch that is completely unrelated
      to either branch a or branch b misbehaved when multiple worktree
      was in use.  This has been fixed.
      
      * nd/worktree-kill-parse-ref:
        branch: fix branch renaming not updating HEADs correctly
      5253ad10