Skip to content


Subversion checkout URL

You can clone with
Download ZIP
Commits on Apr 25, 2009
  1. @d0k @gitster

    connect: replace inet_ntop with getnameinfo

    d0k committed with gitster
    inet_ntop is not protocol independent.
    getnameinfo(3) is part of POSIX and is available when getaddrinfo(3) is.
    This code is only compiled when NO_IPV6 isn't defined.
    The old method was buggy anyway, not every ipv6 address was converted
    properly because the buffer (addr) was too small.
    Signed-off-by: Benjamin Kramer <>
    Signed-off-by: Junio C Hamano <>
Commits on Mar 14, 2009
  1. @d0k @gitster

    Remove unused assignments

    d0k committed with gitster
    These variables were always overwritten or the assigned
    value was unused:
      builtin-diff-tree.c::cmd_diff_tree(): nr_sha1
      builtin-for-each-ref.c::opt_parse_sort(): sort_tail
      builtin-mailinfo.c::decode_header_bq(): in
      builtin-shortlog.c::insert_one_record(): len
      connect.c::git_connect(): path
      imap-send.c::v_issue_imap_cmd(): n
      pretty.c::pp_user_info(): filler
      remote::parse_refspec_internal(): llen
    Signed-off-by: Benjamin Kramer <>
    Signed-off-by: Junio C Hamano <>
Commits on Mar 11, 2009
  1. @kusma @gitster

    connect.c: remove a few globals by using git_config callback data

    kusma committed with gitster
    Since ef90d6d (Provide git_config with a callback-data parameter,
    2008-05-14), git_config() takes a callback data pointer that can be
    used to pass extra parameters to the parsing function.  The codepath
    to parse configuration variables related to git proxy predates this
    facility and used a pair of file scope static variables instead.
    This patch removes the need for these global variables by passing the
    name of the host we are trying to access as the callback data.
    Signed-off-by: Erik Faye-Lund <>
    Signed-off-by: Junio C Hamano <>
Commits on Jan 5, 2009
  1. @aspotashev @gitster

    remove trailing LF in die() messages

    aspotashev committed with gitster
    LF at the end of format strings given to die() is redundant because
    die already adds one on its own.
    Signed-off-by: Alexander Potashev <>
    Signed-off-by: Junio C Hamano <>
Commits on Dec 21, 2008
  1. @gitster

    connect.c: stricter port validation, silence compiler warning

    René Scharfe committed with gitster
    In addition to checking if the provided port is numeric, also check
    that the string isn't empty and that the port number is within the
    valid range.  Incidentally, this silences a compiler warning about
    ignoring strtol's return value.
    Signed-off-by: Rene Scharfe <>
    Signed-off-by: Junio C Hamano <>
Commits on Nov 2, 2008
  1. @gitster

    connect.c: add a way for git-daemon to pass an error back to client

    Tom Preston-Werner committed with gitster
    The current behavior of git-daemon is to simply close the connection on
    any error condition. This leaves the client without any information as
    to the cause of the failed fetch/push/etc.
    This patch allows get_remote_heads to accept a line prefixed with "ERR"
    that it can display to the user in an informative fashion. Once clients
    can understand this ERR line, git-daemon can be made to properly report
    "repository not found", "permission denied", or other errors.
    S: ERR No matching repository.
    C: fatal: remote error: No matching repository.
    Signed-off-by: Tom Preston-Werner <>
    Signed-off-by: Junio C Hamano <>
Commits on Oct 18, 2008
  1. @gitster

    make alloc_ref_from_str() the new alloc_ref()

    René Scharfe committed with gitster
    With all calls to alloc_ref() gone, we can remove it and then we're free
    to give alloc_ref_from_str() the shorter name.  It's a much nicer
    interface, as the callers always need to have a name string when they
    allocate a ref anyway and don't need to calculate and pass its length+1
    any more.
    Signed-off-by: Rene Scharfe <>
    Signed-off-by: Junio C Hamano <>
  2. @gitster

    use alloc_ref_from_str() everywhere

    René Scharfe committed with gitster
    Replace pairs of alloc_ref() and strcpy() with alloc_ref_from_str(),
    simplifying the code.
    In connect.c, also a pair of alloc_ref() and memcpy() is replaced --
    the additional cost of a strlen() call should not have too much of an
    impact.  Consistency and simplicity are more important.
    In remote.c, the code was allocating 11 bytes more than needed for
    the name part, but I couldn't see them being used for anything.
    Signed-off-by: Rene Scharfe <>
    Signed-off-by: Junio C Hamano <>
