1. 17 10月, 2014 5 次提交
    • J
      clean up name allocation in prepare_revision_walk · 1da1e07c
      Jeff King 提交于
      When we enter prepare_revision_walk, we have zero or more
      entries in our "pending" array. We disconnect that array
      from the rev_info, and then process each entry:
      
        1. If the entry is a commit and the --source option is in
           effect, we keep a pointer to the object name.
      
        2. Otherwise, we re-add the item to the pending list with
           a blank name.
      
      We then throw away the old array by freeing the array
      itself, but do not touch the "name" field of each entry. For
      any items of type (2), we leak the memory associated with
      the name. This commit fixes that by calling object_array_clear,
      which handles the cleanup for us.
      
      That breaks (1), though, because it depends on the memory
      pointed to by the name to last forever. We can solve that by
      making a copy of the name. This is slightly less efficient,
      but it shouldn't matter in practice, as we do it only for
      the tip commits of the traversal.
      Signed-off-by: NJeff King <peff@peff.net>
      Signed-off-by: NJunio C Hamano <gitster@pobox.com>
      1da1e07c
    • J
      object_array: add a "clear" function · 46be8231
      Jeff King 提交于
      There's currently no easy way to free the memory associated
      with an object_array (and in most cases, we simply leak the
      memory in a rev_info's pending array). Let's provide a
      helper to make this easier to handle.
      
      We can make use of it in list-objects.c, which does the same
      thing by hand (but fails to free the "name" field of each
      entry, potentially leaking memory).
      Signed-off-by: NJeff King <peff@peff.net>
      Signed-off-by: NJunio C Hamano <gitster@pobox.com>
      46be8231
    • J
      object_array: factor out slopbuf-freeing logic · 68f49235
      Jeff King 提交于
      This is not a lot of code, but it's a logical construct that
      should not need to be repeated (and we are about to add a
      third repetition).
      Signed-off-by: NJeff King <peff@peff.net>
      Signed-off-by: NJunio C Hamano <gitster@pobox.com>
      68f49235
    • J
      isxdigit: cast input to unsigned char · 50a71776
      Jeff King 提交于
      Otherwise, callers must do so or risk triggering warnings
      -Wchar-subscript (and rightfully so; a signed char might
      cause us to use a bogus negative index into the
      hexval_table).
      
      While we are dropping the now-unnecessary casts from the
      caller in urlmatch.c, we can get rid of similar casts in
      actually parsing the hex by using the hexval() helper, which
      implicitly casts to unsigned (but note that we cannot
      implement isxdigit in terms of hexval(), as it also casts
      its return value to unsigned).
      Signed-off-by: NJeff King <peff@peff.net>
      Signed-off-by: NJunio C Hamano <gitster@pobox.com>
      50a71776
    • J
      foreach_alt_odb: propagate return value from callback · fe1b2268
      Jeff King 提交于
      We check the return value of the callback and stop iterating
      if it is non-zero. However, we do not make the non-zero
      return value available to the caller, so they have no way of
      knowing whether the operation succeeded or not (technically
      they can keep their own error flag in the callback data, but
      that is unlike our other for_each functions).
      Signed-off-by: NJeff King <peff@peff.net>
      Signed-off-by: NJunio C Hamano <gitster@pobox.com>
      fe1b2268
  2. 14 10月, 2014 3 次提交
    • J
      test-lib.sh: support -x option for shell-tracing · a136f6d8
      Jeff King 提交于
      Usually running a test under "-v" makes it clear which
      command is failing. However, sometimes it can be useful to
      also see a complete trace of the shell commands being run in
      the test. You can do so without any support from the test
      suite by running "sh -x tXXXX-foo.sh". However, this
      produces quite a large bit of output, as we see a trace of
      the entire test suite.
      
      This patch instead introduces a "-x" option to the test
      scripts (i.e., "./tXXXX-foo.sh -x"). When enabled, this
      turns on "set -x" only for the tests themselves. This can
      still be a bit verbose, but should keep things to a more
      manageable level. You can even use "--verbose-only" to see
      the trace only for a specific test.
      
      The implementation is a little invasive. We turn on the "set
      -x" inside the "eval" of the test code. This lets the eval
      itself avoid being reported in the trace (which would be
      long, and redundant with the verbose listing we already
      showed). And then after the eval runs, we do some trickery
      with stderr to avoid showing the "set +x" to the user.
      
      We also show traces for test_cleanup functions (since they
      can impact the test outcome, too). However, we do avoid
      running the noop ":" cleanup (the default if the test does
      not use test_cleanup at all), as it creates unnecessary
      noise in the "set -x" output.
      Signed-off-by: NJeff King <peff@peff.net>
      Signed-off-by: NJunio C Hamano <gitster@pobox.com>
      a136f6d8
    • J
      t5304: use helper to report failure of "test foo = bar" · 8ad16524
      Jeff King 提交于
      For small outputs, we sometimes use:
      
        test "$(some_cmd)" = "something we expect"
      
      instead of a full test_cmp. The downside of this is that
      when it fails, there is no output at all from the script.
      Let's introduce a small helper to make tests easier to
      debug.
      Signed-off-by: NJeff King <peff@peff.net>
      Signed-off-by: NJunio C Hamano <gitster@pobox.com>
      8ad16524
    • J
      t5304: use test_path_is_* instead of "test -f" · f1dd90bd
      Jeff King 提交于
      This is slightly more robust (checking "! test -f" would not
      notice a directory of the same name, though that is not
      likely to happen here). It also makes debugging easier, as
      the test script will output a message on failure.
      Signed-off-by: NJeff King <peff@peff.net>
      Signed-off-by: NJunio C Hamano <gitster@pobox.com>
      f1dd90bd
  3. 09 10月, 2014 5 次提交
    • J
      Update draft release notes to 2.2 · 63a45136
      Junio C Hamano 提交于
      Signed-off-by: NJunio C Hamano <gitster@pobox.com>
      63a45136
    • J
      Merge branch 'sp/stream-clean-filter' · f0d89001
      Junio C Hamano 提交于
      When running a required clean filter, we do not have to mmap the
      original before feeding the filter.  Instead, stream the file
      contents directly to the filter and process its output.
      
      * sp/stream-clean-filter:
        sha1_file: don't convert off_t to size_t too early to avoid potential die()
        convert: stream from fd to required clean filter to reduce used address space
        copy_fd(): do not close the input file descriptor
        mmap_limit: introduce GIT_MMAP_LIMIT to allow testing expected mmap size
        memory_limit: use git_env_ulong() to parse GIT_ALLOC_LIMIT
        config.c: add git_env_ulong() to parse environment variable
        convert: drop arguments other than 'path' from would_convert_to_git()
      f0d89001
    • J
      Merge branch 'bw/use-write-script-in-tests' · 9342f497
      Junio C Hamano 提交于
      * bw/use-write-script-in-tests:
        t/lib-credential: use write_script
      9342f497
    • J
      Merge branch 'nd/archive-pathspec' · b2c45f5b
      Junio C Hamano 提交于
      "git archive" learned to filter what gets archived with pathspec.
      
      * nd/archive-pathspec:
        archive: support filtering paths with glob
      b2c45f5b
    • J
      Merge branch 'jc/push-cert' · fb06b528
      Junio C Hamano 提交于
      Allow "git push" request to be signed, so that it can be verified and
      audited, using the GPG signature of the person who pushed, that the
      tips of branches at a public repository really point the commits
      the pusher wanted to, without having to "trust" the server.
      
      * jc/push-cert: (24 commits)
        receive-pack::hmac_sha1(): copy the entire SHA-1 hash out
        signed push: allow stale nonce in stateless mode
        signed push: teach smart-HTTP to pass "git push --signed" around
        signed push: fortify against replay attacks
        signed push: add "pushee" header to push certificate
        signed push: remove duplicated protocol info
        send-pack: send feature request on push-cert packet
        receive-pack: GPG-validate push certificates
        push: the beginning of "git push --signed"
        pack-protocol doc: typofix for PKT-LINE
        gpg-interface: move parse_signature() to where it should be
        gpg-interface: move parse_gpg_output() to where it should be
        send-pack: clarify that cmds_sent is a boolean
        send-pack: refactor inspecting and resetting status and sending commands
        send-pack: rename "new_refs" to "need_pack_data"
        receive-pack: factor out capability string generation
        send-pack: factor out capability string generation
        send-pack: always send capabilities
        send-pack: refactor decision to send update per ref
        send-pack: move REF_STATUS_REJECT_NODELETE logic a bit higher
        ...
      fb06b528
  4. 08 10月, 2014 6 次提交
  5. 30 9月, 2014 21 次提交
    • J
      Sync with 2.1.2 · 565301e4
      Junio C Hamano 提交于
      * maint:
        Git 2.1.2
      565301e4
    • J
      Merge branch 'jt/itimer-autoconf' · 7dded661
      Junio C Hamano 提交于
      setitmer(2) and related API elements can be configured from
      Makefile but autoconf did not know about it.
      
      * jt/itimer-autoconf:
        autoconf: check for setitimer()
        autoconf: check for struct itimerval
        git-compat-util.h: add missing semicolon after struct itimerval
      7dded661
    • J
      Merge branch 'jc/test-lazy-prereq' · 0ba92ef3
      Junio C Hamano 提交于
      Test-script clean-up.
      
      * jc/test-lazy-prereq:
        tests: drop GIT_*_TIMING_TESTS environment variable support
      0ba92ef3
    • J
      Merge branch 'sb/merge-recursive-copy-paste-fix' · ab9bc95d
      Junio C Hamano 提交于
      "git merge-recursive" had a small bug that could have made it
      mishandle "one side deleted, the other side did not touch it" in a
      rare corner case, where the other side actually did touch to cause
      the blob object names to be different but both blobs before and
      after the change normalize to the same (e.g. correcting mistake to
      check in a blob with CRLF line endings by replacing it with another
      blob that records the same contents with LF line endings).
      
      * sb/merge-recursive-copy-paste-fix:
        merge-recursive: remove stale commented debugging code
        merge-recursive: fix copy-paste mistake
      ab9bc95d
    • J
      Merge branch 'pr/use-default-sigpipe-setting' · 131f0315
      Junio C Hamano 提交于
      We used to get confused when a process called us with SIGPIPE
      ignored; we do want to die with SIGPIPE when the output is not
      read by default, and do ignore the signal when appropriate.
      
      * pr/use-default-sigpipe-setting:
        mingw.h: add dummy functions for sigset_t operations
        unblock and unignore SIGPIPE
      131f0315
    • J
      Git 2.1.2 · 80b616d0
      Junio C Hamano 提交于
      Signed-off-by: NJunio C Hamano <gitster@pobox.com>
      80b616d0
    • J
      Merge branch 'jk/fsck-exit-code-fix' into maint · 46c8f859
      Junio C Hamano 提交于
      "git fsck" failed to report that it found corrupt objects via its
      exit status in some cases.
      
      * jk/fsck-exit-code-fix:
        fsck: return non-zero status on missing ref tips
        fsck: exit with non-zero status upon error from fsck_obj()
      46c8f859
    • J
      Merge branch 'ta/config-add-to-empty-or-true-fix' into maint · 102edda4
      Junio C Hamano 提交于
      "git config --add section.var val" used to lose existing
      section.var whose value was an empty string.
      
      * ta/config-add-to-empty-or-true-fix:
        config: avoid a funny sentinel value "a^"
        make config --add behave correctly for empty and NULL values
      102edda4
    • J
      Merge branch 'mk/reachable-protect-detached-head' into maint · 421ec4f8
      Junio C Hamano 提交于
      Reachability check (used in "git prune" and friends) did not add a
      detached HEAD as a starting point to traverse objects still in use.
      
      * mk/reachable-protect-detached-head:
        reachable.c: add HEAD to reachability starting commits
      421ec4f8
    • J
      Merge branch 'mb/fast-import-delete-root' into maint · 5b830a85
      Junio C Hamano 提交于
      An attempt to remove the entire tree in the "git fast-import" input
      stream caused it to misbehave.
      
      * mb/fast-import-delete-root:
        fast-import: fix segfault in store_tree()
        t9300: test filedelete command
      5b830a85
    • J
      Merge branch 'jk/index-pack-threading-races' into maint · 46092ebf
      Junio C Hamano 提交于
      When receiving an invalid pack stream that records the same object
      twice, multiple threads got confused due to a race.
      
      * jk/index-pack-threading-races:
        index-pack: fix race condition with duplicate bases
      46092ebf
    • J
      Merge branch 'jk/send-pack-many-refspecs' into maint · 06051709
      Junio C Hamano 提交于
      "git push" over HTTP transport had an artificial limit on number of
      refs that can be pushed imposed by the command line length.
      
      * jk/send-pack-many-refspecs:
        send-pack: take refspecs over stdin
      06051709
    • J
      Merge branch 'so/rebase-doc' into maint · e7867e80
      Junio C Hamano 提交于
      * so/rebase-doc:
        Documentation/git-rebase.txt: <upstream> must be given to specify <branch>
        Documentation/git-rebase.txt: -f forces a rebase that would otherwise be a no-op
      e7867e80
    • J
      Update draft release notes to 2.2 · 0bf7dd65
      Junio C Hamano 提交于
      0bf7dd65
    • J
      Merge branch 'jk/mbox-from-line' · 26d05873
      Junio C Hamano 提交于
      Some MUAs mangled a line in a message that begins with "From " to
      ">From " when writing to a mailbox file and feeding such an input
      to "git am" used to lose such a line.
      
      * jk/mbox-from-line:
        mailinfo: work around -Wstring-plus-int warning
        mailinfo: make ">From" in-body header check more robust
      26d05873
    • J
      Merge branch 'sb/t6031-typofix' · 12ba0e77
      Junio C Hamano 提交于
      * sb/t6031-typofix:
        t6031-test-merge-recursive: do not forget to add file to be committed
      12ba0e77
    • J
      Merge branch 'sb/t9300-typofix' · 4d4dc66d
      Junio C Hamano 提交于
      * sb/t9300-typofix:
        t9300-fast-import: fix typo in test description
      4d4dc66d
    • J
      Merge branch 'rs/remote-simplify' · 60dfd846
      Junio C Hamano 提交于
      * rs/remote-simplify:
        remote: simplify match_name_with_pattern() using strbuf
      60dfd846
    • J
      Merge branch 'rs/graph-simplify' · 0a2ba82c
      Junio C Hamano 提交于
      * rs/graph-simplify:
        graph: simplify graph_padding_line()
      0a2ba82c
    • J
      Merge branch 'da/rev-parse-verify-quiet' · 507fe835
      Junio C Hamano 提交于
      "rev-parse --verify --quiet $name" is meant to quietly exit with a
      non-zero status when $name is not a valid object name, but still
      gave error messages in some cases.
      
      * da/rev-parse-verify-quiet:
        stash: prefer --quiet over shell redirection of the standard error stream
        refs: make rev-parse --quiet actually quiet
        t1503: use test_must_be_empty
        Documentation: a note about stdout for git rev-parse --verify --quiet
      507fe835
    • J
      Merge branch 'hj/pretty-naked-decoration' · b8e533f1
      Junio C Hamano 提交于
      The pretty-format specifier "%d", which expanded to " (tagname)"
      for a tagged commit, gained a cousin "%D" that just gives the
      "tagname" without frills.
      
      * hj/pretty-naked-decoration:
        pretty: add %D format specifier
      b8e533f1