Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP

Oct 26, 2011

  1. Junio C Hamano

    Merge branch 'cn/fetch-prune'

    * cn/fetch-prune:
      fetch: treat --tags like refs/tags/*:refs/tags/* when pruning
      fetch: honor the user-provided refspecs when pruning refs
      remote: separate out the remote_find_tracking logic into query_refspecs
      t5510: add tests for fetch --prune
      fetch: free all the additional refspecs
    
    Conflicts:
    	remote.c
    authored October 26, 2011

Oct 16, 2011

  1. Carlos Martín Nieto

    fetch: honor the user-provided refspecs when pruning refs

    If the user gave us refspecs on the command line, we should use those
    when deciding whether to prune a ref instead of relying on the
    refspecs in the config.
    
    Previously, running
    
        git fetch --prune origin refs/heads/master:refs/remotes/origin/master
    
    would delete every other ref under the origin namespace because we
    were using the refspec to filter the available refs but using the
    configured refspec to figure out if a ref had been deleted on the
    remote. This is clearly the wrong thing to do.
    
    Change prune_refs and get_stale_heads to simply accept a list of
    references and a list of refspecs. The caller of either function needs
    to decide what refspecs should be used to decide whether a ref is
    stale.
    
    Signed-off-by: Carlos Martín Nieto <cmn@elego.de>
    Signed-off-by: Junio C Hamano <gitster@pobox.com>
    authored October 15, 2011 gitster committed October 15, 2011

Sep 12, 2011

  1. Junio C Hamano

    rename "match_refs()" to "match_push_refs()"

    Yes, there is a warning that says the function is only used by push in big
    red letters in front of this function, but it didn't say a more important
    thing it should have said: what the function is for and what it does.
    
    Rename it and document it to avoid future confusion.
    
    Signed-off-by: Junio C Hamano <gitster@pobox.com>
    authored September 09, 2011

Jun 07, 2011

  1. Jeff King

    make copy_ref globally available

    This is a useful function, and we have already made the
    similar alloc_ref and copy_ref_list available.
    
    Signed-off-by: Jeff King <peff@peff.net>
    Signed-off-by: Junio C Hamano <gitster@pobox.com>
    authored June 07, 2011 gitster committed June 07, 2011

May 31, 2010

  1. enums: omit trailing comma for portability

    Without this patch at least IBM VisualAge C 5.0 (I have 5.0.2) on AIX
    5.1 fails to compile git.
    
    enum style is inconsistent already, with some enums declared on one
    line, some over 3 lines with the enum values all on the middle line,
    sometimes with 1 enum value per line... and independently of that the
    trailing comma is sometimes present and other times absent, often
    mixing with/without trailing comma styles in a single file, and
    sometimes in consecutive enum declarations.
    
    Clearly, omitting the comma is the more portable style, and this patch
    changes all enum declarations to use the portable omitted dangling
    comma style consistently.
    
    Signed-off-by: Gary V. Vaughan <gary@thewrittenword.com>
    Signed-off-by: Junio C Hamano <gitster@pobox.com>
    authored May 14, 2010 gitster committed May 31, 2010

Jan 10, 2010

  1. Tay Ray Chuan

    refactor ref status logic for pushing

    Move the logic that detects up-to-date and non-fast-forward refs to a
    new function in remote.[ch], set_ref_status_for_push().
    
    Make transport_push() invoke set_ref_status_for_push() before invoking
    the push_refs() implementation. (As a side-effect, the push_refs()
    implementation in transport-helper.c now knows of non-fast-forward
    pushes.)
    
    Removed logic for detecting up-to-date refs from the push_refs()
    implementation in transport-helper.c, as transport_push() has already
    done so for it.
    
    Make cmd_send_pack() invoke set_ref_status_for_push() before invoking
    send_pack(), as transport_push() can't do it for send_pack() here.
    
    Mark the test on the return status of non-fast-forward push to fail.
    Git now exits with success, as transport.c::transport_push() does not
    check for refs with status REF_STATUS_REJECT_NONFASTFORWARD nor does it
    indicate rejected pushes with its return value.
    
    Mark the test for ref status to succeed. As mentioned earlier, refs
    might be marked as non-fast-forwards, triggering the push status
    printing mechanism in transport.c.
    
    Signed-off-by: Tay Ray Chuan <rctay89@gmail.com>
    Signed-off-by: Junio C Hamano <gitster@pobox.com>
    authored January 08, 2010 gitster committed January 09, 2010

Dec 26, 2009

  1. Junio C Hamano

    Merge branch 'sr/vcs-helper'

    * sr/vcs-helper:
      tests: handle NO_PYTHON setting
      builtin-push: don't access freed transport->url
      Add Python support library for remote helpers
      Basic build infrastructure for Python scripts
      Allow helpers to report in "list" command that the ref is unchanged
      Fix various memory leaks in transport-helper.c
      Allow helper to map private ref names into normal names
      Add support for "import" helper command
      Allow specifying the remote helper in the url
      Add a config option for remotes to specify a foreign vcs
      Allow fetch to modify refs
      Use a function to determine whether a remote is valid
      Allow programs to not depend on remotes having urls
      Fix memory leak in helper method for disconnect
    
    Conflicts:
    	Documentation/git-remote-helpers.txt
    	Makefile
    	builtin-ls-remote.c
    	builtin-push.c
    	transport-helper.c
    authored December 26, 2009

Nov 18, 2009

  1. Allow helper to map private ref names into normal names

    This allows a helper to say that, when it handles "import
    refs/heads/topic", the script it outputs will actually write to
    refs/svn/origin/branches/topic; therefore, transport-helper should
    read it from the latter location after git-fast-import completes.
    
    Signed-off-by: Daniel Barkalow <barkalow@iabervon.org>
    Signed-off-by: Junio C Hamano <gitster@pobox.com>
    authored November 18, 2009 gitster committed November 17, 2009
  2. Add a config option for remotes to specify a foreign vcs

    If this is set, the url is not required, and the transport always uses
    a helper named "git-remote-<value>".
    
    It is a separate configuration option in order to allow a sensible
    configuration for foreign systems which either have no meaningful urls
    for repositories or which require urls that do not specify the system
    used by the repository at that location. However, this only affects
    how the name of the helper is determined, not anything about the
    interaction with the helper, and the contruction is such that, if the
    foreign scm does happen to use a co-named url method, a url with that
    method may be used directly.
    
    Signed-off-by: Daniel Barkalow <barkalow@iabervon.org>
    Signed-off-by: Sverre Rabbelier <srabbelier@gmail.com>
    Signed-off-by: Junio C Hamano <gitster@pobox.com>
    authored November 18, 2009 gitster committed November 17, 2009

Nov 10, 2009

  1. Jay Soffian

    remote: refactor some logic into get_stale_heads()

    Move the logic in builtin-remote.c which determines which local heads are stale
    to remote.c so it can be used by other builtins.
    
    Signed-off-by: Jay Soffian <jaysoffian@gmail.com>
    Signed-off-by: Junio C Hamano <gitster@pobox.com>
    authored November 10, 2009 gitster committed November 10, 2009

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
    authored June 20, 2009

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>
    authored June 09, 2009 gitster committed June 09, 2009

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>
    authored May 31, 2009 gitster committed June 01, 2009

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>
    authored April 06, 2009 gitster committed April 07, 2009

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>
    authored February 27, 2009 gitster committed February 27, 2009

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>
    authored February 25, 2009 gitster committed February 26, 2009
  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>
    authored February 25, 2009 gitster committed February 26, 2009
  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>
    authored February 25, 2009 gitster committed February 26, 2009
  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>
    authored February 25, 2009 gitster committed February 26, 2009

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>
    authored November 10, 2008 gitster committed November 11, 2008

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>
    authored October 18, 2008 gitster committed October 18, 2008

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>
    authored September 25, 2008 spearce committed September 25, 2008

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>
    authored August 21, 2008 gitster committed August 22, 2008

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>
    authored July 02, 2008

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
    authored May 25, 2008

May 23, 2008

  1. Junio C Hamano

    Merge branch 'pb/push'

    * pb/push:
      add special "matching refs" refspec
    authored May 23, 2008

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>
    authored May 10, 2008 gitster committed May 11, 2008

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.
    authored May 08, 2008

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>
    authored April 17, 2008 gitster committed May 04, 2008
  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>
    authored April 28, 2008 gitster committed May 04, 2008

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>
    authored April 26, 2008 gitster committed April 26, 2008

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>
    authored April 17, 2008 gitster committed April 20, 2008

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>
    authored April 13, 2008 gitster committed April 18, 2008

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>
    authored March 20, 2008

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>
    authored February 29, 2008 gitster committed March 01, 2008
Something went wrong with that request. Please try again.