1. 12 1月, 2009 1 次提交
  2. 12 11月, 2008 2 次提交
  3. 18 10月, 2008 3 次提交
  4. 15 10月, 2008 1 次提交
  5. 13 10月, 2008 1 次提交
  6. 08 10月, 2008 1 次提交
  7. 25 9月, 2008 1 次提交
  8. 10 9月, 2008 1 次提交
  9. 22 8月, 2008 1 次提交
  10. 20 8月, 2008 1 次提交
  11. 02 8月, 2008 1 次提交
    • J
      make sure parsed wildcard refspec ends with slash · b2a56276
      Junio C Hamano 提交于
      A wildcard refspec is internally parsed into a refspec structure with src
      and dst strings.  Many parts of the code assumed that these do not include
      the trailing "/*" when matching the wildcard pattern with an actual ref we
      see at the remote.  What this meant was that we needed to make sure not
      just that the prefix matched, and also that a slash followed the part that
      matched.
      
      But a codepath that scans the result from ls-remote and finds matching
      refs forgot to check the "matching part must be followed by a slash" rule.
      This resulted in "refs/heads/b1" from the remote side to mistakenly match
      the source side of "refs/heads/b/*:refs/remotes/b/*" refspec.
      
      Worse, the refspec crafted internally by "git-clone", and a hardcoded
      preparsed refspec that is used to implement "git-fetch --tags", violated
      this "parsed widcard refspec does not end with slash" rule; simply adding
      the "matching part must be followed by a slash" rule then would have
      broken codepaths that use these refspecs.
      
      This commit changes the rule to require a trailing slash to parsed
      wildcard refspecs.  IOW, "refs/heads/b/*:refs/remotes/b/*" is parsed as
      src = "refs/heads/b/" and dst = "refs/remotes/b/".  This allows us to
      simplify the matching logic because we only need to do a prefixcmp() to
      notice "refs/heads/b/one" matches and "refs/heads/b1" does not.
      Acked-by: NDaniel Barkalow <barkalow@iabervon.org>
      Signed-off-by: NJunio C Hamano <gitster@pobox.com>
      b2a56276
  12. 28 7月, 2008 1 次提交
    • J
      make sure parsed wildcard refspec ends with slash · 47c6ef1c
      Junio C Hamano 提交于
      A wildcard refspec is internally parsed into a refspec structure with src
      and dst strings.  Many parts of the code assumed that these do not include
      the trailing "/*" when matching the wildcard pattern with an actual ref we
      see at the remote.  What this meant was that we needed to make sure not
      just that the prefix matched, and also that a slash followed the part that
      matched.
      
      But a codepath that scans the result from ls-remote and finds matching
      refs forgot to check the "matching part must be followed by a slash" rule.
      This resulted in "refs/heads/b1" from the remote side to mistakenly match
      the source side of "refs/heads/b/*:refs/remotes/b/*" refspec.
      
      Worse, the refspec crafted internally by "git-clone", and a hardcoded
      preparsed refspec that is used to implement "git-fetch --tags", violated
      this "parsed widcard refspec does not end with slash" rule; simply adding
      the "matching part must be followed by a slash" rule then would have
      broken codepaths that use these refspecs.
      
      This commit changes the rule to require a trailing slash to parsed
      wildcard refspecs.  IOW, "refs/heads/b/*:refs/remotes/b/*" is parsed as
      src = "refs/heads/b/" and dst = "refs/remotes/b/".  This allows us to
      simplify the matching logic because we only need to do a prefixcmp() to
      notice "refs/heads/b/one" matches and "refs/heads/b1" does not.
      Acked-by: NDaniel Barkalow <barkalow@iabervon.org>
      Signed-off-by: NJunio C Hamano <gitster@pobox.com>
      47c6ef1c
  13. 17 7月, 2008 1 次提交
  14. 04 7月, 2008 1 次提交
  15. 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
  16. 19 6月, 2008 1 次提交
    • J
      clean up error conventions of remote.c:match_explicit · 9a7bbd1d
      Jeff King 提交于
      match_explicit is called for each push refspec to try to
      fully resolve the source and destination sides of the
      refspec.  Currently, we look at each refspec and report
      errors on both the source and the dest side before aborting.
      
      It makes sense to report errors for each refspec, since an
      error in one is independent of an error in the other.
      However, reporting errors on the 'dst' side of a refspec if
      there has been an error on the 'src' side does not
      necessarily make sense, since the interpretation of the
      'dst' side depends on the 'src' side (for example, when
      creating a new unqualified remote ref, we use the same type
      as the src ref).
      
      This patch lets match_explicit return early when the src
      side of the refspec is bogus. We still look at all of the
      refspecs before aborting the push, though.
      
      At the same time, we clean up the call signature, which
      previously took an extra "errs" flag. This was pointless, as
      we didn't act on that flag, but rather just passed it back
      to the caller. Instead, we now use the more traditional
      "return -1" to signal an error, and the caller aggregates
      the error count.
      
      This change fixes two bugs, as well:
      
        - the early return avoids a segfault when passing a NULL
          matched_src to guess_ref()
      
        - the check for multiple sources pointing to a single dest
          aborted if the "err" flag was set. Presumably the intent
          was not to bother with the check if we had no
          matched_src. However, since the err flag was passed in
          from the caller, we might abort the check just because a
          previous refspec had a problem, which doesn't make
          sense.
      
          In practice, this didn't matter, since due to the error
          flag we end up aborting the push anyway.
      Signed-off-by: NJeff King <peff@peff.net>
      Signed-off-by: NJunio C Hamano <gitster@pobox.com>
      9a7bbd1d
  17. 15 5月, 2008 1 次提交
  18. 12 5月, 2008 1 次提交
  19. 05 5月, 2008 2 次提交
  20. 27 4月, 2008 1 次提交
  21. 25 4月, 2008 1 次提交
    • J
      push: allow unqualified dest refspecs to DWIM · f8aae120
      Jeff King 提交于
      Previously, a push like:
      
        git push remote src:dst
      
      would go through the following steps:
      
        1. check for an unambiguous 'dst' on the remote; if it
           exists, then push to that ref
        2. otherwise, check if 'dst' begins with 'refs/'; if it
           does, create a new ref
        3. otherwise, complain because we don't know where in the
           refs hierarchy to put 'dst'
      
      However, in some cases, we can guess about the ref type of
      'dst' based on the ref type of 'src'. Specifically, before
      complaining we now check:
      
        2.5. if 'src' resolves to a ref starting with refs/heads
             or refs/tags, then prepend that to 'dst'
      
      So now this creates a new branch on the remote, whereas it
      previously failed with an error message:
      
        git push master:newbranch
      
      Note that, by design, we limit this DWIM behavior only to
      source refs which resolve exactly (including symrefs which
      resolve to existing refs). We still complain on a partial
      destination refspec if the source is a raw sha1, or a ref
      expression such as 'master~10'.
      Signed-off-by: NJeff King <peff@peff.net>
      Signed-off-by: NJunio C Hamano <gitster@pobox.com>
      f8aae120
  22. 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
  23. 19 4月, 2008 1 次提交
  24. 13 4月, 2008 1 次提交
  25. 26 3月, 2008 3 次提交
  26. 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
  27. 19 3月, 2008 1 次提交
  28. 01 3月, 2008 1 次提交
  29. 25 2月, 2008 2 次提交
  30. 23 2月, 2008 1 次提交
    • J
      Avoid unnecessary "if-before-free" tests. · 8e0f7003
      Jim Meyering 提交于
      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:
      
          http://www.winehq.org/pipermail/wine-patches/2006-October/031544.html
      
      FYI, the change below was prepared by running the following:
      
        git ls-files -z | xargs -0 \
        perl -0x3b -pi -e \
          's/\bif\s*\(\s*(\S+?)(?:\s*!=\s*NULL)?\s*\)\s+(free\s*\(\s*\1\s*\))/$2/s'
      
      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);
        else
          foo ();
      
      into this:
      
        free (x);
        else
          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]
      
        http://git.sv.gnu.org/gitweb/?p=gnulib.git;a=blob;f=build-aux/useless-if-before-free
      
      Addendum:
        Remove one more (in imap-send.c), spotted by Jean-Luc Herren <jlh@gmx.ch>.
      Signed-off-by: NJim Meyering <meyering@redhat.com>
      Signed-off-by: NJunio C Hamano <gitster@pobox.com>
      8e0f7003
  31. 21 2月, 2008 1 次提交
    • D
      Resolve value supplied for no-colon push refspecs · 9f0ea7e8
      Daniel Barkalow 提交于
      When pushing a refspec like "HEAD", we used to treat it as
      "HEAD:HEAD", which didn't work without rewriting. Instead, we should
      resolve the ref. If it's a symref, further require it to point to a
      branch, to avoid doing anything especially unexpected. Also remove the
      rewriting previously added in builtin-push.
      
      Since the code for "HEAD" uses the regular refspec parsing, it
      automatically handles "+HEAD" without anything special.
      
      [jc: added a further test to make sure that "remote.*.push = HEAD" works]
      Signed-off-by: NDaniel Barkalow <barkalow@iabervon.org>
      Signed-off-by: NJunio C Hamano <gitster@pobox.com>
      9f0ea7e8
  32. 19 2月, 2008 1 次提交
  33. 16 2月, 2008 1 次提交