Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP

Jun 21, 2009

  1. Junio C Hamano

    Merge branch 'mg/pushurl'

    * mg/pushurl:
      avoid NULL dereference on failed malloc
      builtin-remote: Make "remote -v" display push urls
      builtin-remote: Show push urls as well
      technical/api-remote: Describe new struct remote member pushurl
      t5516: Check pushurl config setting
      Allow push and fetch urls to be different
    gitster authored

Jun 10, 2009

  1. Michael J Gruber

    Allow push and fetch urls to be different

    This introduces a config setting remote.$remotename.pushurl which is
    used for pushes only. If absent remote.$remotename.url is used for
    pushes and fetches as before.
    This is useful, for example, in order to do passwordless fetches
    (remote update) over the git transport but pushes over ssh.
    
    Signed-off-by: Michael J Gruber <git@drmicha.warpmail.net>
    Signed-off-by: Junio C Hamano <gitster@pobox.com>
    mjg authored gitster committed

Jun 02, 2009

  1. Clemens Buchacher

    match_refs: search ref list tail internally

    Avoid code duplication by moving list tail search to match_refs().
    
    This does not change the semantics, except for http-push, which now inserts
    to the front of the ref list in order to get rid of the global remote_tail.
    
    Signed-off-by: Clemens Buchacher <drizzd@aon.at>
    Signed-off-by: Junio C Hamano <gitster@pobox.com>
    drizzd authored gitster committed

Apr 08, 2009

  1. remote: New function remote_is_configured()

    Previously, there was no easy way to check for the existence of a
    configured remote. remote_get for example would always create the remote
    "on demand".
    
    This new function returns 1 if the remote is configured, 0 otherwise.
    
    Signed-off-by: Finn Arne Gangstad <finnag@pvv.org>
    Signed-off-by: Junio C Hamano <gitster@pobox.com>
    Finn Arne Gangstad authored gitster committed

Feb 27, 2009

  1. Jay Soffian

    remote: let guess_remote_head() optionally return all matches

    Determining HEAD is ambiguous since it is done by comparing SHA1s.
    
    In the case of multiple matches we return refs/heads/master if it
    matches, else we return the first match we encounter. builtin-remote
    needs all matches returned to it, so add a flag for it to request such.
    
    To be simple and consistent, the return value is now a copy (including
    peer_ref) of the matching refs.
    
    Originally contributed by Jeff King along with the prior commit as a
    single patch.
    
    Signed-off-by: Jay Soffian <jaysoffian@gmail.com>
    Signed-off-by: Junio C Hamano <gitster@pobox.com>
    jaysoffian authored gitster committed

Feb 26, 2009

  1. Jay Soffian

    remote: simplify guess_remote_head()

    This function had complications which made it hard to extend.
    
    - It used to do two things: find the HEAD ref, and then find a
      matching ref, optionally returning the former via assignment to a
      passed-in pointer. Since finding HEAD is a one-liner, just have a
      caller do it themselves and pass it as an argument.
    
    - It used to manually search through the ref list for
      refs/heads/master; this can be a one-line call to
      find_ref_by_name.
    
    Originally contributed by Jeff King along with the next commit as a
    single patch.
    
    Signed-off-by: Jay Soffian <jaysoffian@gmail.com>
    Signed-off-by: Junio C Hamano <gitster@pobox.com>
    jaysoffian authored gitster committed
  2. Jay Soffian

    move locate_head() to remote.c

    Move locate_head() to remote.c and rename it to guess_remote_head() to
    more accurately reflect what it does. This is in preparation for being
    able to call it from builtin-remote.c
    
    Signed-off-by: Jay Soffian <jaysoffian@gmail.com>
    Signed-off-by: Junio C Hamano <gitster@pobox.com>
    jaysoffian authored gitster committed
  3. Jay Soffian

    move duplicated ref_newer() to remote.c

    ref_newer() appears to have been copied from builtin-send-pack.c to
    http-push.c via cut and paste. This patch moves the function and its
    helper unmark_and_free() to remote.c. There was a slight difference
    between the two implementations, one used TMP_MARK for the mark, the
    other used 1. Per Jeff King, I went with TMP_MARK as more correct.
    
    This is in preparation for being able to call it from builtin-remote.c
    
    Signed-off-by: Jay Soffian <jaysoffian@gmail.com>
    Signed-off-by: Junio C Hamano <gitster@pobox.com>
    jaysoffian authored gitster committed
  4. Jay Soffian

    move duplicated get_local_heads() to remote.c

    get_local_heads() appears to have been copied from builtin-send-pack.c
    to http-push.c via cut and paste. This patch moves the function and its
    helper one_local_ref() to remote.c.
    
    The two copies of one_local_ref() were not identical. I used the more
    recent version from builtin-send-pack.c after confirming with Jeff King
    that it was an oversight that commit 30affa1 did not update both
    copies.
    
    This is in preparation for being able to call it from builtin-remote.c
    
    Signed-off-by: Jay Soffian <jaysoffian@gmail.com>
    Signed-off-by: Junio C Hamano <gitster@pobox.com>
    jaysoffian authored gitster committed