Commits on Sep 9, 2008
  1. @gitster

    push: prepare sender to receive extended ref information from the rec…

    gitster committed
    "git push" enhancement allows the receiving end to report not only its own
    refs but refs in repositories it borrows from via the alternate object
    store mechanism.  By telling the sender that objects reachable from these
    extra refs are already complete in the receiving end, the number of
    objects that need to be transfered can be cut down.
    These entries are sent over the wire with string ".have", instead of the
    actual names of the refs.  This string was chosen so that they are ignored
    by older programs at the sending end.  If we sent some random but valid
    looking refnames for these entries, "matching refs" rule (triggered when
    running "git push" without explicit refspecs, where the sender learns what
    refs the receiver has, and updates only the ones with the names of the
    refs the sender also has) and "delete missing" rule (triggered when "git
    push --mirror" is used, where the sender tells the receiver to delete the
    refs it itself does not have) would try to update/delete them, which is
    not what we want.
    This prepares the send-pack (and "push" that runs native protocol) to
    accept extended existing ref information and make use of it.  The ".have"
    entries are excluded from ref matching rules, and are exempt from deletion
    rule while pushing with --mirror option, but are still used for pack
    generation purposes by providing more "bottom" range commits.
    Signed-off-by: Junio C Hamano <>
Commits on Aug 31, 2008
  1. @gitster

    'git foo' program identifies itself without dash in die() messages

    gitster committed
    This is a mechanical conversion of all '*.c' files with:
    	s/((?:die|error|warning)\("git)-(\S+:)/$1 $2/;
    The result was manually inspected and no false positive was found.
    Signed-off-by: Junio C Hamano <>
Commits on Jun 26, 2008
  1. Windows: Disambiguate DOS style paths from SSH URLs.

    Johannes Sixt committed
    If on Windows a path is specified as C:/path, then this is also a valid
    SSH URL. To disambiguate between the two interpretations we take an URL
    that looks like a path with a drive letter as a local URL.
    Signed-off-by: Johannes Sixt <>
Commits on May 14, 2008
  1. @dscho @gitster

    Provide git_config with a callback-data parameter

    dscho committed with gitster
    git_config() only had a function parameter, but no callback data
    parameter.  This assumes that all callback functions only modify
    global variables.
    With this patch, every callback gets a void * parameter, and it is hoped
    that this will help the libification effort.
    Signed-off-by: Johannes Schindelin <>
    Signed-off-by: Junio C Hamano <>
Commits on Feb 22, 2008
  1. @gitster

    Avoid unnecessary "if-before-free" tests.

    Jim Meyering committed with gitster
    This change removes all obvious useless if-before-free tests.
    E.g., it replaces code like this:
            if (some_expression)
                    free (some_expression);
    with the now-equivalent:
            free (some_expression);
    It is equivalent not just because POSIX has required free(NULL)
    to work for a long time, but simply because it has worked for
    so long that no reasonable porting target fails the test.
    Here's some evidence from nearly 1.5 years ago:
    FYI, the change below was prepared by running the following:
      git ls-files -z | xargs -0 \
      perl -0x3b -pi -e \
    Note however, that it doesn't handle brace-enclosed blocks like
    "if (x) { free (x); }".  But that's ok, since there were none like
    that in git sources.
    Beware: if you do use the above snippet, note that it can
    produce syntactically invalid C code.  That happens when the
    affected "if"-statement has a matching "else".
    E.g., it would transform this
      if (x)
        free (x);
        foo ();
    into this:
      free (x);
        foo ();
    There were none of those here, either.
    If you're interested in automating detection of the useless
    tests, you might like the useless-if-before-free script in gnulib:
    [it *does* detect brace-enclosed free statements, and has a --name=S
     option to make it detect free-like functions with different names]
      Remove one more (in imap-send.c), spotted by Jean-Luc Herren <>.
    Signed-off-by: Jim Meyering <>
    Signed-off-by: Junio C Hamano <>
Commits on Feb 12, 2008
  1. @gitster

    Merge branch 'db/no-separate-ls-remote-connection' (early part)

    gitster committed
    * 'db/no-separate-ls-remote-connection' (early part):
      Fix "git clone" for git:// protocol
      Reduce the number of connects when fetching
Commits on Feb 11, 2008
  1. @gitster

    connect.c: guard config parser from value=NULL

    gitster committed
    core.gitproxy configuration expects a string value.
    Signed-off-by: Junio C Hamano <>
Commits on Feb 10, 2008
  1. @dscho @gitster

    Fix "git clone" for git:// protocol

    dscho committed with gitster
    In ba22785(Reduce the number of connects when fetching), we checked
    the return value of git_connect() to see if the connection was
    However, for the git:// protocol, there is no need to have another
    process, so the return value was NULL.
    Now, it makes sense to assume the rule that git_connect() will return
    NULL if it fails (at the moment, it die()s if it fails), so return
    a dummy child process.
    Signed-off-by: Johannes Schindelin <>
    Acked-by: Daniel Barkalow <>
    Signed-off-by: Junio C Hamano <>
Commits on Nov 3, 2007
  1. @gitster

    Miscellaneous const changes and utilities

    Daniel Barkalow committed with gitster
    The list of remote refs in struct transport should be const, because
    builtin-fetch will get confused if it changes.
    The url in git_connect should be const (and work on a copy) instead of
    requiring the caller to copy it.
    match_refs doesn't modify the refspecs it gets.
    get_fetch_map and get_remote_ref don't change the list they get.
    Allow transport get_refs_list methods to modify the struct transport.
    Add a function to copy a list of refs, when a function needs a mutable
    copy of a const list.
    Add a function to check the type of a ref, as per the code in connect.c
    Signed-off-by: Daniel Barkalow <>
    Signed-off-by: Junio C Hamano <>
Commits on Oct 21, 2007
  1. @spearce

    Use start_command() in git_connect() instead of explicit fork/exec.

    Johannes Sixt committed with spearce
    The child process handling is delegated to start_command() and
    Signed-off-by: Johannes Sixt <>
    Signed-off-by: Shawn O. Pearce <>
  2. @spearce

    Change git_connect() to return a struct child_process instead of a pi…

    Johannes Sixt committed with spearce
    This prepares the API of git_connect() and finish_connect() to operate on
    a struct child_process. Currently, we just use that object as a placeholder
    for the pid that we used to return. A follow-up patch will change the
    implementation of git_connect() and finish_connect() to make full use
    of the object.
    Old code had early-return-on-error checks at the calling sites of
    git_connect(), but since git_connect() dies on errors anyway, these checks
    were removed.
    [sp: Corrected style nit of "conn == NULL" to "!conn"]
    Signed-off-by: Johannes Sixt <>
    Signed-off-by: Shawn O. Pearce <>
Commits on Oct 16, 2007
  1. @spearce

    Merge branch 'master' into db/fetch-pack

    spearce committed
    There's a number of tricky conflicts between master and
    this topic right now due to the rewrite of builtin-push.
    Junio must have handled these via rerere; I'd rather not
    deal with them again so I'm pre-merging master into the
    topic.  Besides this topic somehow started to depend on
    the strbuf series that was in next, but is now in master.
    It no longer compiles on its own without the strbuf API.
    * master: (184 commits)
      Whip post maintenance series into shape.
      Minor usage update in setgitperms.perl
      manual: use 'URL' instead of 'url'.
      manual: add some markup.
      manual: Fix example finding commits referencing given content.
      Fix wording in push definition.
      Fix some typos, punctuation, missing words, minor markup.
      manual: Fix or remove em dashes.
      Add a --dry-run option to git-push.
      Add a --dry-run option to git-send-pack.
      Fix in-place editing functions in convert.c
      instaweb: support for Ruby's WEBrick server
      instaweb: allow for use of auto-generated scripts
      Add 'git-p4 commit' as an alias for 'git-p4 submit'
      hg-to-git speedup through selectable repack intervals
      git-svn: respect Subversion's [auth] section configuration values
      gtksourceview2 support for gitview
      fix contrib/hooks/post-receive-email hooks.recipients error message
      Support cvs via git-shell
      rebase -i: use diff plumbing instead of porcelain
Commits on Sep 30, 2007
  1. @gitster

    bundle transport: fix an alloc_ref() call

    gitster committed
    Currently alloc_ref() expects the length of the refname plus 1
    as its parameter, prepares that much space and returns a "ref"
    structure for the caller to fill the refname.  One caller in
    transport.c::get_refs_from_bundle() however allocated one byte
    It may be a good idea to change the calling convention to give
    alloc_ref() the length of the refname, but that clean-up can be
    done in a separate patch.  This patch only fixes the bug and
    makes all callers consistent.
    There was also one overallocation in connect.c, which would not
    hurt but was wasteful.  This patch fixes it as well.
    Signed-off-by: Junio C Hamano <>
Commits on Sep 21, 2007
  1. @gitster

    sq_quote_argv and add_to_string rework with strbuf's.

    Pierre Habouzit committed with gitster
    * sq_quote_buf is made public, and works on a strbuf.
    * sq_quote_argv also works on a strbuf.
    * make sq_quote_argv take a "maxlen" argument to check the buffer won't grow
      too big.
    Signed-off-by: Pierre Habouzit <>
    Signed-off-by: Junio C Hamano <>
Commits on Sep 19, 2007
  1. @gitster

    Use xmemdupz() in many places.

    Pierre Habouzit committed with gitster
    Signed-off-by: Pierre Habouzit <>
    Signed-off-by: Junio C Hamano <>
Commits on Sep 1, 2007
  1. @ltuikov @gitster

    URL: allow port specification in ssh:// URLs

    ltuikov committed with gitster
    Allow port specification in ssh:// URLs in the
    usual notation:
    This allows git to be used over ssh-tunneling
    Signed-off-by: Luben Tuikov <>
    Signed-off-by: Junio C Hamano <>
Commits on Aug 2, 2007
  1. @torvalds @gitster

    connect: accept file:// URL scheme

    torvalds committed with gitster
    We might make it something like: "if you use an url, we don't default to
    local", so the difference would be that
    	git clone file:///directory/to/repo
    would work the way it does now, but
    	git clone /directory/to/repo
    would default to "-l" behaviour. That kind of would make sense (and should
    be easy to implement.
    This adds support for "file://" URL to underlying connect
    codepath to make it happen.
    Signed-off-by: Linus Torvalds <>
    Signed-off-by: Junio C Hamano <>
Commits on Jul 10, 2007
  1. @gitster

    Add allocation and freeing functions for struct refs

    Daniel Barkalow committed with gitster
    Instead of open-coding allocation wherever it happens, have a function.
    Also, add a function to free a list of refs, which we currently never
    actually do.
    Signed-off-by: Daniel Barkalow <>
    Signed-off-by: Junio C Hamano <>
Commits on Jul 1, 2007
  1. @gitster

    Merge branch 'ei/worktree+filter'

    gitster committed
    * ei/worktree+filter:
      filter-branch: always export GIT_DIR if it is set
      setup_git_directory: fix segfault if repository is found in cwd
      test GIT_WORK_TREE
      extend rev-parse test for --is-inside-work-tree
      Use new semantics of is_bare/inside_git_dir/inside_work_tree
      introduce GIT_WORK_TREE to specify the work tree
      test git rev-parse
      rev-parse: introduce --is-bare-repository
      rev-parse: document --is-inside-git-dir
Commits on Jun 16, 2007
  1. @raalkml @gitster

    Do not use h_errno after connect(2): the function does not set it

    raalkml committed with gitster
    Randal L. Schwartz noticed compilation problems on SunOS, which made
    me look at the code again. The thing is, h_errno is not used by
    connect(2), it is only for functions from netdb.h, like gethostbyname.
    Signed-off-by: Alex Riesen <>
    Signed-off-by: Junio C Hamano <>
Commits on Jun 7, 2007
  1. @gitster

    War on whitespace

    gitster committed
    This uses "git-apply --whitespace=strip" to fix whitespace errors that have
    crept in to our source files over time.  There are a few files that need
    to have trailing whitespaces (most notably, test vectors).  The results
    still passes the test, and build result in Documentation/ area is unchanged.
    Signed-off-by: Junio C Hamano <>
Commits on Jun 6, 2007
  1. @matled @gitster

    introduce GIT_WORK_TREE to specify the work tree

    matled committed with gitster
    setup_gdg is used as abbreviation for setup_git_directory_gently.
    The work tree can be specified using the environment variable
    GIT_WORK_TREE and the config option core.worktree (the environment
    variable has precendence over the config option).  Additionally
    there is a command line option --work-tree which sets the
    environment variable.
    setup_gdg does the following now:
    GIT_DIR unspecified
    repository in .git directory
        parent directory of the .git directory is used as work tree,
        GIT_WORK_TREE is ignored
    GIT_DIR unspecified
    repository in cwd
        GIT_DIR is set to cwd
        see the cases with GIT_DIR specified what happens next and
        also see the note below
    GIT_DIR specified
    GIT_WORK_TREE/core.worktree unspecified
        cwd is used as work tree
    GIT_DIR specified
    GIT_WORK_TREE/core.worktree specified
        the specified work tree is used
    Note on the case where GIT_DIR is unspecified and repository is in cwd:
        GIT_WORK_TREE is used but is_inside_git_dir is always true.
        I did it this way because setup_gdg might be called multiple
        times (e.g. when doing alias expansion) and in successive calls
        setup_gdg should do the same thing every time.
    Meaning of is_bare/is_inside_work_tree/is_inside_git_dir:
    (1) is_bare_repository
        A repository is bare if core.bare is true or core.bare is
        unspecified and the name suggests it is bare (directory not
        named .git).  The bare option disables a few protective
        checks which are useful with a working tree.  Currently
        this changes if a repository is bare:
            updates of HEAD are allowed
            git gc packs the refs
            the reflog is disabled by default
    (2) is_inside_work_tree
        True if the cwd is inside the associated working tree (if there
        is one), false otherwise.
    (3) is_inside_git_dir
        True if the cwd is inside the git directory, false otherwise.
        Before this patch is_inside_git_dir was always true for bare
    When setup_gdg finds a repository git_config(git_default_config) is
    always called.  This ensure that is_bare_repository makes use of
    core.bare and does not guess even though core.bare is specified.
    inside_work_tree and inside_git_dir are set if setup_gdg finds a
    repository.  The is_inside_work_tree and is_inside_git_dir functions
    will die if they are called before a successful call to setup_gdg.
    Signed-off-by: Matthias Lederhofer <>
    Signed-off-by: Junio C Hamano <>
Commits on May 29, 2007
  1. Merge branch 'db/remote'

    Junio C Hamano committed
    * db/remote:
      Move refspec pattern matching to match_refs().
      Update local tracking refs when pushing
      Add handlers for fetch-side configuration of remotes.
      Move refspec parser from connect.c and cache.h to remote.{c,h}
      Move remote parsing into a library file out of builtin-push.
Commits on May 25, 2007
  1. @raalkml

    Verbose connect messages to show the IP addresses used

    raalkml committed with Junio C Hamano
    Also, the patch makes the error messages more verbose. Helps when
    diagnosing connect problems on weird systems.
    Signed-off-by: Alex Riesen <>
    Signed-off-by: Junio C Hamano <>
Commits on May 21, 2007
  1. Move refspec parser from connect.c and cache.h to remote.{c,h}

    Daniel Barkalow committed with Junio C Hamano
    Signed-off-by: Daniel Barkalow <>
    Signed-off-by: Junio C Hamano <>
Commits on May 16, 2007
  1. connect: display connection progress

    Michael S. Tsirkin committed with Junio C Hamano
    Make git notify the user about host resolution/connection attempts.
    This is useful both as a progress indicator on slow links, and helps
    reassure the user there are no firewall problems.
    Signed-off-by: Michael S. Tsirkin <>
    Acked-by: Linus Torvalds <>
    Signed-off-by: Junio C Hamano <>
Commits on Mar 27, 2007
  1. @torvalds

    Fix "getaddrinfo()" buglet

    torvalds committed with Junio C Hamano
    At least in Linux glibc, "getaddrinfo()" has a very irritating feature (or
    bug, who knows..).
    Namely if you pass it in an empty string for the service name, it will
    happily and quietly consider it identical to a NULL port pointer, and
    return port number zero and no errors. Which obviously will not work.
    Maybe that's what it's really expected to do, although the man-page for
    getaddrinfo() certainly implies that it's a bug.
    So when somebody passes me a "please pull" request pointing to something
    like the following
    (note the extraneous colon at the end of the host name), git would happily
    try to connect to port 0, which would generally just cause the remote to
    not even answer, and the "connect()" will take a long time to time out.
    So to work around the glibc feature/bug, just notice this empty port case
    automatically. Also, add the port information to the error information
    when it fails to look up (maybe it's the host-name that fails, maybe it's
    the port-name - we should print out both).
    Signed-off-by: Linus Torvalds <>
    Signed-off-by: Junio C Hamano <>
Something went wrong with that request. Please try again.