Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Commits on Oct 6, 2011
  1. attr: read core.attributesfile from git_default_core_config

    authored
    This code calls git_config from a helper function to parse the config entry
    it is interested in.  Calling git_config in this way may cause a problem if
    the helper function can be called after a previous call to git_config by
    another function since the second call to git_config may reset some
    variable to the value in the config file which was previously overridden.
    
    The above is not a problem in this case since the function passed to
    git_config only parses one config entry and the variable it sets is not
    assigned outside of the parsing function.  But a programmer who desires
    all of the standard config options to be parsed may be tempted to modify
    git_attr_config() so that it falls back to git_default_config() and then it
    _would_ be vulnerable to the above described behavior.
    
    So, move the call to git_config up into the top-level cmd_* function and
    move the responsibility for parsing core.attributesfile into the main
    config file parser.
    
    Which is only the logical thing to do ;-)
    
    Signed-off-by: Brandon Casey <drafnel@gmail.com>
    Signed-off-by: Junio C Hamano <gitster@pobox.com>
Commits on Aug 29, 2011
  1. Merge branch 'nd/maint-clone-gitdir'

    authored
    * nd/maint-clone-gitdir:
      clone: allow to clone from .git file
      read_gitfile_gently(): rename misnamed function to read_gitfile()
Commits on Aug 23, 2011
  1. Merge branch 'cb/maint-ls-files-error-report'

    authored
    * cb/maint-ls-files-error-report:
      ls-files: fix pathspec display on error
Commits on Aug 22, 2011
  1. read_gitfile_gently(): rename misnamed function to read_gitfile()

    authored
    The function was not gentle at all to the callers and died without giving
    them a chance to deal with possible errors. Rename it to read_gitfile(),
    and update all the callers.
    
    As no existing caller needs a true "gently" variant, we do not bother
    adding one at this point.
    
    Signed-off-by: Junio C Hamano <gitster@pobox.com>
Commits on Aug 18, 2011
  1. Merge branch 'js/ref-namespaces'

    authored
    * js/ref-namespaces:
      ref namespaces: tests
      ref namespaces: documentation
      ref namespaces: Support remote repositories via upload-pack and receive-pack
      ref namespaces: infrastructure
      Fix prefix handling in ref iteration functions
Commits on Aug 11, 2011
  1. @drizzd

    ls-files: fix pathspec display on error

    drizzd authored committed
    The following sequence of commands reveals an issue with error
    reporting of relative paths:
    
     $ mkdir sub
     $ cd sub
     $ git ls-files --error-unmatch ../bbbbb
     error: pathspec 'b' did not match any file(s) known to git.
     $ git commit --error-unmatch ../bbbbb
     error: pathspec 'b' did not match any file(s) known to git.
    
    This bug is visible only if the normalized path (i.e., the relative
    path from the repository root) is longer than the prefix.
    Otherwise, the code skips over the normalized path and reads from
    an unused memory location which still contains a leftover of the
    original command line argument.
    
    So instead, use the existing facilities to deal with relative paths
    correctly.
    
    Also fix inconsistency between "checkout" and "commit", e.g.
    
        $ cd Documentation
        $ git checkout nosuch.txt
        error: pathspec 'Documentation/nosuch.txt' did not match...
        $ git commit nosuch.txt
        error: pathspec 'nosuch.txt' did not match...
    
    by propagating the prefix down the codepath that reports the error.
    
    Signed-off-by: Clemens Buchacher <drizzd@aon.at>
    Signed-off-by: Junio C Hamano <gitster@pobox.com>
  2. Merge branch 'cb/partial-commit-relative-pathspec'

    authored
    * cb/partial-commit-relative-pathspec:
      commit: allow partial commits with relative paths
Commits on Aug 5, 2011
  1. Merge branch 'jc/pack-order-tweak'

    authored
    * jc/pack-order-tweak:
      pack-objects: optimize "recency order"
      core: log offset pack data accesses happened
