1. 20 8月, 2015 2 次提交
  2. 01 8月, 2015 1 次提交
  3. 18 7月, 2015 1 次提交
  4. 21 5月, 2015 1 次提交
  5. 07 5月, 2015 1 次提交
  6. 23 4月, 2015 1 次提交
    • J
      ignore: info/exclude should trump core.excludesfile · 099d2d86
      Junio C Hamano 提交于
      $GIT_DIR/info/exclude and core.excludesfile (which falls back to
      $XDG_HOME/git/ignore) are both ways to override the ignore pattern
      lists given by the project in .gitignore files.  The former, which
      is per-repository personal preference, should take precedence over
      the latter, which is a personal preference default across different
      repositories that are accessed from that machine.  The existing
      documentation also agrees.
      
      However, the precedence order was screwed up between these two from
      the very beginning when 896bdfa2 (add: Support specifying an
      excludes file with a configuration variable, 2007-02-27) introduced
      core.excludesfile variable.
      Noticed-by: NYohei Endo <yoheie@gmail.com>
      Signed-off-by: NJunio C Hamano <gitster@pobox.com>
      099d2d86
  7. 17 4月, 2015 3 次提交
    • J
      utf8-bom: introduce skip_utf8_bom() helper · dde843e7
      Junio C Hamano 提交于
      With the recent change to ignore the UTF8 BOM at the beginning of
      .gitignore files, we now have two codepaths that do such a skipping
      (the other one is for reading the configuration files).
      
      Introduce utf8_bom[] constant string and skip_utf8_bom() helper
      and teach .gitignore code how to use it.
      Signed-off-by: NJunio C Hamano <gitster@pobox.com>
      dde843e7
    • J
      add_excludes_from_file: clarify the bom skipping logic · cb0abea8
      Junio C Hamano 提交于
      Even though the previous step shifts where the "entry" begins, we
      still iterate over the original buf[], which may begin with the
      UTF-8 BOM we are supposed to be skipping.  At the end of the first
      line, the code grabs the contents of it starting at "entry", so
      there is nothing wrong per-se, but the logic looks really confused.
      
      Instead, move the buf pointer and shrink its size, to truly
      pretend that UTF-8 BOM did not exist in the input.
      Signed-off-by: NJunio C Hamano <gitster@pobox.com>
      cb0abea8
    • C
      dir: allow a BOM at the beginning of exclude files · 245e1c19
      Carlos Martín Nieto 提交于
      Some text editors like Notepad or LibreOffice write an UTF-8 BOM in
      order to indicate that the file is Unicode text rather than whatever the
      current locale would indicate.
      
      If someone uses such an editor to edit a gitignore file, we are left
      with those three bytes at the beginning of the file. If we do not skip
      them, we will attempt to match a filename with the BOM as prefix, which
      won't match the files the user is expecting.
      Signed-off-by: NCarlos Martín Nieto <cmn@elego.de>
      Signed-off-by: NJunio C Hamano <gitster@pobox.com>
      245e1c19
  8. 25 3月, 2015 1 次提交
    • J
      report_path_error(): move to dir.c · 777c55a6
      Junio C Hamano 提交于
      The expected call sequence is for the caller to use match_pathspec()
      repeatedly on a set of pathspecs, accumulating the "hits" in a
      separate array, and then call this function to diagnose a pathspec
      that never matched anything, as that can indicate a typo from the
      command line, e.g. "git commit Maekfile".
      
      Many builtin commands use this function from builtin/ls-files.c,
      which is not a very healthy arrangement.  ls-files might have been
      the first command to feel the need for such a helper, but the need
      is shared by everybody who uses the "match and then report" pattern.
      
      Move it to dir.c where match_pathspec() is defined.
      Signed-off-by: NJunio C Hamano <gitster@pobox.com>
      777c55a6
  9. 13 3月, 2015 16 次提交
  10. 22 10月, 2014 1 次提交
  11. 27 8月, 2014 1 次提交
  12. 15 7月, 2014 2 次提交
  13. 21 6月, 2014 1 次提交
    • J
      cleanup duplicate name_compare() functions · ccdd4a0f
      Jeremiah Mahler 提交于
      We often represent our strings as a counted string, i.e. a pair of
      the pointer to the beginning of the string and its length, and the
      string may not be NUL terminated to that length.
      
      To compare a pair of such counted strings, unpack-trees.c and
      read-cache.c implement their own name_compare() functions
      identically.  In addition, the cache_name_compare() function in
      read-cache.c is nearly identical.  The only difference is when one
      string is the prefix of the other string, in which case
      name_compare() returns -1/+1 to show which one is longer, and
      cache_name_compare() returns the difference of the lengths to show
      the same information.
      
      Unify these three functions by using the implementation from
      cache_name_compare().  This does not make any difference to the
      existing and future callers, as they must be paying attention only
      to the sign of the returned value (and not the magnitude) because
      the original implementations of these two functions return values
      returned by memcmp(3) when the one string is not a prefix of the
      other string, and the only thing memcmp(3) guarantees its callers is
      the sign of the returned value, not the magnitude.
      Signed-off-by: NJeremiah Mahler <jmmahler@gmail.com>
      Signed-off-by: NJunio C Hamano <gitster@pobox.com>
      ccdd4a0f
  14. 03 6月, 2014 1 次提交
    • P
      dir.c:trim_trailing_spaces(): fix for " \ " sequence · e61a6c1d
      Pasha Bolokhov 提交于
      Discard the unnecessary 'nr_spaces' variable, remove 'strlen()' and
      improve the 'if' structure.  Switch to pointers instead of integers
      to control the loop.
      
      Slightly more rare occurrences of 'text  \    ' with a backslash
      in between spaces are handled correctly.  Namely, the code in
      7e2e4b37 (dir: ignore trailing spaces in exclude patterns, 2014-02-09)
      does not reset 'last_space' when a backslash is encountered and the above
      line stays intact as a result.
      
      Add a test at the end of t/t0008-ignores.sh to exhibit this behavior.
      Signed-off-by: NPasha Bolokhov <pasha.bolokhov@gmail.com>
      Signed-off-by: NJunio C Hamano <gitster@pobox.com>
      e61a6c1d
  15. 01 4月, 2014 1 次提交
  16. 04 3月, 2014 1 次提交
  17. 25 2月, 2014 4 次提交
  18. 21 2月, 2014 1 次提交