1. 11 3月, 2017 13 次提交
    • J
      Merge branch 'ps/docs-diffcore' · 9664cef1
      Junio C Hamano 提交于
      Doc update.
      
      * ps/docs-diffcore:
        docs/diffcore: unquote "Complete Rewrites" in headers
        docs/diffcore: fix grammar in diffcore-rename header
      9664cef1
    • J
      Merge branch 'jt/http-base-url-update-upon-redirect' · d0f549f4
      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
      d0f549f4
    • J
      Merge branch 'jk/http-auth' · 92718f57
      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
      92718f57
    • J
      Merge branch 'jh/send-email-one-cc' · ea1e784c
      Junio C Hamano 提交于
      "Cc:" on the trailer part does not have to conform to RFC strictly,
      unlike in the e-mail header.  "git send-email" has been updated to
      ignore anything after '>' when picking addresses, to allow non-address
      cruft like " # stable 4.4" after the address.
      
      * jh/send-email-one-cc:
        send-email: only allow one address per body tag
      ea1e784c
    • J
      Merge branch 'rs/strbuf-add-real-path' · fc322935
      Junio C Hamano 提交于
      An helper function to make it easier to append the result from
      real_path() to a strbuf has been added.
      
      * rs/strbuf-add-real-path:
        strbuf: add strbuf_add_real_path()
        cocci: use ALLOC_ARRAY
      fc322935
    • J
      Merge branch 'rs/sha1-file-plug-fallback-base-leak' · 82682e21
      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()
      82682e21
    • J
      Merge branch 'rs/commit-parsing-optim' · 98c96f8b
      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
      98c96f8b
    • J
      Merge branch 'jk/t6300-cleanup' · 11cfc0ef
      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
      11cfc0ef
    • J
      Merge branch 'jk/parse-config-key-cleanup' · 963792ed
      Junio C Hamano 提交于
      The "parse_config_key()" API function has been cleaned up.
      
      * jk/parse-config-key-cleanup:
        parse_hide_refs_config: tell parse_config_key we don't want a subsection
        parse_config_key: allow matching single-level config
        parse_config_key: use skip_prefix instead of starts_with
      963792ed
    • J
      Merge branch 'sb/parse-hide-refs-config-cleanup' · 34061299
      Junio C Hamano 提交于
      Code clean-up.
      
      * sb/parse-hide-refs-config-cleanup:
        refs: parse_hide_refs_config to use parse_config_key
      34061299
    • J
      Merge branch 'jt/upload-pack-error-report' · a729e467
      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
      a729e467
    • J
      Merge branch 'jk/ident-empty' · 066c38ca
      Junio C Hamano 提交于
      user.email that consists of only cruft chars should consistently
      error out, but didn't.
      
      * jk/ident-empty:
        ident: do not ignore empty config name/email
        ident: reject all-crud ident name
        ident: handle NULL email when complaining of empty name
        ident: mark error messages for translation
      066c38ca
    • J
      Merge branch 'jc/config-case-cmdline-take-2' · 2f54451f
      Junio C Hamano 提交于
      The code to parse "git -c VAR=VAL cmd" and set configuration
      variable for the duration of cmd had two small bugs, which have
      been fixed.
      
      * jc/config-case-cmdline-take-2:
        config: use git_config_parse_key() in git_config_parse_parameter()
        config: move a few helper functions up
      2f54451f
  2. 08 3月, 2017 1 次提交
  3. 01 3月, 2017 3 次提交
    • J
      http: attempt updating base URL only if no error · 8e27391a
      Jonathan Tan 提交于
      http.c supports HTTP redirects of the form
      
        http://foo/info/refs?service=git-upload-pack
        -> http://anything
        -> http://bar/info/refs?service=git-upload-pack
      
      (that is to say, as long as the Git part of the path and the query
      string is preserved in the final redirect destination, the intermediate
      steps can have any URL). However, if one of the intermediate steps
      results in an HTTP exception, a confusing "unable to update url base
      from redirection" message is printed instead of a Curl error message
      with the HTTP exception code.
      
      This was introduced by 2 commits. Commit c93c92f3 ("http: update base
      URLs when we see redirects", 2013-09-28) introduced a best-effort
      optimization that required checking if only the "base" part of the URL
      differed between the initial request and the final redirect destination,
      but it performed the check before any HTTP status checking was done. If
      something went wrong, the normal code path was still followed, so this
      did not cause any confusing error messages until commit 6628eb41 ("http:
      always update the base URL for redirects", 2016-12-06), which taught
      http to die if the non-"base" part of the URL differed.
      
      Therefore, teach http to check the HTTP status before attempting to
      check if only the "base" part of the URL differed. This commit teaches
      http_request_reauth to return early without updating options->base_url
      upon an error; the only invoker of this function that passes a non-NULL
      "options" is remote-curl.c (through "http_get_strbuf"), which only uses
      options->base_url for an informational message in the situations that
      this commit cares about (that is, when the return value is not HTTP_OK).
      
      The included test checks that the redirect scheme at the beginning of
      this commit message works, and that returning a 502 in the middle of the
      redirect scheme produces the correct result. Note that this is different
      from the test in commit 6628eb41 ("http: always update the base URL for
      redirects", 2016-12-06) in that this commit tests that a Git-shaped URL
      (http://.../info/refs?service=git-upload-pack) works, whereas commit
      6628eb41 tests that a non-Git-shaped URL
      (http://.../info/refs/foo?service=git-upload-pack) does not work (even
      though Git is processing that URL) and is an error that is fatal, not
      silently swallowed.
      Signed-off-by: NJonathan Tan <jonathantanmy@google.com>
      Acked-by: NJeff King <peff@peff.net>
      Signed-off-by: NJunio C Hamano <gitster@pobox.com>
      8e27391a
    • P
      docs/diffcore: unquote "Complete Rewrites" in headers · b803ae44
      Patrick Steinhardt 提交于
      The gitdiffcore documentation quotes the term "Complete Rewrites" in
      headers for no real gain. This would make sense if the term could be
      easily confused if not properly grouped together. But actually, the term
      is quite obvious and thus does not really need any quoting, especially
      regarding that it is not used anywhere else.
      
      But more importanly, this brings up a bug when rendering man pages: when
      trying to render quotes inside of a section header, we end up with
      quotes which have been misaligned to the end of line. E.g.
      
          diffcore-break: For Splitting Up Complete Rewrites
          --------------------------------------------------
      
      renders as
      
          DIFFCORE-BREAK: FOR SPLITTING UP  COMPLETE REWRITES""
      
      , which is obviously wrong. While this is fixable for the man pages by
      using double-quotes (e.g. ""COMPLETE REWRITES""), this again breaks it
      for our generated HTML pages.
      
      So fix the issue by simply dropping quotes inside of section headers,
      which is currently only done for the term "Complete Rewrites".
      Signed-off-by: NPatrick Steinhardt <ps@pks.im>
      Signed-off-by: NJunio C Hamano <gitster@pobox.com>
      b803ae44
    • P
      1aa38199
  4. 28 2月, 2017 23 次提交
    • J
      First batch after 2.12 · 3bc53220
      Junio C Hamano 提交于
      Signed-off-by: NJunio C Hamano <gitster@pobox.com>
      3bc53220
    • J
      Merge branch 'rl/remote-allow-missing-branch-name-merge' · 3e5c6394
      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
      3e5c6394
    • J
      Merge branch 'km/delete-ref-reflog-message' · c13c783c
      Junio C Hamano 提交于
      "git update-ref -d" and other operations to delete references did
      not leave any entry in HEAD's reflog when the reference being
      deleted was the current branch.  This is not a problem in practice
      because you do not want to delete the branch you are currently on,
      but caused renaming of the current branch to something else not to
      be logged in a useful way.
      
      * km/delete-ref-reflog-message:
        branch: record creation of renamed branch in HEAD's log
        rename_ref: replace empty message in HEAD's log
        update-ref: pass reflog message to delete_ref()
        delete_ref: accept a reflog message argument
      c13c783c
    • J
      Merge branch 'jk/tempfile-ferror-fclose-confusion' · 3f7ebc6e
      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()
      3f7ebc6e
    • J
      Merge branch 'vn/xdiff-func-context' · 9720b302
      Junio C Hamano 提交于
      "git diff -W" has been taught to handle the case where a new
      function is added at the end of the file better.
      
      * vn/xdiff-func-context:
        xdiff -W: relax end-of-file function detection
      9720b302
    • J
      Merge branch 'js/git-path-in-subdir' · 39b8980b
      Junio C Hamano 提交于
      The "--git-path", "--git-common-dir", and "--shared-index-path"
      options of "git rev-parse" did not produce usable output.  They are
      now updated to show the path to the correct file, relative to where
      the caller is.
      
      * js/git-path-in-subdir:
        rev-parse: fix several options when running in a subdirectory
        rev-parse tests: add tests executed from a subdirectory
      39b8980b
    • J
      Merge branch 'mm/two-more-xstrfmt' · b760481a
      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
      b760481a
    • J
      Merge branch 'nd/clean-preserve-errno-in-warning' · b4ca5d05
      Junio C Hamano 提交于
      Some warning() messages from "git clean" were updated to show the
      errno from failed system calls.
      
      * nd/clean-preserve-errno-in-warning:
        clean: use warning_errno() when appropriate
      b4ca5d05
    • J
      Merge branch 'jk/show-branch-lift-name-len-limit' · 74a77277
      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
      74a77277
    • J
      Merge branch 'jn/remote-helpers-with-git-dir' · ace83dc2
      Junio C Hamano 提交于
      "git ls-remote" and "git archive --remote" are designed to work
      without being in a directory under Git's control.  However, recent
      updates revealed that we randomly look into a directory called
      .git/ without actually doing necessary set-up when working in a
      repository.  Stop doing so.
      
      * jn/remote-helpers-with-git-dir:
        remote helpers: avoid blind fall-back to ".git" when setting GIT_DIR
        remote: avoid reading $GIT_DIR config in non-repo
      ace83dc2
    • J
      Merge branch 'jk/grep-no-index-fix' · 036465a2
      Junio C Hamano 提交于
      The code to parse the command line "git grep <patterns>... <rev>
      [[--] <pathspec>...]" has been cleaned up, and a handful of bugs
      have been fixed (e.g. we used to check "--" if it is a rev).
      
      * jk/grep-no-index-fix:
        grep: treat revs the same for --untracked as for --no-index
        grep: do not diagnose misspelt revs with --no-index
        grep: avoid resolving revision names in --no-index case
        grep: fix "--" rev/pathspec disambiguation
        grep: re-order rev-parsing loop
        grep: do not unnecessarily query repo for "--"
        grep: move thread initialization a little lower
      036465a2
    • J
      Merge branch 'dt/gc-ignore-old-gc-logs' · c96bc189
      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
      c96bc189
    • J
      Merge branch 'jh/preload-index-skip-skip' · c7e234fc
      Junio C Hamano 提交于
      The preload-index code has been taught not to bother with the index
      entries that are paths that are not checked out by "sparse checkout".
      
      * jh/preload-index-skip-skip:
        preload-index: avoid lstat for skip-worktree items
      c7e234fc
    • J
      Merge branch 'mh/submodule-hash' · 466be3e1
      Junio C Hamano 提交于
      Code and design clean-up for the refs API.
      
      * mh/submodule-hash:
        read_loose_refs(): read refs using resolve_ref_recursively()
        files_ref_store::submodule: use NULL for the main repository
        base_ref_store_init(): remove submodule argument
        refs: push the submodule attribute down
        refs: store submodule ref stores in a hashmap
        register_ref_store(): new function
        refs: remove some unnecessary handling of submodule == ""
        refs: make some ref_store lookup functions private
        refs: reorder some function definitions
      466be3e1
    • J
      Merge branch 'sf/putty-w-args' · be6ab596
      Junio C Hamano 提交于
      The command line options for ssh invocation needs to be tweaked for
      some implementations of SSH (e.g. PuTTY plink wants "-P <port>"
      while OpenSSH wants "-p <port>" to specify port to connect to), and
      the variant was guessed when GIT_SSH environment variable is used
      to specify it.  The logic to guess now applies to the command
      specified by the newer GIT_SSH_COMMAND and also core.sshcommand
      configuration variable, and comes with an escape hatch for users to
      deal with misdetected cases.
      
      * sf/putty-w-args:
        connect.c: stop conflating ssh command names and overrides
        connect: Add the envvar GIT_SSH_VARIANT and ssh.variant config
        git_connect(): factor out SSH variant handling
        connect: rename tortoiseplink and putty variables
        connect: handle putty/plink also in GIT_SSH_COMMAND
      be6ab596
    • J
      Merge branch 'js/rebase-helper' · 098ed50e
      Junio C Hamano 提交于
      "git rebase -i" starts using the recently updated "sequencer" code.
      
      * js/rebase-helper:
        rebase -i: use the rebase--helper builtin
        rebase--helper: add a builtin helper for interactive rebases
      098ed50e
    • J
      Merge branch 'bw/attr' · a04855ba
      Junio C Hamano 提交于
      The gitattributes machinery is being taught to work better in a
      multi-threaded environment.
      
      * bw/attr: (27 commits)
        attr: reformat git_attr_set_direction() function
        attr: push the bare repo check into read_attr()
        attr: store attribute stack in attr_check structure
        attr: tighten const correctness with git_attr and match_attr
        attr: remove maybe-real, maybe-macro from git_attr
        attr: eliminate global check_all_attr array
        attr: use hashmap for attribute dictionary
        attr: change validity check for attribute names to use positive logic
        attr: pass struct attr_check to collect_some_attrs
        attr: retire git_check_attrs() API
        attr: convert git_check_attrs() callers to use the new API
        attr: convert git_all_attrs() to use "struct attr_check"
        attr: (re)introduce git_check_attr() and struct attr_check
        attr: rename function and struct related to checking attributes
        attr.c: outline the future plans by heavily commenting
        Documentation: fix a typo
        attr.c: add push_stack() helper
        attr: support quoting pathname patterns in C style
        attr.c: plug small leak in parse_attr_line()
        attr.c: tighten constness around "git_attr" structure
        ...
      a04855ba
    • J
      Merge branch 'sg/completion' · fdeb89fd
      Junio C Hamano 提交于
      Clean-up and updates to command line completion (in contrib/).
      
      * sg/completion: (22 commits)
        completion: restore removed line continuating backslash
        completion: cache the path to the repository
        completion: extract repository discovery from __gitdir()
        completion: don't guard git executions with __gitdir()
        completion: consolidate silencing errors from git commands
        completion: don't use __gitdir() for git commands
        completion: respect 'git -C <path>'
        rev-parse: add '--absolute-git-dir' option
        completion: fix completion after 'git -C <path>'
        completion: don't offer commands when 'git --opt' needs an argument
        completion: list short refs from a remote given as a URL
        completion: don't list 'HEAD' when trying refs completion outside of a repo
        completion: list refs from remote when remote's name matches a directory
        completion: respect 'git --git-dir=<path>' when listing remote refs
        completion: fix most spots not respecting 'git --git-dir=<path>'
        completion: ensure that the repository path given on the command line exists
        completion tests: add tests for the __git_refs() helper function
        completion tests: check __gitdir()'s output in the error cases
        completion tests: consolidate getting path of current working directory
        completion tests: make the $cur variable local to the test helper functions
        ...
      fdeb89fd
    • J
      Merge branch 'lt/pathspec-negative' · 015fba38
      Junio C Hamano 提交于
      The "negative" pathspec feature was somewhat more cumbersome to use
      than necessary in that its short-hand used "!" which needed to be
      escaped from shells, and it required "exclude from what?" specified.
      
      * lt/pathspec-negative:
        pathspec: don't error out on all-exclusionary pathspec patterns
        pathspec magic: add '^' as alias for '!'
      015fba38
    • J
      Merge branch 'cw/tag-reflog-message' · fb75e317
      Junio C Hamano 提交于
      "git tag" did not leave useful message when adding a new entry to
      reflog; this was left unnoticed for a long time because refs/tags/*
      doesn't keep reflog by default.
      
      * cw/tag-reflog-message:
        tag: generate useful reflog message
      fb75e317
    • J
      Merge branch 'jk/alternate-ref-optim' · b9c2919f
      Junio C Hamano 提交于
      Optimizes resource usage while enumerating refs from alternate
      object store, to help receiving end of "push" that hosts a
      repository with many "forks".
      
      * jk/alternate-ref-optim:
        receive-pack: avoid duplicates between our refs and alternates
        receive-pack: treat namespace .have lines like alternates
        receive-pack: fix misleading namespace/.have comment
        receive-pack: use oidset to de-duplicate .have lines
        add oidset API
        fetch-pack: cache results of for_each_alternate_ref
        for_each_alternate_ref: replace transport code with for-each-ref
        for_each_alternate_ref: pass name/oid instead of ref struct
        for_each_alternate_ref: use strbuf for path allocation
        for_each_alternate_ref: stop trimming trailing slashes
        for_each_alternate_ref: handle failure from real_pathdup()
      b9c2919f
    • J
      Merge branch 'kn/ref-filter-branch-list' · 93e8cd8b
      Junio C Hamano 提交于
      The code to list branches in "git branch" has been consolidated
      with the more generic ref-filter API.
      
      * kn/ref-filter-branch-list: (21 commits)
        ref-filter: resurrect "strip" as a synonym to "lstrip"
        branch: implement '--format' option
        branch: use ref-filter printing APIs
        branch, tag: use porcelain output
        ref-filter: allow porcelain to translate messages in the output
        ref-filter: add an 'rstrip=<N>' option to atoms which deal with refnames
        ref-filter: modify the 'lstrip=<N>' option to work with negative '<N>'
        ref-filter: Do not abruptly die when using the 'lstrip=<N>' option
        ref-filter: rename the 'strip' option to 'lstrip'
        ref-filter: make remote_ref_atom_parser() use refname_atom_parser_internal()
        ref-filter: introduce refname_atom_parser()
        ref-filter: introduce refname_atom_parser_internal()
        ref-filter: make "%(symref)" atom work with the ':short' modifier
        ref-filter: add support for %(upstream:track,nobracket)
        ref-filter: make %(upstream:track) prints "[gone]" for invalid upstreams
        ref-filter: introduce format_ref_array_item()
        ref-filter: move get_head_description() from branch.c
        ref-filter: modify "%(objectname:short)" to take length
        ref-filter: implement %(if:equals=<string>) and %(if:notequals=<string>)
        ref-filter: include reference to 'used_atom' within 'atom_value'
        ...
      93e8cd8b
    • J
      Merge branch 'ps/urlmatch-wildcard' · a4117269
      Junio C Hamano 提交于
      The <url> part in "http.<url>.<variable>" configuration variable
      can now be spelled with '*' that serves as wildcard.
      E.g. "http.https://*.example.com.proxy" can be used to specify the
      proxy used for https://a.example.com, https://b.example.com, etc.,
      i.e. any host in the example.com domain.
      
      * ps/urlmatch-wildcard:
        urlmatch: allow globbing for the URL host part
        urlmatch: include host in urlmatch ranking
        urlmatch: split host and port fields in `struct url_info`
        urlmatch: enable normalization of URLs with globs
        mailmap: add Patrick Steinhardt's work address
      a4117269