Commits on Aug 2, 2011
  1. @drizzd

    commit: allow partial commits with relative paths

    drizzd authored committed
    In order to do partial commits, git-commit overlays a tree on the
    cache and checks pathspecs against the result. Currently, the
    overlaying is done using "prefix" which prevents relative pathspecs
    with ".." and absolute pathspec from matching when they refer to
    files not under "prefix" and absent from the index, but still in
    the tree (i.e.  files staged for removal).
    
    The point of providing a prefix at all is performance optimization.
    If we say there is no common prefix for the files of interest, then
    we have to read the entire tree into the index.
    
    But even if we cannot use the working directory as a prefix, we can
    still figure out if there is a common prefix for all given paths,
    and use that instead. The pathspec_prefix() routine from ls-files.c
    does exactly that.
    
    Any use of global variables is removed from pathspec_prefix() so
    that it can be called from commit.c.
    
    Reported-by: Reuben Thomas <rrt@sc3d.org>
    Analyzed-by: Michael J Gruber <git@drmicha.warpmail.net>
    Signed-off-by: Clemens Buchacher <drizzd@aon.at>
    Signed-off-by: Junio C Hamano <gitster@pobox.com>
Commits on Jul 19, 2011
  1. Merge branch 'jc/index-pack'

    authored
    * jc/index-pack:
      verify-pack: use index-pack --verify
      index-pack: show histogram when emulating "verify-pack -v"
      index-pack: start learning to emulate "verify-pack -v"
      index-pack: a miniscule refactor
      index-pack --verify: read anomalous offsets from v2 idx file
      write_idx_file: need_large_offset() helper function
      index-pack: --verify
      write_idx_file: introduce a struct to hold idx customization options
      index-pack: group the delta-base array entries also by type
    
    Conflicts:
    	builtin/verify-pack.c
    	cache.h
    	sha1_file.c
  2. Merge branch 'jk/clone-cmdline-config'

    authored
    * jk/clone-cmdline-config:
      clone: accept config options on the command line
      config: make git_config_parse_parameter a public function
      remote: use new OPT_STRING_LIST
      parse-options: add OPT_STRING_LIST helper
  3. Merge branch 'jc/zlib-wrap'

    authored
    * jc/zlib-wrap:
      zlib: allow feeding more than 4GB in one go
      zlib: zlib can only process 4GB at a time
      zlib: wrap deflateBound() too
      zlib: wrap deflate side of the API
      zlib: wrap inflateInit2 used to accept only for gzip format
      zlib: wrap remaining calls to direct inflate/inflateEnd
      zlib wrapper: refactor error message formatter
    
    Conflicts:
    	sha1_file.c
Commits on Jul 7, 2011
  1. core: log offset pack data accesses happened

    authored
    In a workload other than "git log" (without pathspec nor any option that
    causes us to inspect trees and blobs), the recency pack order is said to
    cause the access jump around quite a bit. Add a hook to allow us observe
    how bad it is.
    
    "git config core.logpackaccess /var/tmp/pal.txt" will give you the log
    in the specified file.
    
    Signed-off-by: Junio C Hamano <gitster@pobox.com>
