1. 21 8月, 2015 4 次提交
    • J
      get_urlmatch: avoid useless strbuf write · a92330d2
      Jeff King 提交于
      We create a strbuf only to insert a single string, pass the
      resulting buffer to a function (which does not modify the
      string), and then free it. We can just pass the original
      string instead.
      Signed-off-by: NJeff King <peff@peff.net>
      Signed-off-by: NJunio C Hamano <gitster@pobox.com>
      a92330d2
    • J
      format_config: simplify buffer handling · f2259877
      Jeff King 提交于
      When formatting a config value into a strbuf, we may end
      up stringifying it into a fixed-size buffer using sprintf,
      and then copying that buffer into the strbuf. We can
      eliminate the middle-man (and drop some calls to sprintf!)
      by writing directly to the strbuf.
      
      The reason it was written this way in the first place is
      that we need to know before writing the value whether to
      insert a delimiter. Instead of delaying the write of the
      value, we speculatively write the delimiter, and roll it
      back in the single case that cares.
      Signed-off-by: NJeff King <peff@peff.net>
      Signed-off-by: NJunio C Hamano <gitster@pobox.com>
      f2259877
    • J
      format_config: don't init strbuf · 9f1429df
      Jeff King 提交于
      It's unusual for a function which writes to a passed-in
      strbuf to call strbuf_init; that will throw away anything
      already there, leaking memory. In this case, there are
      exactly two callers; one relies on this initialization and
      the other passes in an already-initialized buffer.
      
      There's no leak, as the initialized buffer doesn't have
      anything in it. But let's bump the strbuf_init out to the
      one caller who needs it, making format_config more
      idiomatic.
      Signed-off-by: NJeff King <peff@peff.net>
      Signed-off-by: NJunio C Hamano <gitster@pobox.com>
      9f1429df
    • S
      config: restructure format_config() for better control flow · ebca2d49
      SZEDER Gábor 提交于
      Commit 578625fa (config: add '--name-only' option to list only
      variable names, 2015-08-10) modified format_config() such that it
      returned from the middle of the function when showing only keys,
      resulting in ugly code structure.
      
      Reorganize the if statements and dealing with the key-value delimiter to
      make the function easier to read.
      Signed-off-by: NSZEDER Gábor <szeder@ira.uka.de>
      Signed-off-by: NJunio C Hamano <gitster@pobox.com>
      ebca2d49
  2. 11 8月, 2015 2 次提交
    • S
      completion: list variable names reliably with 'git config --name-only' · 905f2036
      SZEDER Gábor 提交于
      Recenty I created a multi-line branch description with '.' and '='
      characters on one of the lines, and noticed that fragments of that line
      show up when completing set variable names for 'git config', e.g.:
      
        $ git config --get branch.b.description
        Branch description to fool the completion script with a
        second line containing dot . and equals = characters.
        $ git config --unset <TAB>
        ...
        second line containing dot . and equals
        ...
      
      The completion script runs 'git config --list' and processes its output
      to strip the values and keep only the variable names.  It does so by
      looking for lines containing '.' and '=' and outputting everything
      before the '=', which was fooled by my multi-line branch description.
      
      A similar issue exists with aliases and pretty format aliases with
      multi-line values, but in that case 'git config --get-regexp' is run and
      lines in its output are simply stripped after the first space, so
      subsequent lines don't even have to contain '.' and '=' to fool the
      completion script.
      
      Use the new '--name-only' option added in the previous commit to list
      config variable names reliably in both cases, without error-prone post
      processing.
      Signed-off-by: NSZEDER Gábor <szeder@ira.uka.de>
      Signed-off-by: NJunio C Hamano <gitster@pobox.com>
      905f2036
    • S
      config: add '--name-only' option to list only variable names · 578625fa
      SZEDER Gábor 提交于
      'git config' can only show values or name-value pairs, so if a shell
      script needs the names of set config variables it has to run 'git config
      --list' or '--get-regexp' and parse the output to separate config
      variable names from their values.  However, such a parsing can't cope
      with multi-line values.  Though 'git config' can produce null-terminated
      output for newline-safe parsing, that's of no use in such a case, becase
      shells can't cope with null characters.
      
      Even our own bash completion script suffers from these issues.
      
      Help the completion script, and shell scripts in general, by introducing
      the '--name-only' option to modify the output of '--list' and
      '--get-regexp' to list only the names of config variables, so they don't
      have to perform error-prone post processing to separate variable names
      from their values anymore.
      Signed-off-by: NSZEDER Gábor <szeder@ira.uka.de>
      Signed-off-by: NJunio C Hamano <gitster@pobox.com>
      578625fa
  3. 28 5月, 2015 2 次提交
  4. 27 5月, 2015 16 次提交
    • J
      Sync with 2.4.2 · fae46aa0
      Junio C Hamano 提交于
      fae46aa0
    • J
      Git 2.4.2 · 9eabf5b5
      Junio C Hamano 提交于
      Signed-off-by: NJunio C Hamano <gitster@pobox.com>
      9eabf5b5
    • J
      Merge branch 'jk/still-interesting' into maint · df08eb35
      Junio C Hamano 提交于
      "git rev-list --objects $old --not --all" to see if everything that
      is reachable from $old is already connected to the existing refs
      was very inefficient.
      
      * jk/still-interesting:
        limit_list: avoid quadratic behavior from still_interesting
      df08eb35
    • J
      Merge branch 'jc/hash-object' into maint · 1e6c8bab
      Junio C Hamano 提交于
      "hash-object --literally" introduced in v2.2 was not prepared to
      take a really long object type name.
      
      * jc/hash-object:
        write_sha1_file(): do not use a separate sha1[] array
        t1007: add hash-object --literally tests
        hash-object --literally: fix buffer overrun with extra-long object type
        git-hash-object.txt: document --literally option
      1e6c8bab
    • J
      Merge branch 'jk/rebase-quiet-noop' into maint · 5d534338
      Junio C Hamano 提交于
      "git rebase --quiet" was not quite quiet when there is nothing to
      do.
      
      * jk/rebase-quiet-noop:
        rebase: silence "git checkout" for noop rebase
      5d534338
    • J
      Merge branch 'sg/complete-decorate-full-not-long' into maint · 23903b9e
      Junio C Hamano 提交于
      The completion for "log --decorate=" parameter value was incorrect.
      
      * sg/complete-decorate-full-not-long:
        completion: fix and update 'git log --decorate=' options
      23903b9e
    • J
      Merge branch 'jk/filter-branch-use-of-sed-on-incomplete-line' into maint · a2e5c79c
      Junio C Hamano 提交于
      "filter-branch" corrupted commit log message that ends with an
      incomplete line on platforms with some "sed" implementations that
      munge such a line.  Work it around by avoiding to use "sed".
      
      * jk/filter-branch-use-of-sed-on-incomplete-line:
        filter-branch: avoid passing commit message through sed
      a2e5c79c
    • J
      Merge branch 'jc/daemon-no-ipv6-for-2.4.1' into maint · 6fd58363
      Junio C Hamano 提交于
      "git daemon" fails to build from the source under NO_IPV6
      configuration (regression in 2.4).
      
      * jc/daemon-no-ipv6-for-2.4.1:
        daemon: unbreak NO_IPV6 build regression
      6fd58363
    • J
      Merge branch 'jk/stash-require-clean-index' into maint · cb9ec8e2
      Junio C Hamano 提交于
      "git stash pop/apply" forgot to make sure that not just the working
      tree is clean but also the index is clean. The latter is important
      as a stash application can conflict and the index will be used for
      conflict resolution.
      
      * jk/stash-require-clean-index:
        stash: require a clean index to apply
        t3903: avoid applying onto dirty index
        t3903: stop hard-coding commit sha1s
      cb9ec8e2
    • J
      Merge branch 'jk/git-no-more-argv0-path-munging' into maint · af6d7a62
      Junio C Hamano 提交于
      We have prepended $GIT_EXEC_PATH and the path "git" is installed in
      (typically "/usr/bin") to $PATH when invoking subprograms and hooks
      for almost eternity, but the original use case the latter tried to
      support was semi-bogus (i.e. install git to /opt/foo/git and run it
      without having /opt/foo on $PATH), and more importantly it has
      become less and less relevant as Git grew more mainstream (i.e. the
      users would _want_ to have it on their $PATH).  Stop prepending the
      path in which "git" is installed to users' $PATH, as that would
      interfere the command search order people depend on (e.g. they may
      not like versions of programs that are unrelated to Git in /usr/bin
      and want to override them by having different ones in /usr/local/bin
      and have the latter directory earlier in their $PATH).
      
      * jk/git-no-more-argv0-path-munging:
        stop putting argv[0] dirname at front of PATH
      af6d7a62
    • J
      Fifth batch for 2.5 cycle · 4ebdeb68
      Junio C Hamano 提交于
      Signed-off-by: NJunio C Hamano <gitster@pobox.com>
      4ebdeb68
    • J
      Merge branch 'nd/untracked-cache' · 38ccaf93
      Junio C Hamano 提交于
      Teach the index to optionally remember already seen untracked files
      to speed up "git status" in a working tree with tons of cruft.
      
      * nd/untracked-cache: (24 commits)
        git-status.txt: advertisement for untracked cache
        untracked cache: guard and disable on system changes
        mingw32: add uname()
        t7063: tests for untracked cache
        update-index: test the system before enabling untracked cache
        update-index: manually enable or disable untracked cache
        status: enable untracked cache
        untracked-cache: temporarily disable with $GIT_DISABLE_UNTRACKED_CACHE
        untracked cache: mark index dirty if untracked cache is updated
        untracked cache: print stats with $GIT_TRACE_UNTRACKED_STATS
        untracked cache: avoid racy timestamps
        read-cache.c: split racy stat test to a separate function
        untracked cache: invalidate at index addition or removal
        untracked cache: load from UNTR index extension
        untracked cache: save to an index extension
        ewah: add convenient wrapper ewah_serialize_strbuf()
        untracked cache: don't open non-existent .gitignore
        untracked cache: mark what dirs should be recursed/saved
        untracked cache: record/validate dir mtime and reuse cached output
        untracked cache: make a wrapper around {open,read,close}dir()
        ...
      38ccaf93
    • J
      Merge branch 'rs/plug-leak-in-pack-bitmaps' · a26d48a4
      Junio C Hamano 提交于
      The code to read pack-bitmap wanted to allocate a few hundred
      pointers to a structure, but by mistake allocated and leaked memory
      enough to hold that many actual structures.  Correct the allocation
      size and also have it on stack, as it is small enough.
      
      * rs/plug-leak-in-pack-bitmaps:
        pack-bitmaps: plug memory leak, fix allocation size for recent_bitmaps
      a26d48a4
    • J
      Merge branch 'pt/pull-ff-vs-merge-ff' · 22a1ae6e
      Junio C Hamano 提交于
      The pull.ff configuration was supposed to override the merge.ff
      configuration, but it didn't.
      
      * pt/pull-ff-vs-merge-ff:
        pull: parse pull.ff as a bool or string
        pull: make pull.ff=true override merge.ff
      22a1ae6e
    • J
      Merge branch 'pt/pull-log-n' · 14230580
      Junio C Hamano 提交于
      "git pull --log" and "git pull --no-log" worked as expected, but
      "git pull --log=20" did not.
      
      * pt/pull-log-n:
        pull: handle --log=<n>
      14230580
    • J
      Merge branch 'jk/rerere-forget-check-enabled' · c37d7b50
      Junio C Hamano 提交于
      "git rerere forget" in a repository without rerere enabled gave a
      cryptic error message; it should be a silent no-op instead.
      
      * jk/rerere-forget-check-enabled:
        rerere: exit silently on "forget" when rerere is disabled
      c37d7b50
  5. 23 5月, 2015 16 次提交
    • J
      Fourth batch for 2.5 cycle · 9532ead9
      Junio C Hamano 提交于
      Signed-off-by: NJunio C Hamano <gitster@pobox.com>
      9532ead9
    • J
      Merge branch 'ps/doc-packfile-vs-pack-file' · e4b4e7d7
      Junio C Hamano 提交于
      Doc consistency updates.
      
      * ps/doc-packfile-vs-pack-file:
        doc: fix inconsistent spelling of "packfile"
        pack-protocol.txt: fix insconsistent spelling of "packfile"
        git-unpack-objects.txt: fix inconsistent spelling of "packfile"
        git-verify-pack.txt: fix inconsistent spelling of "packfile"
      e4b4e7d7
    • J
      Merge branch 'sb/t1020-cleanup' · ce6ab232
      Junio C Hamano 提交于
      There was a commented-out (instead of being marked to expect
      failure) test that documented a breakage that was fixed since the
      test was written; turn it into a proper test.
      
      * sb/t1020-cleanup:
        subdirectory tests: code cleanup, uncomment test
      ce6ab232
    • J
      Merge branch 'lm/squelch-bg-progress' · 17e785f6
      Junio C Hamano 提交于
      The controlling tty-based heuristics to squelch progress output did
      not consider that the process may not be talking to a tty at all
      (e.g. sending the progress to sideband #2).  This is a finishing
      touch to a topic that is already in 'master'.
      
      * lm/squelch-bg-progress:
        progress: treat "no terminal" as being in the foreground
      17e785f6
    • J
      Merge branch 'jc/ignore-epipe-in-filter' · ddaf4e2e
      Junio C Hamano 提交于
      Filter scripts were run with SIGPIPE disabled on the Git side,
      expecting that they may not read what Git feeds them to filter.
      We however treated a filter that does not read its input fully
      before exiting as an error.
      
      This changes semantics, but arguably in a good way.  If a filter
      can produce its output without consuming its input using whatever
      magic, we now let it do so, instead of diagnosing it as a
      programming error.
      
      * jc/ignore-epipe-in-filter:
        filter_buffer_or_fd(): ignore EPIPE
        copy.c: make copy_fd() report its status silently
      ddaf4e2e
    • J
      Merge branch 'mh/clone-verbosity-fix' · 5bf66689
      Junio C Hamano 提交于
      Git 2.4 broke setting verbosity and progress levels on "git clone"
      with native transports.
      
      * mh/clone-verbosity-fix:
        clone: call transport_set_verbosity before anything else on the newly created transport
      5bf66689
    • J
      Merge branch 'pt/pull-tags-error-diag' · cc77b996
      Junio C Hamano 提交于
      There was a dead code that used to handle "git pull --tags" and
      show special-cased error message, which was made irrelevant when
      the semantics of the option changed back in Git 1.9 days.
      
      * pt/pull-tags-error-diag:
        pull: remove --tags error in no merge candidates case
      cc77b996
    • J
      Merge branch 'mh/lockfile-retry' · fb257bfa
      Junio C Hamano 提交于
      Instead of dying immediately upon failing to obtain a lock, retry
      after a short while with backoff.
      
      * mh/lockfile-retry:
        lock_packed_refs(): allow retries when acquiring the packed-refs lock
        lockfile: allow file locking to be retried with a timeout
      fb257bfa
    • J
      Merge branch 'jk/add-e-kill-editor' · 29b2041c
      Junio C Hamano 提交于
      "git add -e" did not allow the user to abort the operation by
      killing the editor.
      
      * jk/add-e-kill-editor:
        add: check return value of launch_editor
      29b2041c
    • J
      Merge branch 'sg/completion-config' · 935d9376
      Junio C Hamano 提交于
      Code clean-up for completion script (in contrib/).
      
      * sg/completion-config:
        completion: simplify query for config variables
        completion: add a helper function to get config variables
      935d9376
    • J
      Merge branch 'mh/ref-directory-file' · faa4b2ec
      Junio C Hamano 提交于
      The ref API did not handle cases where 'refs/heads/xyzzy/frotz' is
      removed at the same time as 'refs/heads/xyzzy' is added (or vice
      versa) very well.
      
      * mh/ref-directory-file:
        reflog_expire(): integrate lock_ref_sha1_basic() errors into ours
        ref_transaction_commit(): delete extra "the" from error message
        ref_transaction_commit(): provide better error messages
        rename_ref(): integrate lock_ref_sha1_basic() errors into ours
        lock_ref_sha1_basic(): improve diagnostics for ref D/F conflicts
        lock_ref_sha1_basic(): report errors via a "struct strbuf *err"
        verify_refname_available(): report errors via a "struct strbuf *err"
        verify_refname_available(): rename function
        refs: check for D/F conflicts among refs created in a transaction
        ref_transaction_commit(): use a string_list for detecting duplicates
        is_refname_available(): use dirname in first loop
        struct nonmatching_ref_data: store a refname instead of a ref_entry
        report_refname_conflict(): inline function
        entry_matches(): inline function
        is_refname_available(): convert local variable "dirname" to strbuf
        is_refname_available(): avoid shadowing "dir" variable
        is_refname_available(): revamp the comments
        t1404: new tests of ref D/F conflicts within transactions
      faa4b2ec
    • J
      Merge branch 'mh/write-refs-sooner-2.4' · 91c90876
      Junio C Hamano 提交于
      Multi-ref transaction support we merged a few releases ago
      unnecessarily kept many file descriptors open, risking to fail with
      resource exhaustion.  This is for 2.4.x track.
      
      * mh/write-refs-sooner-2.4:
        ref_transaction_commit(): fix atomicity and avoid fd exhaustion
        ref_transaction_commit(): remove the local flags variable
        ref_transaction_commit(): inline call to write_ref_sha1()
        rename_ref(): inline calls to write_ref_sha1() from this function
        commit_ref_update(): new function, extracted from write_ref_sha1()
        write_ref_to_lockfile(): new function, extracted from write_ref_sha1()
        t7004: rename ULIMIT test prerequisite to ULIMIT_STACK_SIZE
        update-ref: test handling large transactions properly
        ref_transaction_commit(): fix atomicity and avoid fd exhaustion
        ref_transaction_commit(): remove the local flags variable
        ref_transaction_commit(): inline call to write_ref_sha1()
        rename_ref(): inline calls to write_ref_sha1() from this function
        commit_ref_update(): new function, extracted from write_ref_sha1()
        write_ref_to_lockfile(): new function, extracted from write_ref_sha1()
        t7004: rename ULIMIT test prerequisite to ULIMIT_STACK_SIZE
        update-ref: test handling large transactions properly
      91c90876
    • J
      Merge branch 'mg/log-decorate-HEAD' · fd707807
      Junio C Hamano 提交于
      The "log --decorate" enhancement in Git 2.4 that shows the commit
      at the tip of the current branch e.g. "HEAD -> master", did not
      work with --decorate=full.
      
      * mg/log-decorate-HEAD:
        log: do not shorten decoration names too early
        log: decorate HEAD with branch name under --decorate=full, too
      fd707807
    • J
      Merge branch 'jk/asciidoc-markup-fix' · d1caa589
      Junio C Hamano 提交于
      Various documentation mark-up fixes to make the output more
      consistent in general and also make AsciiDoctor (an alternative
      formatter) happier.
      
      * jk/asciidoc-markup-fix:
        doc: convert AsciiDoc {?foo} to ifdef::foo[]
        doc: put example URLs and emails inside literal backticks
        doc: drop backslash quoting of some curly braces
        doc: convert \--option to --option
        doc/add: reformat `--edit` option
        doc: fix length of underlined section-title
        doc: fix hanging "+"-continuation
        doc: fix unquoted use of "{type}"
        doc: fix misrendering due to `single quote'
      d1caa589
    • J
      Merge branch 'jk/stripspace-asciidoctor-fix' · c24e0e77
      Junio C Hamano 提交于
      A literal block in the tutorial had lines with unequal lengths to
      delimit it from the rest of the document, which choke GitHub's
      AsciiDoc renderer.
      
      * jk/stripspace-asciidoctor-fix:
        doc: fix unmatched code fences in git-stripspace
      c24e0e77
    • J
      Merge branch 'ja/tutorial-asciidoctor-fix' · 236794f1
      Junio C Hamano 提交于
      A literal block in the tutorial had lines with unequal lengths to
      delimit it from the rest of the document, which choke GitHub's
      AsciiDoc renderer.
      
      * ja/tutorial-asciidoctor-fix:
        doc: fix unmatched code fences
      236794f1