Nov 11, 2008

  1. Miklos Vajna

    remote: add a new 'origin' variable to the struct

    This allows one to track where was the remote's original source, so that
    it's possible to decide if it makes sense to migrate it to the config
    format or not.
    
    Signed-off-by: Miklos Vajna <vmiklos@frugalware.org>
    Signed-off-by: Junio C Hamano <gitster@pobox.com>
    vmiklos authored gitster committed

Oct 18, 2008

  1. make alloc_ref_from_str() the new alloc_ref()

    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 <rene.scharfe@lsrfire.ath.cx>
    Signed-off-by: Junio C Hamano <gitster@pobox.com>
    René Scharfe authored gitster committed

Sep 25, 2008

  1. remote.c: make free_ref(), parse_push_refspec() and free_refspecs() s…

    …tatic.
    
    These functions are not used by any other file.
    
    Signed-off-by: Nanako Shiraishi <nanako3@lavabit.com>
    Signed-off-by: Shawn O. Pearce <spearce@spearce.org>
    Nanako Shiraishi authored spearce committed

Aug 22, 2008

  1. remote.c: add a function for deleting a refspec array and use it (twice)

    A number of call sites allocate memory for a refspec array, populate
    its members with heap memory, and then free only the refspec pointer
    while leaking the memory allocated for the member elements. Provide
    a function for freeing the elements of a refspec array and the array
    itself.
    
    Caution to callers: code paths must be checked to ensure that the
    refspec members "src" and "dst" can be passed to free.
    
    Signed-off-by: Brandon Casey <casey@nrlssc.navy.mil>
    Signed-off-by: Junio C Hamano <gitster@pobox.com>
    Brandon Casey authored gitster committed

Jul 03, 2008

  1. Junio C Hamano

    Refactor "tracking statistics" code used by "git checkout"

    People seem to like "Your branch is ahead by N commit" report made by
    "git checkout", but the interface into the statistics function was a bit
    clunky.  This splits the function into three parts:
    
     * The core "commit counting" function that takes "struct branch" and
       returns number of commits to show if we are ahead, behind or forked;
    
     * Convenience "stat formating" function that takes "struct branch" and
       formats the report into a given strbuf, using the above function;
    
     * "checkout" specific function that takes "branch_info" (type that is
       internal to checkout implementation), calls the above function and
       print the formatted result.
    
    in the hope that the former two can be more easily reusable.
    
    Signed-off-by: Junio C Hamano <gitster@pobox.com>
    gitster authored

May 25, 2008

  1. Junio C Hamano

    Merge branch 'db/clone-in-c'

    * db/clone-in-c:
      Add test for cloning with "--reference" repo being a subset of source repo
      Add a test for another combination of --reference
      Test that --reference actually suppresses fetching referenced objects
      clone: fall back to copying if hardlinking fails
      builtin-clone.c: Need to closedir() in copy_or_link_directory()
      builtin-clone: fix initial checkout
      Build in clone
      Provide API access to init_db()
      Add a function to set a non-default work tree
      Allow for having for_each_ref() list extra refs
      Have a constant extern refspec for "--tags"
      Add a library function to add an alternate to the alternates file
      Add a lockfile function to append to a file
      Mark the list of refs to fetch as const
    
    Conflicts:
    
    	cache.h
    	t/t5700-clone-reference.sh
    gitster authored