Commits on Jul 6, 2011
  1. @joshtriplett

    ref namespaces: infrastructure

    joshtriplett authored committed
    Add support for dividing the refs of a single repository into multiple
    namespaces, each of which can have its own branches, tags, and HEAD.
    Git can expose each namespace as an independent repository to pull from
    and push to, while sharing the object store, and exposing all the refs
    to operations such as git-gc.
    
    Storing multiple repositories as namespaces of a single repository
    avoids storing duplicate copies of the same objects, such as when
    storing multiple branches of the same source.  The alternates mechanism
    provides similar support for avoiding duplicates, but alternates do not
    prevent duplication between new objects added to the repositories
    without ongoing maintenance, while namespaces do.
    
    To specify a namespace, set the GIT_NAMESPACE environment variable to
    the namespace.  For each ref namespace, git stores the corresponding
    refs in a directory under refs/namespaces/.  For example,
    GIT_NAMESPACE=foo will store refs under refs/namespaces/foo/.  You can
    also specify namespaces via the --namespace option to git.
    
    Note that namespaces which include a / will expand to a hierarchy of
    namespaces; for example, GIT_NAMESPACE=foo/bar will store refs under
    refs/namespaces/foo/refs/namespaces/bar/.  This makes paths in
    GIT_NAMESPACE behave hierarchically, so that cloning with
    GIT_NAMESPACE=foo/bar produces the same result as cloning with
    GIT_NAMESPACE=foo and cloning from that repo with GIT_NAMESPACE=bar.  It
    also avoids ambiguity with strange namespace paths such as
    foo/refs/heads/, which could otherwise generate directory/file conflicts
    within the refs directory.
    
    Add the infrastructure for ref namespaces: handle the GIT_NAMESPACE
    environment variable and --namespace option, and support iterating over
    refs in a namespace.
    
    Signed-off-by: Josh Triplett <josh@joshtriplett.org>
    Signed-off-by: Jamey Sharp <jamey@minilop.net>
    Signed-off-by: Junio C Hamano <gitster@pobox.com>
Commits on Jun 30, 2011
  1. Merge branch 'jc/streaming-filter' into next

    authored
    * jc/streaming-filter:
      t0021: test application of both crlf and ident
      t0021-conversion.sh: fix NoTerminatingSymbolAtEOF test
      streaming: filter cascading
      streaming filter: ident filter
      Add LF-to-CRLF streaming conversion
      stream filter: add "no more input" to the filters
      Add streaming filter API
      convert.h: move declarations for conversion from cache.h
  2. Merge branch 'jc/streaming' into next

    authored
    * jc/streaming:
      sha1_file: use the correct type (ssize_t, not size_t) for read-style function
      streaming: read loose objects incrementally
      sha1_file.c: expose helpers to read loose objects
      streaming: read non-delta incrementally from a pack
      streaming_write_entry(): support files with holes
      convert: CRLF_INPUT is a no-op in the output codepath
      streaming_write_entry(): use streaming API in write_entry()
      streaming: a new API to read from the object store
      write_entry(): separate two helper functions out
      unpack_object_header(): make it public
      sha1_object_info_extended(): hint about objects in delta-base cache
      sha1_object_info_extended(): expose a bit more info
      packed_object_info_detail(): do not return a string
  3. Merge branch 'ef/maint-win-verify-path'

    authored
    * ef/maint-win-verify-path:
      verify_dotfile(): do not assume '/' is the path seperator
      verify_path(): simplify check at the directory boundary
      verify_path: consider dos drive prefix
      real_path: do not assume '/' is the path seperator
      A Windows path starting with a backslash is absolute
Commits on Jun 22, 2011
  1. @peff

    config: make git_config_parse_parameter a public function

    peff authored committed
    We use this internally to parse "git -c core.foo=bar", but
    the general format of "key=value" is useful for other
    places.
    
    Signed-off-by: Jeff King <peff@peff.net>
    Signed-off-by: Junio C Hamano <gitster@pobox.com>
