1. 18 11月, 2009 2 次提交
  2. 10 11月, 2009 1 次提交
  3. 10 6月, 2009 1 次提交
  4. 02 6月, 2009 1 次提交
  5. 08 4月, 2009 1 次提交
  6. 28 2月, 2009 1 次提交
    • J
      remote: let guess_remote_head() optionally return all matches · 4229f1fa
      Jay Soffian 提交于
      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: NJay Soffian <jaysoffian@gmail.com>
      Signed-off-by: NJunio C Hamano <gitster@pobox.com>
      4229f1fa
  7. 26 2月, 2009 4 次提交
    • J
      remote: simplify guess_remote_head() · 6cb4e6cc
      Jay Soffian 提交于
      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: NJay Soffian <jaysoffian@gmail.com>
      Signed-off-by: NJunio C Hamano <gitster@pobox.com>
      6cb4e6cc
    • J
      move locate_head() to remote.c · 8ef51733
      Jay Soffian 提交于
      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: NJay Soffian <jaysoffian@gmail.com>
      Signed-off-by: NJunio C Hamano <gitster@pobox.com>
      8ef51733
    • J
      move duplicated ref_newer() to remote.c · ec8452d5
      Jay Soffian 提交于
      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: NJay Soffian <jaysoffian@gmail.com>
      Signed-off-by: NJunio C Hamano <gitster@pobox.com>
      ec8452d5
    • J
      move duplicated get_local_heads() to remote.c · 454e2025
      Jay Soffian 提交于
      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 30affa1e did not update both
      copies.
      
      This is in preparation for being able to call it from builtin-remote.c
      Signed-off-by: NJay Soffian <jaysoffian@gmail.com>
      Signed-off-by: NJunio C Hamano <gitster@pobox.com>
      454e2025
  8. 12 11月, 2008 1 次提交
  9. 18 10月, 2008 1 次提交
  10. 25 9月, 2008 1 次提交
  11. 22 8月, 2008 1 次提交
  12. 03 7月, 2008 1 次提交
    • J
      Refactor "tracking statistics" code used by "git checkout" · 6d21bf96
      Junio C Hamano 提交于
      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: NJunio C Hamano <gitster@pobox.com>
      6d21bf96
  13. 12 5月, 2008 1 次提交
  14. 05 5月, 2008 2 次提交
  15. 27 4月, 2008 1 次提交
  16. 21 4月, 2008 1 次提交
    • P
      Add a remote.*.mirror configuration option · 84bb2dfd
      Paolo Bonzini 提交于
      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: NPaolo Bonzini <bonzini@gnu.org>
      Signed-off-by: NJunio C Hamano <gitster@pobox.com>
      84bb2dfd
  17. 19 4月, 2008 1 次提交
  18. 26 3月, 2008 1 次提交
    • D
      Tighten refspec processing · c091b3d4
      Daniel Barkalow 提交于
      This changes the pattern matching code to not store the required final
      / before the *, and then to require each side to be a valid ref (or
      empty). In particular, any refspec that looks like it should be a
      pattern but doesn't quite meet the requirements will be found to be
      invalid as a fallback non-pattern.
      
      This was cherry picked from commit ef00d150 (Tighten refspec processing,
      2008-03-17), and two fix-up commits 46220ca1 (remote.c: Fix overtight
      refspec validation, 2008-03-20) and 7d19da46 (refspec: allow colon-less
      wildcard "refs/category/*", 2008-03-25) squashed in.
      Signed-off-by: NDaniel Barkalow <barkalow@iabervon.org>
      Signed-off-by: NJunio C Hamano <gitster@pobox.com>
      c091b3d4
  19. 23 3月, 2008 1 次提交
    • J
      remote.c: Fix overtight refspec validation · 46220ca1
      Junio C Hamano 提交于
      We tightened the refspec validation code in an earlier commit ef00d150
      (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: NJunio C Hamano <gitster@pobox.com>
      46220ca1
  20. 01 3月, 2008 1 次提交
  21. 19 2月, 2008 1 次提交
  22. 04 12月, 2007 1 次提交
  23. 10 11月, 2007 1 次提交
    • A
      Teach send-pack a mirror mode · 28b9d6e5
      Andy Whitcroft 提交于
      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: NAndy Whitcroft <apw@shadowen.org>
      Signed-off-by: NJunio C Hamano <gitster@pobox.com>
      28b9d6e5
  24. 03 11月, 2007 1 次提交
    • D
      Miscellaneous const changes and utilities · 4577370e
      Daniel Barkalow 提交于
      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: NDaniel Barkalow <barkalow@iabervon.org>
      Signed-off-by: NJunio C Hamano <gitster@pobox.com>
      4577370e
  25. 29 10月, 2007 1 次提交
    • J
      git-fetch: do not fail when remote branch disappears · 9ad7c5ae
      Junio C Hamano 提交于
      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: NDaniel Barkalow <barkalow@iabervon.org>
      Signed-off-by: NJunio C Hamano <gitster@pobox.com>
      9ad7c5ae
  26. 16 10月, 2007 1 次提交
  27. 19 9月, 2007 5 次提交
    • S
      Rename remote.uri to remote.url within remote handling internals · 28b91f8a
      Shawn O. Pearce 提交于
      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: NShawn O. Pearce <spearce@spearce.org>
      Signed-off-by: NJunio C Hamano <gitster@pobox.com>
      28b91f8a
    • S
      Correct handling of branch.$name.merge in builtin-fetch · 85682c19
      Shawn O. Pearce 提交于
      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: NShawn O. Pearce <spearce@spearce.org>
      85682c19
    • D
      Add matching and parsing for fetch-side refspec rules · d71ab174
      Daniel Barkalow 提交于
      Also exports parse_ref_spec().
      Signed-off-by: NDaniel Barkalow <barkalow@iabervon.org>
      Signed-off-by: NJunio C Hamano <gitster@pobox.com>
      d71ab174
    • D
      Report information on branches from remote.h · cf818348
      Daniel Barkalow 提交于
      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: NDaniel Barkalow <barkalow@iabervon.org>
      Signed-off-by: NJunio C Hamano <gitster@pobox.com>
      cf818348
    • D
      0012ba21
  28. 12 7月, 2007 1 次提交
  29. 10 7月, 2007 1 次提交
  30. 21 5月, 2007 2 次提交