1. 16 11月, 2017 1 次提交
    • S
      revision.h: introduce blob/tree walking in order of the commits · ce5b6f9b
      Stefan Beller 提交于
      The functionality to list tree objects in the order they were seen
      while traversing the commits will be used in one of the next commits,
      where we teach `git describe` to describe not only commits, but blobs, too.
      
      The change in list-objects.c is rather minimal as we'll be re-using
      the infrastructure put in place of the revision walking machinery. For
      example one could expect that add_pending_tree is not called, but rather
      commit->tree is directly passed to the tree traversal function. This
      however requires a lot more code than just emptying the queue containing
      trees after each commit.
      Signed-off-by: NStefan Beller <sbeller@google.com>
      Signed-off-by: NJunio C Hamano <gitster@pobox.com>
      ce5b6f9b
  2. 03 11月, 2017 2 次提交
  3. 30 10月, 2017 2 次提交
  4. 29 10月, 2017 1 次提交
  5. 28 10月, 2017 5 次提交
  6. 27 10月, 2017 2 次提交
  7. 26 10月, 2017 1 次提交
    • J
      Merge branch 'mh/ref-locking-fix' · 4e40fb30
      Junio C Hamano 提交于
      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 10月, 2017 3 次提交
    • A
      path.c: use xmalloc() in add_to_trie() · 55d7d158
      Andrey Okoshkin 提交于
      Add usage of xmalloc() instead of malloc() in add_to_trie() as xmalloc wraps
      and checks memory allocation result.
      Signed-off-by: NAndrey Okoshkin <a.okoshkin@samsung.com>
      Signed-off-by: NJunio C Hamano <gitster@pobox.com>
      55d7d158
    • M
      files_transaction_prepare(): fix handling of ref lock failure · da5267f1
      Michael Haggerty 提交于
      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: NMichael Haggerty <mhagger@alum.mit.edu>
      Signed-off-by: NJunio C Hamano <gitster@pobox.com>
      da5267f1
    • M
      t1404: add a bunch of tests of D/F conflicts · 2e9de01a
      Michael Haggerty 提交于
      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: NJeff King <peff@peff.net>
      Signed-off-by: NMichael Haggerty <mhagger@alum.mit.edu>
      Signed-off-by: NJunio C Hamano <gitster@pobox.com>
      2e9de01a
  9. 24 10月, 2017 7 次提交
  10. 23 10月, 2017 12 次提交
    • J
      Sync with 2.14.3 · c52ca884
      Junio C Hamano 提交于
      c52ca884
    • J
      Git 2.14.3 · fc849d8d
      Junio C Hamano 提交于
      Signed-off-by: NJunio C Hamano <gitster@pobox.com>
      fc849d8d
    • J
      Merge branch 'jk/info-alternates-fix' into maint · 95c1a796
      Junio C Hamano 提交于
      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
    • J
      Merge branch 'jc/fetch-refspec-doc-update' into maint · 9fc7bc65
      Junio C Hamano 提交于
      "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
    • J
      Merge branch 'jk/write-in-full-fix' into maint · 96c6bb56
      Junio C Hamano 提交于
      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
    • J
      Merge branch 'rj/no-sign-compare' into maint · 7186408f
      Junio C Hamano 提交于
      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
    • J
      Merge branch 'ma/ts-cleanups' into maint · dd3bfe4f
      Junio C Hamano 提交于
      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
    • J
      Merge branch 'ls/travis-scriptify' into maint · a37b73e9
      Junio C Hamano 提交于
      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
    • J
      Merge branch 'er/fast-import-dump-refs-on-checkpoint' into maint · 031062dc
      Junio C Hamano 提交于
      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
    • J
      Merge branch 'jt/fast-export-copy-modify-fix' into maint · 120ce97f
      Junio C Hamano 提交于
      "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
    • J
      Merge branch 'nd/worktree-kill-parse-ref' into maint · 5253ad10
      Junio C Hamano 提交于
      "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
    • D
      c8e2301d
  11. 22 10月, 2017 1 次提交
  12. 19 10月, 2017 3 次提交