1. 02 5月, 2013 9 次提交
  2. 26 4月, 2013 1 次提交
    • J
      prune: introduce OPT_EXPIRY_DATE() and use it · 27ec394a
      Junio C Hamano 提交于
      Earlier we added support for --expire=all (or --expire=now) that
      considers all crufts, regardless of their age, as eligible for
      garbage collection by turning command argument parsers that use
      approxidate() to use parse_expiry_date(), but "git prune" used a
      built-in parse-options facility OPT_DATE() and did not benefit from
      the new function.
      Signed-off-by: NJunio C Hamano <gitster@pobox.com>
      27ec394a
  3. 19 4月, 2013 2 次提交
  4. 18 4月, 2013 1 次提交
    • J
      date.c: add parse_expiry_date() · 3d27b9b0
      Junio C Hamano 提交于
      "git reflog --expire=all" tries to expire reflog entries up to the
      current second, because the approxidate() parser gives the current
      timestamp for anything it does not understand (and it does not know
      what time "all" means).  When the user tells us to expire "all" (or
      set the expiration time to "now"), the user wants to remove all the
      reflog entries (no reflog entry should record future time).
      
      Just set it to ULONG_MAX and to let everything that is older that
      timestamp expire.
      
      While at it, allow "now" to be treated the same way for callers that
      parse expiry date timestamp with this function.  Also use an error
      reporting version of approxidate() to report misspelled date.  When
      the user says e.g. "--expire=mnoday" to delete entries two days or
      older on Wednesday, we wouldn't want the "unknown, default to now"
      logic to kick in.
      Signed-off-by: NJunio C Hamano <gitster@pobox.com>
      3d27b9b0
  5. 13 4月, 2013 2 次提交
  6. 07 4月, 2013 3 次提交
    • J
      Git 1.8.1.6 · 2137ce01
      Junio C Hamano 提交于
      Signed-off-by: NJunio C Hamano <gitster@pobox.com>
      2137ce01
    • J
      Merge branch 'jc/directory-attrs-regression-fix' into maint-1.8.1 · 4bbb830a
      Junio C Hamano 提交于
      A pattern "dir" (without trailing slash) in the attributes file
      stopped matching a directory "dir" by mistake with an earlier change
      that wanted to allow pattern "dir/" to also match.
      
      * jc/directory-attrs-regression-fix:
        t: check that a pattern without trailing slash matches a directory
        dir.c::match_pathname(): pay attention to the length of string parameters
        dir.c::match_pathname(): adjust patternlen when shifting pattern
        dir.c::match_basename(): pay attention to the length of string parameters
        attr.c::path_matches(): special case paths that end with a slash
        attr.c::path_matches(): the basename is part of the pathname
      4bbb830a
    • T
      remote-helpers/test-bzr.sh: do not use "grep '\s'" · 0e9b3272
      Torsten Bögershausen 提交于
      Using grep "devel\s\+3:" to find at least one whitspace is not
      portable on all grep versions; not all grep versions understand "\s"
      as a "whitespace".
      
      Use a literal TAB followed by SPACE.
      
      The + as a qualifier for "one or more" is not a basic regular
      expression; use egrep instead of grep.
      Signed-off-by: NTorsten Bögershausen <tboegi@web.de>
      Signed-off-by: NJunio C Hamano <gitster@pobox.com>
      0e9b3272
  7. 04 4月, 2013 1 次提交
  8. 03 4月, 2013 11 次提交
  9. 29 3月, 2013 5 次提交
    • J
      t: check that a pattern without trailing slash matches a directory · efa5f825
      Jeff King 提交于
      Prior to v1.8.1.1, with:
      
        git init
        echo content >foo &&
        mkdir subdir &&
        echo content >subdir/bar &&
        echo "subdir export-ignore" >.gitattributes
        git add . &&
        git commit -m one &&
        git archive HEAD | tar tf -
      
      the resulting archive would contain only "foo" and ".gitattributes",
      not subdir.  This was broken with a recent change that intended to
      allow "subdir/ export-ignore" to also exclude the directory, but
      instead ended up _requiring_ the trailing slash by mistake.
      
      A pattern "subdir" should match any path "subdir", whether it is a
      directory or a non-directory.  A pattern "subdir/" insists that a
      path "subdir" must be a directory for it to match.
      
      This patch adds test not just for this simple case, but also for
      deeper cross-directory cases, as well as cases with wildcards.
      Signed-off-by: NJeff King <peff@peff.net>
      Signed-off-by: NJunio C Hamano <gitster@pobox.com>
      efa5f825
    • J
      dir.c::match_pathname(): pay attention to the length of string parameters · ab3aebc1
      Jeff King 提交于
      This function takes two counted strings: a <pattern, patternlen> pair
      and a <pathname, pathlen> pair. But we end up feeding the result to
      fnmatch, which expects NUL-terminated strings.
      
      We can fix this by calling the fnmatch_icase_mem function, which
      handles re-allocating into a NUL-terminated string if necessary.
      
      While we're at it, we can avoid even calling fnmatch in some cases. In
      addition to patternlen, we get "prefix", the size of the pattern that
      contains no wildcard characters. We do a straight match of the prefix
      part first, and then use fnmatch to cover the rest. But if there are
      no wildcards in the pattern at all, we do not even need to call
      fnmatch; we would simply be comparing two empty strings.
      Signed-off-by: NJeff King <peff@peff.net>
      Signed-off-by: NJunio C Hamano <gitster@pobox.com>
      ab3aebc1
    • J
      dir.c::match_pathname(): adjust patternlen when shifting pattern · 982ac873
      Jeff King 提交于
      If we receive a pattern that starts with "/", we shift it
      forward to avoid looking at the "/" part. Since the prefix
      and patternlen parameters are counts of what is in the
      pattern, we must decrement them as we increment the pointer.
      
      We remembered to handle prefix, but not patternlen. This
      didn't cause any bugs, though, because the patternlen
      parameter is not actually used. Since it will be used in
      future patches, let's correct this oversight.
      Signed-off-by: NJeff King <peff@peff.net>
      Signed-off-by: NJunio C Hamano <gitster@pobox.com>
      982ac873
    • J
      dir.c::match_basename(): pay attention to the length of string parameters · 0b6e56df
      Junio C Hamano 提交于
      The function takes two counted strings (<basename, basenamelen> and
      <pattern, patternlen>) as parameters, together with prefix (the
      length of the prefix in pattern that is to be matched literally
      without globbing against the basename) and EXC_* flags that tells it
      how to match the pattern against the basename.
      
      However, it did not pay attention to the length of these counted
      strings.  Update them to do the following:
      
       * When the entire pattern is to be matched literally, the pattern
         matches the basename only when the lengths of them are the same,
         and they match up to that length.
      
       * When the pattern is "*" followed by a string to be matched
         literally, make sure that the basenamelen is equal or longer than
         the "literal" part of the pattern, and the tail of the basename
         string matches that literal part.
      
       * Otherwise, use the new fnmatch_icase_mem helper to make
         sure we only lookmake sure we use only look at the
         counted part of the strings.  Because these counted strings are
         full strings most of the time, we check for termination
         to avoid unnecessary allocation.
      Signed-off-by: NJunio C Hamano <gitster@pobox.com>
      Signed-off-by: NJeff King <peff@peff.net>
      Signed-off-by: NJunio C Hamano <gitster@pobox.com>
      0b6e56df
    • J
      attr.c::path_matches(): special case paths that end with a slash · dc09e9ec
      Junio C Hamano 提交于
      The function is given a string that ends with a slash to signal that
      the path is a directory to make sure that a pattern that ends with a
      slash (i.e. MUSTBEDIR) can tell directories and non-directories
      apart.  However, the pattern itself (pat->pattern and
      pat->patternlen) that came from such a MUSTBEDIR pattern is
      represented as a string that ends with a slash, but patternlen does
      not count that trailing slash. A MUSTBEDIR pattern "element/" is
      represented as a counted string <"element/", 7> and this must match
      match pathname "element/".
      
      Because match_basename() and match_pathname() want to see pathname
      "element" to match against the pattern <"element/", 7>, reduce the
      length of the path to exclude the trailing slash when calling
      these functions.
      Signed-off-by: NJunio C Hamano <gitster@pobox.com>
      Signed-off-by: NJeff King <peff@peff.net>
      Signed-off-by: NJunio C Hamano <gitster@pobox.com>
      dc09e9ec
  10. 28 3月, 2013 4 次提交
  11. 27 3月, 2013 1 次提交