1. 22 3月, 2017 16 次提交
    • J
      Merge branch 'jk/t6300-cleanup' into maint · 7e02ec2c
      Junio C Hamano 提交于
      A test that creates a confusing branch whose name is HEAD has been
      corrected not to do so.
      
      * jk/t6300-cleanup:
        t6300: avoid creating refs/heads/HEAD
      7e02ec2c
    • J
      Merge branch 'rs/commit-parsing-optim' into maint · d6bc22e6
      Junio C Hamano 提交于
      The code that parses header fields in the commit object has been
      updated for (micro)performance and code hygiene.
      
      * rs/commit-parsing-optim:
        commit: don't check for space twice when looking for header
        commit: be more precise when searching for headers
      d6bc22e6
    • J
      Merge branch 'jk/show-branch-lift-name-len-limit' into maint · 93abd178
      Junio C Hamano 提交于
      "git show-branch" expected there were only very short branch names
      in the repository and used a fixed-length buffer to hold them
      without checking for overflow.
      
      * jk/show-branch-lift-name-len-limit:
        show-branch: use skip_prefix to drop magic numbers
        show-branch: store resolved head in heap buffer
        show-branch: drop head_len variable
      93abd178
    • J
      Merge branch 'jk/tempfile-ferror-fclose-confusion' into maint · f63df942
      Junio C Hamano 提交于
      A caller of tempfile API that uses stdio interface to write to
      files may ignore errors while writing, which is detected when
      tempfile is closed (with a call to ferror()).  By that time, the
      original errno that may have told us what went wrong is likely to
      be long gone and was overwritten by an irrelevant value.
      close_tempfile() now resets errno to EIO to make errno at least
      predictable.
      
      * jk/tempfile-ferror-fclose-confusion:
        tempfile: set errno to a known value before calling ferror()
      f63df942
    • J
      Merge branch 'rl/remote-allow-missing-branch-name-merge' into maint · 0d9f9424
      Junio C Hamano 提交于
      "git remote rm X", when a branch has remote X configured as the
      value of its branch.*.remote, tried to remove branch.*.remote and
      branch.*.merge and failed if either is unset.
      
      * rl/remote-allow-missing-branch-name-merge:
        remote: ignore failure to remove missing branch.<name>.merge
      0d9f9424
    • J
      Merge branch 'dt/gc-ignore-old-gc-logs' into maint · d30ec1be
      Junio C Hamano 提交于
      A "gc.log" file left by a backgrounded "gc --auto" disables further
      automatic gc; it has been taught to run at least once a day (by
      default) by ignoring a stale "gc.log" file that is too old.
      
      * dt/gc-ignore-old-gc-logs:
        gc: ignore old gc.log files
      d30ec1be
    • J
      Merge branch 'jt/upload-pack-error-report' into maint · f4470f2d
      Junio C Hamano 提交于
      "git upload-pack", which is a counter-part of "git fetch", did not
      report a request for a ref that was not advertised as invalid.
      This is generally not a problem (because "git fetch" will stop
      before making such a request), but is the right thing to do.
      
      * jt/upload-pack-error-report:
        upload-pack: report "not our ref" to client
      f4470f2d
    • J
      Merge branch 'rs/sha1-file-plug-fallback-base-leak' into maint · e36e28e6
      Junio C Hamano 提交于
      A leak in a codepath to read from a packed object in (rare) cases
      has been plugged.
      
      * rs/sha1-file-plug-fallback-base-leak:
        sha1_file: release fallback base's memory in unpack_entry()
      e36e28e6
    • J
      Merge branch 'ss/remote-bzr-hg-placeholder-wo-python' into maint · d46d4325
      Junio C Hamano 提交于
      There is no need for Python only to give a few messages to the
      standard error stream, but we somehow did.
      
      * ss/remote-bzr-hg-placeholder-wo-python:
        contrib: git-remote-{bzr,hg} placeholders don't need Python
      d46d4325
    • J
      Merge branch 'jc/diff-populate-filespec-size-only-fix' into maint · cc8e385a
      Junio C Hamano 提交于
      "git diff --quiet" relies on the size field in diff_filespec to be
      correctly populated, but diff_populate_filespec() helper function
      made an incorrect short-cut when asked only to populate the size
      field for paths that need to go through convert_to_git() (e.g. CRLF
      conversion).
      
      * jc/diff-populate-filespec-size-only-fix:
        diff: do not short-cut CHECK_SIZE_ONLY check in diff_populate_filespec()
      cc8e385a
    • J
      Merge branch 'jk/http-walker-buffer-underflow-fix' into maint · 36238fc4
      Junio C Hamano 提交于
      "Dumb http" transport used to misparse a nonsense http-alternates
      response, which has been fixed.
      
      * jk/http-walker-buffer-underflow-fix:
        http-walker: fix buffer underflow processing remote alternates
      36238fc4
    • J
      Merge branch 'mg/status-porcelain-no-i18n' into maint · 1a61be2a
      Junio C Hamano 提交于
      "git status --porcelain" is supposed to give a stable output, but a
      few strings were left as translatable by mistake.
      
      * mg/status-porcelain-no-i18n:
        git-status: make porcelain more robust
      1a61be2a
    • J
      Merge branch 'ps/docs-diffcore' into maint · 5c6bc968
      Junio C Hamano 提交于
      Doc update.
      
      * ps/docs-diffcore:
        docs/diffcore: unquote "Complete Rewrites" in headers
        docs/diffcore: fix grammar in diffcore-rename header
      5c6bc968
    • J
      Merge branch 'ew/markdown-url-in-readme' into maint · c157ae9c
      Junio C Hamano 提交于
      Doc update.
      
      * ew/markdown-url-in-readme:
        README: create HTTP/HTTPS links from URLs in Markdown
      c157ae9c
    • J
      Merge branch 'rj/remove-unused-mktemp' into maint · f56a4390
      Junio C Hamano 提交于
      Code cleanup.
      
      * rj/remove-unused-mktemp:
        wrapper.c: remove unused gitmkstemps() function
        wrapper.c: remove unused git_mkstemp() function
      f56a4390
    • J
      Merge branch 'jk/ewah-use-right-type-in-sizeof' into maint · 06c0ed7b
      Junio C Hamano 提交于
      Code clean-up.
      
      * jk/ewah-use-right-type-in-sizeof:
        ewah: fix eword_t/uint64_t confusion
      06c0ed7b
  2. 21 3月, 2017 1 次提交
  3. 17 3月, 2017 10 次提交
    • J
      Preparing for 2.12.1 · 7c9c2f8c
      Junio C Hamano 提交于
      Signed-off-by: NJunio C Hamano <gitster@pobox.com>
      7c9c2f8c
    • J
      Merge branch 'js/realpath-pathdup-fix' into maint · 2846ef3e
      Junio C Hamano 提交于
      Git v2.12 was shipped with an embarrassing breakage where various
      operations that verify paths given from the user stopped dying when
      seeing an issue, and instead later triggering segfault.
      ... and then to down to 'maint'.
      
      * js/realpath-pathdup-fix:
        real_pathdup(): fix callsites that wanted it to die on error
        t1501: demonstrate NULL pointer access with invalid GIT_WORK_TREE
      2846ef3e
    • J
      Merge branch 'mm/two-more-xstrfmt' into maint · f989ac27
      Junio C Hamano 提交于
      Code clean-up and a string truncation fix.
      
      * mm/two-more-xstrfmt:
        bisect_next_all: convert xsnprintf to xstrfmt
        stop_progress_msg: convert xsnprintf to xstrfmt
      f989ac27
    • J
      Merge branch 'vn/line-log-memcpy-size-fix' into maint · 3d0449de
      Junio C Hamano 提交于
      The command-line parsing of "git log -L" copied internal data
      structures using incorrect size on ILP32 systems.
      
      * vn/line-log-memcpy-size-fix:
        line-log: use COPY_ARRAY to fix mis-sized memcpy
      3d0449de
    • J
      Merge branch 'ax/line-log-range-merge-fix' into maint · c5bd9e5a
      Junio C Hamano 提交于
      The code to parse "git log -L..." command line was buggy when there
      are many ranges specified with -L; overrun of the allocated buffer
      has been fixed.
      
      * ax/line-log-range-merge-fix:
        line-log.c: prevent crash during union of too many ranges
      c5bd9e5a
    • J
      Merge branch 'jk/add-i-patch-do-prompt' into maint · abe62a40
      Junio C Hamano 提交于
      The patch subcommand of "git add -i" was meant to have paths
      selection prompt just like other subcommand, unlike "git add -p"
      directly jumps to hunk selection.  Recently, this was broken and
      "add -i" lost the paths selection dialog, but it now has been
      fixed.
      
      * jk/add-i-patch-do-prompt:
        add--interactive: fix missing file prompt for patch mode with "-i"
      abe62a40
    • J
      Merge branch 'jt/http-base-url-update-upon-redirect' into maint · 68e12d7d
      Junio C Hamano 提交于
      When a redirected http transport gets an error during the
      redirected request, we ignored the error we got from the server,
      and ended up giving a not-so-useful error message.
      
      * jt/http-base-url-update-upon-redirect:
        http: attempt updating base URL only if no error
      68e12d7d
    • J
      Merge branch 'js/travis-32bit-linux' into maint · 8e87cbc7
      Junio C Hamano 提交于
      Add 32-bit Linux variant to the set of platforms to be tested with
      Travis CI.
      
      * js/travis-32bit-linux:
        Travis: also test on 32-bit Linux
      8e87cbc7
    • J
      Merge branch 'jh/mingw-openssl-sha1' into maint · 890d7650
      Junio C Hamano 提交于
      Windows port wants to use OpenSSL's implementation of SHA-1
      routines, so let them.
      
      * jh/mingw-openssl-sha1:
        mingw: use OpenSSL's SHA-1 routines
      890d7650
    • J
      Merge branch 'jk/http-auth' into maint · d880bfd9
      Junio C Hamano 提交于
      Reduce authentication round-trip over HTTP when the server supports
      just a single authentication method.
      
      * jk/http-auth:
        http: add an "auto" mode for http.emptyauth
        http: restrict auth methods to what the server advertises
      d880bfd9
  4. 15 3月, 2017 1 次提交
    • M
      git-status: make porcelain more robust · b9e2bc56
      Michael J Gruber 提交于
      git status provides a porcelain mode for porcelain writers with a
      supposedly stable (plumbing) interface.
      7a76c28f ("status: disable translation when --porcelain is used", 2014-03-20)
      made sure that ahead/behind info is not translated (i.e. is stable).
      
      Make sure that the remaining two strings (initial commit, detached head)
      are stable, too.
      
      These changes are for the v1 porcelain interface. While we do have a perfectly
      stable v2 porcelain interface now, some tools (such as
      powerline-gitstatus) are written against v1 and profit from fixing v1
      without any changes on their side.
      Signed-off-by: NMichael J Gruber <git@drmicha.warpmail.net>
      Signed-off-by: NJunio C Hamano <gitster@pobox.com>
      b9e2bc56
  5. 14 3月, 2017 1 次提交
    • J
      http-walker: fix buffer underflow processing remote alternates · d61434ae
      Jeff King 提交于
      If we parse a remote alternates (or http-alternates), we
      expect relative lines like:
      
        ../../foo.git/objects
      
      which we convert into "$URL/../foo.git/" (and then use that
      as a base for fetching more objects).
      
      But if the remote feeds us nonsense like just:
      
        ../
      
      we will try to blindly strip the last 7 characters, assuming
      they contain the string "objects". Since we don't _have_ 7
      characters at all, this results in feeding a small negative
      value to strbuf_add(), which converts it to a size_t,
      resulting in a big positive value. This should consistently
      fail (since we can't generall allocate the max size_t minus
      7 bytes), so there shouldn't be any security implications.
      
      Let's fix this by using strbuf_strip_suffix() to drop the
      characters we want. If they're not present, we'll ignore the
      alternate (in theory we could use it as-is, but the rest of
      the http-walker code unconditionally tacks "objects/" back
      on, so it is it not prepared to handle such a case).
      Signed-off-by: NJeff King <peff@peff.net>
      Signed-off-by: NJunio C Hamano <gitster@pobox.com>
      d61434ae
  6. 09 3月, 2017 2 次提交
  7. 07 3月, 2017 3 次提交
    • J
      ewah: fix eword_t/uint64_t confusion · 3255e512
      Jeff King 提交于
      The ewah subsystem typedefs eword_t to be uint64_t, but some
      code uses a bare uint64_t. This isn't a bug now, but it's a
      potential maintenance problem if the definition of eword_t
      ever changes. Let's use the correct type.
      
      Note that we can't use COPY_ARRAY() here because the source
      and destination point to objects of different sizes. For
      that reason we'll also skip the usual "sizeof(*dst)" and use
      the real type, which should make it more clear that there's
      something tricky going on.
      Signed-off-by: NJeff King <peff@peff.net>
      Signed-off-by: NJunio C Hamano <gitster@pobox.com>
      3255e512
    • V
      line-log: use COPY_ARRAY to fix mis-sized memcpy · 07f546cd
      Vegard Nossum 提交于
      This memcpy meant to get the sizeof a "struct range", not a
      "range_set", as the former is what our array holds. Rather
      than swap out the types, let's convert this site to
      COPY_ARRAY, which avoids the problem entirely (and confirms
      that the src and dst types match).
      
      Note for curiosity's sake that this bug doesn't trigger on
      I32LP64 systems, but does on ILP32 systems. The mistaken
      "struct range_set" has two ints and a pointer. That's 16
      bytes on LP64, or 12 on ILP32. The correct "struct range"
      type has two longs, which is also 16 on LP64, but only 8 on
      ILP32.
      
      Likewise an IL32P64 system would experience the bug.
      Signed-off-by: NJeff King <peff@peff.net>
      Signed-off-by: NVegard Nossum <vegard.nossum@oracle.com>
      Signed-off-by: NJunio C Hamano <gitster@pobox.com>
      07f546cd
    • J
      Travis: also test on 32-bit Linux · 88dedd5e
      Johannes Schindelin 提交于
      When Git v2.9.1 was released, it had a bug that showed only on Windows
      and on 32-bit systems: our assumption that `unsigned long` can hold
      64-bit values turned out to be wrong.
      
      This could have been caught earlier if we had a Continuous Testing
      set up that includes a build and test run on 32-bit Linux.
      
      Let's do this (and take care of the Windows build later). This patch
      asks Travis CI to install a Docker image with 32-bit libraries and then
      goes on to build and test Git using this 32-bit setup.
      Signed-off-by: NJohannes Schindelin <johannes.schindelin@gmx.de>
      Signed-off-by: NLars Schneider <larsxschneider@gmail.com>
      Signed-off-by: NJunio C Hamano <gitster@pobox.com>
      88dedd5e
  8. 04 3月, 2017 2 次提交
    • A
      line-log.c: prevent crash during union of too many ranges · aaae0bf7
      Allan Xavier 提交于
      The existing implementation of range_set_union does not correctly
      reallocate memory, leading to a heap overflow when it attempts to union
      more than 24 separate line ranges.
      
      For struct range_set *out to grow correctly it must have out->nr set to
      the current size of the buffer when it is passed to range_set_grow.
      However, the existing implementation of range_set_union only updates
      out->nr at the end of the function, meaning that it is always zero
      before this. This results in range_set_grow never growing the buffer, as
      well as some of the union logic itself being incorrect as !out->nr is
      always true.
      
      The reason why 24 is the limit is that the first allocation of size 1
      ends up allocating a buffer of size 24 (due to the call to alloc_nr in
      ALLOC_GROW). This goes some way to explain why this hasn't been
      caught before.
      
      Fix the problem by correctly updating out->nr after reallocating the
      range_set. As this results in out->nr containing the same value as the
      variable o, replace o with out->nr as well.
      
      Finally, add a new test to help prevent the problem reoccurring in the
      future. Thanks to Vegard Nossum for writing the test.
      Signed-off-by: NAllan Xavier <allan.x.xavier@oracle.com>
      Reviewed-by: NJeff King <peff@peff.net>
      Signed-off-by: NJunio C Hamano <gitster@pobox.com>
      aaae0bf7
    • S
      contrib: git-remote-{bzr,hg} placeholders don't need Python · b8686c66
      Sebastian Schuberth 提交于
      It does not make sense for these placeholder scripts to depend on Python
      just because the real scripts do. At the example of Git for Windows, we
      would not even be able to see those warnings as it does not ship with
      Python. So just use plain shell scripts instead.
      Signed-off-by: NSebastian Schuberth <sschuberth@gmail.com>
      Reviewed-by: NJeff King <peff@peff.net>
      Signed-off-by: NJunio C Hamano <gitster@pobox.com>
      b8686c66
  9. 03 3月, 2017 2 次提交
    • J
      diff: do not short-cut CHECK_SIZE_ONLY check in diff_populate_filespec() · 12426e11
      Junio C Hamano 提交于
      Callers of diff_populate_filespec() can choose to ask only for the
      size of the blob without grabbing the blob data, and the function,
      after running lstat() when the filespec points at a working tree
      file, returns by copying the value in size field of the stat
      structure into the size field of the filespec when this is the case.
      
      However, this short-cut cannot be taken if the contents from the
      path needs to go through convert_to_git(), whose resulting real blob
      data may be different from what is in the working tree file.
      
      As "git diff --quiet" compares the .size fields of filespec
      structures to skip content comparison, this bug manifests as a
      false "there are differences" for a file that needs eol conversion,
      for example.
      Reported-by: NMike Crowe <mac@mcrowe.com>
      Helped-by: NTorsten Bögershausen <tboegi@web.de>
      Signed-off-by: NJunio C Hamano <gitster@pobox.com>
      12426e11
    • J
      add--interactive: fix missing file prompt for patch mode with "-i" · c852bd54
      Jeff King 提交于
      When invoked as "git add -i", each menu interactive menu
      option prompts the user to select a list of files. This
      includes the "patch" option, which gets the list before
      starting the hunk-selection loop.
      
      As "git add -p", it behaves differently, and jumps straight
      to the hunk selection loop.
      
      Since 0539d5e6 (i18n: add--interactive: mark patch prompt
      for translation, 2016-12-14), the "add -i" case mistakenly
      jumps to straight to the hunk-selection loop. Prior to that
      commit the distinction between the two cases was managed by
      the $patch_mode variable. That commit used $patch_mode for
      something else, and moved the old meaning to the "$cmd"
      variable.  But it forgot to update the $patch_mode check
      inside patch_update_cmd() which controls the file-list
      behavior.
      
      The simplest fix would be to change that line to check $cmd.
      But while we're here, let's use a less obscure name for this
      flag: $patch_mode_only, a boolean which tells whether we are
      in full-interactive mode or only in patch-mode.
      Reported-by: NHenrik Grubbström <grubba@grubba.org>
      Signed-off-by: NJeff King <peff@peff.net>
      Signed-off-by: NJunio C Hamano <gitster@pobox.com>
      c852bd54
  10. 02 3月, 2017 1 次提交
  11. 01 3月, 2017 1 次提交