May 23, 2008

  1. Junio C Hamano

    Merge branch 'pb/push'

    * pb/push:
      add special "matching refs" refspec
    gitster authored

May 11, 2008

  1. Krzysztof Kowalczyk

    alloc_ref_from_str(): factor out a common pattern of alloc_ref from s…

    …tring
    
    Also fix an underallocation in walker.c::interpret_target().
    
    Signed-off-by: Krzysztof Kowalczyk <kkowalczyk@gmail.com>
    Signed-off-by: Junio C Hamano <gitster@pobox.com>
    kjk authored gitster committed

May 09, 2008

  1. Junio C Hamano

    Merge branch 'db/learn-HEAD'

    * db/learn-HEAD:
      Make ls-remote http://... list HEAD, like for git://...
      Make walker.fetch_ref() take a struct ref.
    gitster authored

May 05, 2008

  1. Have a constant extern refspec for "--tags"

    The refspec refs/tags/*:refs/tags/* is sufficiently common and generic
    to merit having a constant instead of generating it as needed.
    
    Signed-off-by: Daniel Barkalow <barkalow@iabervon.org>
    Signed-off-by: Junio C Hamano <gitster@pobox.com>
    Daniel Barkalow authored gitster committed
  2. Paolo Bonzini

    add special "matching refs" refspec

    This patch provides a way to specify "push matching heads" using a
    special refspec ":".  This is useful because it allows "push = +:"
    as a way to specify that matching refs will be pushed but, in addition,
    forced updates will be allowed, which was not possible before.
    
    Signed-off-by: Paolo Bonzini <bonzini@gnu.org>
    Signed-off-by: Junio C Hamano <gitster@pobox.com>
    bonzini authored gitster committed

Apr 27, 2008

  1. Make ls-remote http://... list HEAD, like for git://...

    This makes a struct ref able to represent a symref, and makes http.c
    able to recognize one, and makes transport.c look for "HEAD" as a ref
    in the list, and makes it dereference symrefs for the resulting ref,
    if any.
    
    Signed-off-by: Daniel Barkalow <barkalow@iabervon.org>
    Signed-off-by: Junio C Hamano <gitster@pobox.com>
    Daniel Barkalow authored gitster committed

Apr 21, 2008

  1. Paolo Bonzini

    Add a remote.*.mirror configuration option

    This patch adds a remote.*.mirror configuration option that,
    when set, automatically puts git-push in --mirror mode for that
    remote.
    
    Furthermore, the option is set automatically by `git remote
    add --mirror'.
    
    The code in remote.c to parse remote.*.skipdefaultupdate
    had a subtle problem: a comment in the code indicated that
    special care was needed for boolean options, but this care was
    not used in parsing the option.  Since I was touching related
    code, I did this fix too.
    
    [jc: and I further fixed up the "ignore boolean" code.]
    
    Signed-off-by: Paolo Bonzini <bonzini@gnu.org>
    Signed-off-by: Junio C Hamano <gitster@pobox.com>
    bonzini authored gitster committed

Apr 18, 2008

  1. Jonas Fonseca

    git-remote: reject adding remotes with invalid names

    This can happen if the arguments to git-remote add is switched by the
    user, and git would only show an error if fetching was also requested.
    Fix it by using the refspec parsing engine to check if the requested
    name can be parsed as a remote before add it.
    
    Also cleanup so that the "remote.<name>.url" config name buffer is only
    initialized once.
    
    Signed-off-by: Jonas Fonseca <fonseca@diku.dk>
    Signed-off-by: Junio C Hamano <gitster@pobox.com>
    jonas authored gitster committed

Mar 23, 2008

  1. Junio C Hamano

    remote.c: Fix overtight refspec validation

    We tightened the refspec validation code in an earlier commit ef00d15
    (Tighten refspec processing, 2008-03-17) per my suggestion, but the
    suggestion was misguided to begin with and it broke this usage:
    
        $ git push origin HEAD~12:master
    
    The syntax of push refspecs and fetch refspecs are similar in that they
    are both colon separated LHS and RHS (possibly prefixed with a + to
    force), but the similarity ends there.  For example, LHS in a push refspec
    can be anything that evaluates to a valid object name at runtime (except
    when colon and RHS is missing, or it is a glob), while it must be a
    valid-looking refname in a fetch refspec.  To validate them correctly, the
    caller needs to be able to say which kind of refspecs they are.  It is
    unreasonable to keep a single interface that cannot tell which kind it is
    dealing with, and ask it to behave sensibly.
    
    This commit separates the parsing of the two into different functions, and
    clarifies the code to implement the parsing proper (i.e. splitting into
    two parts, making sure both sides are wildcard or neither side is).
    
    This happens to also allow pushing a commit named with the esoteric "look
    for that string" syntax:
    
        $ git push ../test.git ':/remote.c: Fix overtight refspec:master'
    
    Signed-off-by: Junio C Hamano <gitster@pobox.com>
    gitster authored

Mar 01, 2008

  1. dscho

    Make git-remote a builtin

    Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
    Signed-off-by: Junio C Hamano <gitster@pobox.com>
    dscho authored gitster committed

Feb 19, 2008

  1. Use ALLOC_GROW in remote.{c,h}

    Signed-off-by: Daniel Barkalow <barkalow@iabervon.org>
    Signed-off-by: Junio C Hamano <gitster@pobox.com>
    Daniel Barkalow authored gitster committed

Dec 04, 2007

  1. Add remote.<name>.proxy

    As well as allowing a default http.proxy option, allow it to be set
    per-remote.
    
    Signed-off-by: Sam Vilain <sam.vilain@catalyst.net.nz>
    Signed-off-by: Junio C Hamano <gitster@pobox.com>
    Sam Vilain authored gitster committed

Nov 10, 2007

  1. Andy Whitcroft

    Teach send-pack a mirror mode

    Existing "git push --all" is almost perfect for backing up to
    another repository, except that "--all" only means "all
    branches" in modern git, and it does not delete old branches and
    tags that exist at the back-up repository that you have removed
    from your local repository.
    
    This teaches "git-send-pack" a new "--mirror" option.  The
    difference from the "--all" option are that (1) it sends all
    refs, not just branches, and (2) it deletes old refs you no
    longer have on the local side from the remote side.
    
    Original patch by Junio C Hamano.
    
    Signed-off-by: Andy Whitcroft <apw@shadowen.org>
    Signed-off-by: Junio C Hamano <gitster@pobox.com>
    awhitcroft authored gitster committed

Nov 03, 2007

  1. Miscellaneous const changes and utilities

    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 <barkalow@iabervon.org>
    Signed-off-by: Junio C Hamano <gitster@pobox.com>
    Daniel Barkalow authored gitster committed

Oct 28, 2007

  1. Junio C Hamano

    git-fetch: do not fail when remote branch disappears

    When the branch named with branch.$name.merge is not covered by
    the fetch configuration for the remote repository named with
    branch.$name.remote, we automatically add that branch to the set
    of branches to be fetched.  However, if the remote repository
    does not have that branch (e.g. it used to exist, but got
    removed), this is not a reason to fail the git-fetch itself.
    
    The situation however will be noticed if git-fetch was called by
    git-pull, as the resulting FETCH_HEAD would not have any entry
    that is marked for merging.
    
    Acked-By: Daniel Barkalow <barkalow@iabervon.org>
    Signed-off-by: Junio C Hamano <gitster@pobox.com>
    gitster authored

Oct 16, 2007

  1. Remove duplicate ref matches in fetch

    If multiple refspecs matched the same ref, the update would be
    processed multiple times. Now having the same destination for the same
    source has no additional effect, and having the same destination for
    different sources is an error.
    
    Signed-off-by: Daniel Barkalow <barkalow@iabervon.org>
    Signed-off-by: Lars Hjemli <hjemli@gmail.com>
    Signed-off-by: Shawn O. Pearce <spearce@spearce.org>
    Daniel Barkalow authored spearce committed

Sep 19, 2007

  1. Shawn O. Pearce

    Rename remote.uri to remote.url within remote handling internals

    Anyplace we talk about the address of a remote repository we always
    refer to it as a URL, especially in the configuration file and
    .git/remotes where we call it "remote.$n.url" or start the first
    line with "URL:".  Calling this value a uri within the internal C
    code just doesn't jive well with our commonly accepted terms.
    
    Signed-off-by: Shawn O. Pearce <spearce@spearce.org>
    Signed-off-by: Junio C Hamano <gitster@pobox.com>
    spearce authored gitster committed
  2. Shawn O. Pearce

    Correct handling of branch.$name.merge in builtin-fetch

    My prior bug fix for git-push titled "Don't configure remote "." to
    fetch everything to itself" actually broke t5520 as we were unable
    to evaluate a branch configuration of:
    
      [branch "copy"]
        remote = .
        merge = refs/heads/master
    
    as remote "." did not have a "remote...fetch" configuration entry to
    offer up refs/heads/master as a possible candidate available to be
    fetched and merged.  In shell script git-fetch and prior to the above
    mentioned commit this was hardcoded for a url of "." to be the set of
    local branches.
    
    Chasing down this bug led me to the conclusion that our prior behavior
    with regards to branch.$name.merge was incorrect.  In the shell script
    based git-fetch implementation we only fetched and merged a branch if
    it appeared both in branch.$name.merge *and* in remote.$r.fetch, where
    $r = branch.$name.remote.  In other words in the following config file:
    
      [remote "origin"]
        url = git://git.kernel.org/pub/scm/git/git.git
        fetch = refs/heads/master:refs/remotes/origin/master
      [branch "master"]
        remote = origin
        merge = refs/heads/master
      [branch "pu"]
        remote = origin
        merge = refs/heads/pu
    
    Attempting to run `git pull` while on branch "pu" would always give
    the user "Already up-to-date" as git-fetch did not fetch pu and thus
    did not mark it for merge in .git/FETCH_HEAD.  The configured merge
    would always be ignored and the user would be left scratching her
    confused head wondering why merge did not work on "pu" but worked
    fine on "master".
    
    If we are using the "default fetch" specification for the current
    branch and the current branch has a branch.$name.merge configured
    we now union it with the list of refs in remote.$r.fetch.  This
    way the above configuration does what the user expects it to do,
    which is to fetch only "master" by default but when on "pu" to
    fetch both "master" and "pu".
    
    This uncovered some breakage in the test suite where old-style Cogito
    branches (.git/branches/$r) did not fetch the branches listed in
    .git/config for merging and thus did not actually merge them if the
    user tried to use `git pull` on that branch.  Junio and I discussed
    it on list and felt that the union approach here makes more sense to
    DWIM for the end-user than silently ignoring their configured request
    so the test vectors for t5515 have been updated to include for-merge
    lines in .git/FETCH_HEAD where they have been configured for-merge
    in .git/config.
    
    Since we are now performing a union of the fetch specification and
    the merge specification and we cannot allow a branch to be listed
    twice (otherwise it comes out twice in .git/FETCH_HEAD) we need to
    perform a double loop here over all of the branch.$name.merge lines
    and try to set their merge flag if we have already schedule that
    branch for fetching by remote.$r.fetch.  If no match is found then
    we must add new specifications to fetch the branch but not store it
    as no local tracking branch has been designated.
    
    Signed-off-by: Shawn O. Pearce <spearce@spearce.org>
    spearce authored gitster committed
  3. Add matching and parsing for fetch-side refspec rules

    Also exports parse_ref_spec().
    
    Signed-off-by: Daniel Barkalow <barkalow@iabervon.org>
    Signed-off-by: Junio C Hamano <gitster@pobox.com>
    Daniel Barkalow authored gitster committed
  4. Report information on branches from remote.h

    This adds full parsing for branch.<name> sections and functions to
    interpret the results usefully. It incidentally corrects the fetch
    configuration information for legacy branches/* files with '#'
    characters in the URLs.
    
    Signed-off-by: Daniel Barkalow <barkalow@iabervon.org>
    Signed-off-by: Junio C Hamano <gitster@pobox.com>
    Daniel Barkalow authored gitster committed
Something went wrong with that request. Please try again.