Commits on Jun 10, 2011
  1. zlib: zlib can only process 4GB at a time

    authored
    The size of objects we read from the repository and data we try to put
    into the repository are represented in "unsigned long", so that on larger
    architectures we can handle objects that weigh more than 4GB.
    
    But the interface defined in zlib.h to communicate with inflate/deflate
    limits avail_in (how many bytes of input are we calling zlib with) and
    avail_out (how many bytes of output from zlib are we ready to accept)
    fields effectively to 4GB by defining their type to be uInt.
    
    In many places in our code, we allocate a large buffer (e.g. mmap'ing a
    large loose object file) and tell zlib its size by assigning the size to
    avail_in field of the stream, but that will truncate the high octets of
    the real size. The worst part of this story is that we often pass around
    z_stream (the state object used by zlib) to keep track of the number of
    used bytes in input/output buffer by inspecting these two fields, which
    practically limits our callchain to the same 4GB limit.
    
    Wrap z_stream in another structure git_zstream that can express avail_in
    and avail_out in unsigned long. For now, just die() when the caller gives
    a size that cannot be given to a single zlib call. In later patches in the
    series, we would make git_inflate() and git_deflate() internally loop to
    give callers an illusion that our "improved" version of zlib interface can
    operate on a buffer larger than 4GB in one go.
    
    Signed-off-by: Junio C Hamano <gitster@pobox.com>
  2. zlib: wrap deflateBound() too

    authored
    Signed-off-by: Junio C Hamano <gitster@pobox.com>
  3. zlib: wrap deflate side of the API

    authored
    Wrap deflateInit, deflate, and deflateEnd for everybody, and the sole use
    of deflateInit2 in remote-curl.c to tell the library to use gzip header
    and trailer in git_deflate_init_gzip().
    
    There is only one caller that cares about the status from deflateEnd().
    Introduce git_deflate_end_gently() to let that sole caller retrieve the
    status and act on it (i.e. die) for now, but we would probably want to
    make inflate_end/deflate_end die when they ran out of memory and get
    rid of the _gently() kind.
    
    Signed-off-by: Junio C Hamano <gitster@pobox.com>
  4. zlib: wrap inflateInit2 used to accept only for gzip format

    authored
    http-backend.c uses inflateInit2() to tell the library that it wants to
    accept only gzip format. Wrap it in a helper function so that readers do
    not have to wonder what the magic numbers 15 and 16 are for.
    
    Signed-off-by: Junio C Hamano <gitster@pobox.com>
Commits on Jun 6, 2011
  1. verify-pack: use index-pack --verify

    authored
    This finally gets rid of the inefficient verify-pack implementation that
    walks objects in the packfile in their object name order and replaces it
    with a call to index-pack --verify. As a side effect, it also removes
    packed_object_info_detail() API which is rather expensive.
    
    As this changes the way errors are reported (verify-pack used to rely on
    the usual runtime error detection routine unpack_entry() to diagnose the
    CRC errors in an entry in the *.idx file; index-pack --verify checks the
    whole *.idx file in one go), update a test that expected the string "CRC"
    to appear in the error message.
    
    Signed-off-by: Junio C Hamano <gitster@pobox.com>
Commits on Jun 1, 2011
  1. Merge branch 'jk/maint-config-alias-fix' into maint

    authored
    * jk/maint-config-alias-fix:
      handle_options(): do not miscount how many arguments were used
      config: always parse GIT_CONFIG_PARAMETERS during git_config
      git_config: don't peek at global config_parameters
      config: make environment parsing routines static
Commits on May 31, 2011
  1. Merge branch 'jk/maint-config-alias-fix'

    authored
    * jk/maint-config-alias-fix:
      handle_options(): do not miscount how many arguments were used
      config: always parse GIT_CONFIG_PARAMETERS during git_config
      git_config: don't peek at global config_parameters
      config: make environment parsing routines static
    
    Conflicts:
    	config.c
Commits on May 27, 2011
  1. @TaleTN

    A Windows path starting with a backslash is absolute

    TaleTN authored committed
    This fixes prefix_path() not recognizing e.g. \foo\bar as an absolute path
    on Windows.
    
    Signed-off-by: Theo Niessink <theo@taletn.com>
    Signed-off-by: Erik Faye-Lund <kusmabite@gmail.com>
    Signed-off-by: Junio C Hamano <gitster@pobox.com>
Commits on May 26, 2011
  1. convert.h: move declarations for conversion from cache.h

    authored
    Before adding the streaming filter API to the conversion layer,
    move the existing declarations related to the conversion to its
    own header file.
    
    Signed-off-by: Junio C Hamano <gitster@pobox.com>
  2. Merge branch 'jk/git-connection-deadlock-fix' into maint-1.7.4

    authored
    * jk/git-connection-deadlock-fix:
      test core.gitproxy configuration
      send-pack: avoid deadlock on git:// push with failed pack-objects
      connect: let callers know if connection is a socket
      connect: treat generic proxy processes like ssh processes
    
    Conflicts:
    	connect.c
  3. Merge branch 'jk/git-connection-deadlock-fix' into maint

    authored
    * jk/git-connection-deadlock-fix:
      test core.gitproxy configuration
      send-pack: avoid deadlock on git:// push with failed pack-objects
      connect: let callers know if connection is a socket
      connect: treat generic proxy processes like ssh processes
    
    Conflicts:
    	connect.c
Commits on May 25, 2011
  1. Merge branch 'jc/bigfile'

    authored
    * jc/bigfile:
      Bigfile: teach "git add" to send a large file straight to a pack
      index_fd(): split into two helper functions
      index_fd(): turn write_object and format_check arguments into one flag
Commits on May 24, 2011
  1. @peff

    config: make environment parsing routines static

    peff authored committed
    Nobody outside of git_config_from_parameters should need
    to use the GIT_CONFIG_PARAMETERS parsing functions, so let's
    make them private.
    
    Signed-off-by: Jeff King <peff@peff.net>
    Signed-off-by: Junio C Hamano <gitster@pobox.com>
Commits on May 23, 2011
  1. Merge branch 'mg/config-symbolic-constants'

    authored
    * mg/config-symbolic-constants:
      config: Give error message when not changing a multivar
      config: define and document exit codes
  2. Merge branch 'jc/magic-pathspec'

    authored
    * jc/magic-pathspec:
      setup.c: Fix some "symbol not declared" sparse warnings
      t3703: Skip tests using directory name ":" on Windows
      revision.c: leave a note for "a lone :" enhancement
      t3703, t4208: add test cases for magic pathspec
      rev/path disambiguation: further restrict "misspelled index entry" diag
      fix overslow :/no-such-string-ever-existed diagnostics
      fix overstrict :<path> diagnosis
      grep: use get_pathspec() correctly
      pathspec: drop "lone : means no pathspec" from get_pathspec()
      Revert "magic pathspec: add ":(icase)path" to match case insensitively"
      magic pathspec: add ":(icase)path" to match case insensitively
      magic pathspec: futureproof shorthand form
      magic pathspec: add tentative ":/path/from/top/level" pathspec support
Commits on May 21, 2011
  1. sha1_file.c: expose helpers to read loose objects

    authored
    Make map_sha1_file(), parse_sha1_header() and unpack_sha1_header()
    available to the streaming read API by exporting them via cache.h header
    file.
    
    Signed-off-by: Junio C Hamano <gitster@pobox.com>
  2. streaming_write_entry(): use streaming API in write_entry()

    authored
    When the output to a path does not have to be converted, we can read from
    the object database from the streaming API and write to the file in the
    working tree, without having to hold everything in the memory.
    
    The ident, auto- and safe- crlf conversions inherently require you to read
    the whole thing before deciding what to do, so while it is technically
    possible to support them by using a buffer of an unbound size or rewinding
    and reading the stream twice, it is less practical than the traditional
    "read the whole thing in core and convert" approach.
    
    Adding streaming filters for the other conversions on top of this should
    be doable by tweaking the can_bypass_conversion() function (it should be
    renamed to can_filter_stream() when it happens). Then the streaming API
    can be extended to wrap the git_istream streaming_write_entry() opens on
    the underlying object in another git_istream that reads from it, filters
    what is read, and let the streaming_write_entry() read the filtered
    result. But that is outside the scope of this series.
    
    Signed-off-by: Junio C Hamano <gitster@pobox.com>
Something went wrong with that request. Please try again.