1. 14 8月, 2008 1 次提交
  2. 27 4月, 2008 1 次提交
    • L
      Optimize match_pathspec() to avoid fnmatch() · 88ea8112
      Linus Torvalds 提交于
      "git add *" is actually fundamentally different from "git add .", and
      yeah, you should generally use the latter.
      
      The reason? The argument list is actually something different from what
      you think it is. For git, it's a "pathspec", so what actualy happens is
      that in *both* cases, it will really traverse the whole tree, and then
      match every file it finds against the pathspec.
      
      So think of the arguments not as a file list, but as a random bunch of
      patterns to match against the files you have!
      
      Which is why the cost is actually approximately O(n*m), where "n" is the
      size of the working tree, and "m" is the number of pathspecs.
      
      So the reason "git add ." is fast is actually that "m" in that case is
      just 1 (just one trivial pattern), and then "git add *" is slow because
      "m" is large (lots of complicated patterns). In both cases, 'n' is the
      same (== the whole set of files in your working tree).
      
      Anyway, here's a trivial patch that doesn't change this fundamental fact,
      but that avoids doing anything *expensive* until we've done some cheap
      initial tests. It may or may not help your test-case, but it's pretty
      simple and it matches the other git optimizations in this area (ie
      "conceptually handle the general case, but optimize the simple cases where
      we can exit early")
      
      Notice how this patch doesn' actually change the fundamental O(n^2)
      behaviour, but it makes it much cheaper by generally avoiding the
      expensive 'fnmatch' and 'strlen/strncmp' when they are obviously not
      needed.
      Signed-off-by: NLinus Torvalds <torvalds@linux-foundation.org>
      Signed-off-by: NJunio C Hamano <gitster@pobox.com>
      88ea8112
  3. 15 4月, 2008 1 次提交
  4. 09 4月, 2008 2 次提交
  5. 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
  6. 05 2月, 2008 2 次提交
    • J
      gitignore: lazily find dtype · 6831a88a
      Junio C Hamano 提交于
      When we process "foo/" entries in gitignore files on a system
      that does not have d_type member in "struct dirent", the earlier
      implementation ran lstat(2) separately when matching with
      entries that came from the command line, in-tree .gitignore
      files, and $GIT_DIR/info/excludes file.
      
      This optimizes it by delaying the lstat(2) call until it becomes
      absolutely necessary.
      
      The initial idea for this change was by Jeff King, but I
      optimized it further to pass pointers to around.
      Signed-off-by: NJunio C Hamano <gitster@pobox.com>
      6831a88a
    • J
      gitignore(5): Allow "foo/" in ignore list to match directory "foo" · d6b8fc30
      Junio C Hamano 提交于
      A pattern "foo/" in the exclude list did not match directory
      "foo", but a pattern "foo" did.  This attempts to extend the
      exclude mechanism so that it would while not matching a regular
      file or a symbolic link "foo".  In order to differentiate a
      directory and non directory, this passes down the type of path
      being checked to excluded() function.
      
      A downside is that the recursive directory walk may need to run
      lstat(2) more often on systems whose "struct dirent" do not give
      the type of the entry; earlier it did not have to do so for an
      excluded path, but we now need to figure out if a path is a
      directory before deciding to exclude it.  This is especially bad
      because an idea similar to the earlier CE_UPTODATE optimization
      to reduce number of lstat(2) calls would by definition not apply
      to the codepaths involved, as (1) directories will not be
      registered in the index, and (2) excluded paths will not be in
      the index anyway.
      Signed-off-by: NJunio C Hamano <gitster@pobox.com>
      d6b8fc30
  7. 23 1月, 2008 1 次提交
    • L
      Create pathname-based hash-table lookup into index · cf558704
      Linus Torvalds 提交于
      This creates a hash index of every single file added to the index.
      Right now that hash index isn't actually used for much: I implemented a
      "cache_name_exists()" function that uses it to efficiently look up a
      filename in the index without having to do the O(logn) binary search,
      but quite frankly, that's not why this patch is interesting.
      
      No, the whole and only reason to create the hash of the filenames in the
      index is that by modifying the hash function, you can fairly easily do
      things like making it always hash equivalent names into the same bucket.
      
      That, in turn, means that suddenly questions like "does this name exist
      in the index under an _equivalent_ name?" becomes much much cheaper.
      
      Guiding principles behind this patch:
      
       - it shouldn't be too costly. In fact, my primary goal here was to
         actually speed up "git commit" with a fully populated kernel tree, by
         being faster at checking whether a file already existed in the index. I
         did succeed, but only barely:
      
      	Best before:
      		[torvalds@woody linux]$ time git commit > /dev/null
      		real    0m0.255s
      		user    0m0.168s
      		sys     0m0.088s
      
      	Best after:
      
      		[torvalds@woody linux]$ time ~/git/git commit > /dev/null
      		real    0m0.233s
      		user    0m0.144s
      		sys     0m0.088s
      
         so some things are actually faster (~8%).
      
         Caveat: that's really the best case. Other things are invariably going
         to be slightly slower, since we populate that index cache, and quite
         frankly, few things really use it to look things up.
      
         That said, the cost is really quite small. The worst case is probably
         doing a "git ls-files", which will do very little except puopulate the
         index, and never actually looks anything up in it, just lists it.
      
      	Before:
      		[torvalds@woody linux]$ time git ls-files > /dev/null
      		real    0m0.016s
      		user    0m0.016s
      		sys     0m0.000s
      
      	After:
      		[torvalds@woody linux]$ time ~/git/git ls-files > /dev/null
      		real    0m0.021s
      		user    0m0.012s
      		sys     0m0.008s
      
         and while the thing has really gotten relatively much slower, we're
         still talking about something almost unmeasurable (eg 5ms). And that
         really should be pretty much the worst case.
      
         So we lose 5ms on one "benchmark", but win 22ms on another. Pick your
         poison - this patch has the advantage that it will _likely_ speed up
         the cases that are complex and expensive more than it slows down the
         cases that are already so fast that nobody cares. But if you look at
         relative speedups/slowdowns, it doesn't look so good.
      
       - It should be simple and clean
      
         The code may be a bit subtle (the reasons I do hash removal the way I
         do etc), but it re-uses the existing hash.c files, so it really is
         fairly small and straightforward apart from a few odd details.
      
      Now, this patch on its own doesn't really do much, but I think it's worth
      looking at, if only because if done correctly, the name hashing really can
      make an improvement to the whole issue of "do we have a filename that
      looks like this in the index already". And at least it gets real testing
      by being used even by default (ie there is a real use-case for it even
      without any insane filesystems).
      
      NOTE NOTE NOTE! The current hash is a joke. I'm ashamed of it, I'm just
      not ashamed of it enough to really care. I took all the numbers out of my
      nether regions - I'm sure it's good enough that it works in practice, but
      the whole point was that you can make a really much fancier hash that
      hashes characters not directly, but by their upper-case value or something
      like that, and thus you get a case-insensitive hash, while still keeping
      the name and the index itself totally case sensitive.
      Signed-off-by: NLinus Torvalds <torvalds@linux-foundation.org>
      Signed-off-by: NJunio C Hamano <gitster@pobox.com>
      cf558704
  8. 22 1月, 2008 1 次提交
    • L
      Make on-disk index representation separate from in-core one · 7a51ed66
      Linus Torvalds 提交于
      This converts the index explicitly on read and write to its on-disk
      format, allowing the in-core format to contain more flags, and be
      simpler.
      
      In particular, the in-core format is now host-endian (as opposed to the
      on-disk one that is network endian in order to be able to be shared
      across machines) and as a result we can dispense with all the
      htonl/ntohl on accesses to the cache_entry fields.
      
      This will make it easier to make use of various temporary flags that do
      not exist in the on-disk format.
      Signed-off-by: NLinus Torvalds <torvalds@linux-foundation.org>
      7a51ed66
  9. 17 12月, 2007 1 次提交
  10. 29 11月, 2007 2 次提交
    • J
      per-directory-exclude: lazily read .gitignore files · 63d285c8
      Junio C Hamano 提交于
      Operations that walk directories or trees, which potentially need to
      consult the .gitignore files, used to always try to open the .gitignore
      file every time they entered a new directory, even when they ended up
      not needing to call excluded() function to see if a path in the
      directory is ignored.  This was done by push/pop exclude_per_directory()
      functions that managed the data in a stack.
      
      This changes the directory walking API to remove the need to call these
      two functions.  Instead, the directory walk data structure caches the
      data used by excluded() function the last time, and lazily reuses it as
      much as possible.  Among the data the last check used, the ones from
      deeper directories that the path we are checking is outside are
      discarded, data from the common leading directories are reused, and then
      the directories between the common directory and the directory the path
      being checked is in are checked for .gitignore file.  This is very
      similar to the way gitattributes are handled.
      
      This API change also fixes "ls-files -c -i", which called excluded()
      without setting up the gitignore data via the old push/pop functions.
      Signed-off-by: NJunio C Hamano <gitster@pobox.com>
      63d285c8
    • J
      dir.c: minor clean-up · 686a4a06
      Junio C Hamano 提交于
      Replace handcrafted reallocation with ALLOC_GROW().
      Reindent "file_exists()" helper function.
      Signed-off-by: NJunio C Hamano <gitster@pobox.com>
      686a4a06
  11. 23 11月, 2007 1 次提交
  12. 17 11月, 2007 2 次提交
    • J
      Fix per-directory exclude handing for "git add" · 0e06cc8b
      Junio C Hamano 提交于
      In "dir_struct", each exclusion element in the exclusion stack records a
      base string (pointer to the beginning with length) so that we can tell
      where it came from, but this pointer is just pointing at the parameter
      that is given by the caller to the push_exclude_per_directory()
      function.
      
      While read_directory_recursive() runs, calls to excluded() makes use
      the data in the exclusion elements, including this base string.  The
      caller of read_directory_recursive() is not supposed to free the
      buffer it gave to push_exclude_per_directory() earlier, until it
      returns.
      
      The test case Bruce Stephens gave in the mailing list discussion
      was simplified and added to the t3700 test.
      Signed-off-by: NJunio C Hamano <gitster@pobox.com>
      0e06cc8b
    • J
      core.excludesfile clean-up · dcf0c16e
      Junio C Hamano 提交于
      There are inconsistencies in the way commands currently handle
      the core.excludesfile configuration variable.  The problem is
      the variable is too new to be noticed by anything other than
      git-add and git-status.
      
       * git-ls-files does not notice any of the "ignore" files by
         default, as it predates the standardized set of ignore files.
         The calling scripts established the convention to use
         .git/info/exclude, .gitignore, and later core.excludesfile.
      
       * git-add and git-status know about it because they call
         add_excludes_from_file() directly with their own notion of
         which standard set of ignore files to use.  This is just a
         stupid duplication of code that need to be updated every time
         the definition of the standard set of ignore files is
         changed.
      
       * git-read-tree takes --exclude-per-directory=<gitignore>,
         not because the flexibility was needed.  Again, this was
         because the option predates the standardization of the ignore
         files.
      
       * git-merge-recursive uses hardcoded per-directory .gitignore
         and nothing else.  git-clean (scripted version) does not
         honor core.* because its call to underlying ls-files does not
         know about it.  git-clean in C (parked in 'pu') doesn't either.
      
      We probably could change git-ls-files to use the standard set
      when no excludes are specified on the command line and ignore
      processing was asked, or something like that, but that will be a
      change in semantics and might break people's scripts in a subtle
      way.  I am somewhat reluctant to make such a change.
      
      On the other hand, I think it makes perfect sense to fix
      git-read-tree, git-merge-recursive and git-clean to follow the
      same rule as other commands.  I do not think of a valid use case
      to give an exclude-per-directory that is nonstandard to
      read-tree command, outside a "negative" test in the t1004 test
      script.
      
      This patch is the first step to untangle this mess.
      
      The next step would be to teach read-tree, merge-recursive and
      clean (in C) to use setup_standard_excludes().
      Signed-off-by: NJunio C Hamano <gitster@pobox.com>
      dcf0c16e
  13. 16 11月, 2007 1 次提交
    • J
      Fix per-directory exclude handing for "git add" · 41a7aa58
      Junio C Hamano 提交于
      In "dir_struct", each exclusion element in the exclusion stack records a
      base string (pointer to the beginning with length) so that we can tell
      where it came from, but this pointer is just pointing at the parameter
      that is given by the caller to the push_exclude_per_directory()
      function.
      
      While read_directory_recursive() runs, calls to excluded() makes use
      the data in the exclusion elements, including this base string.  The
      caller of read_directory_recursive() is not supposed to free the
      buffer it gave to push_exclude_per_directory() earlier, until it
      returns.
      
      The test case Bruce Stephens gave in the mailing list discussion
      was simplified and added to the t3700 test.
      Signed-off-by: NJunio C Hamano <gitster@pobox.com>
      41a7aa58
  14. 15 11月, 2007 1 次提交
    • J
      core.excludesfile clean-up · 039bc64e
      Junio C Hamano 提交于
      There are inconsistencies in the way commands currently handle
      the core.excludesfile configuration variable.  The problem is
      the variable is too new to be noticed by anything other than
      git-add and git-status.
      
       * git-ls-files does not notice any of the "ignore" files by
         default, as it predates the standardized set of ignore files.
         The calling scripts established the convention to use
         .git/info/exclude, .gitignore, and later core.excludesfile.
      
       * git-add and git-status know about it because they call
         add_excludes_from_file() directly with their own notion of
         which standard set of ignore files to use.  This is just a
         stupid duplication of code that need to be updated every time
         the definition of the standard set of ignore files is
         changed.
      
       * git-read-tree takes --exclude-per-directory=<gitignore>,
         not because the flexibility was needed.  Again, this was
         because the option predates the standardization of the ignore
         files.
      
       * git-merge-recursive uses hardcoded per-directory .gitignore
         and nothing else.  git-clean (scripted version) does not
         honor core.* because its call to underlying ls-files does not
         know about it.  git-clean in C (parked in 'pu') doesn't either.
      
      We probably could change git-ls-files to use the standard set
      when no excludes are specified on the command line and ignore
      processing was asked, or something like that, but that will be a
      change in semantics and might break people's scripts in a subtle
      way.  I am somewhat reluctant to make such a change.
      
      On the other hand, I think it makes perfect sense to fix
      git-read-tree, git-merge-recursive and git-clean to follow the
      same rule as other commands.  I do not think of a valid use case
      to give an exclude-per-directory that is nonstandard to
      read-tree command, outside a "negative" test in the t1004 test
      script.
      
      This patch is the first step to untangle this mess.
      
      The next step would be to teach read-tree, merge-recursive and
      clean (in C) to use setup_standard_excludes().
      Signed-off-by: NJunio C Hamano <gitster@pobox.com>
      039bc64e
  15. 09 11月, 2007 1 次提交
  16. 30 10月, 2007 1 次提交
    • L
      Speedup scanning for excluded files. · 68492fc7
      Lars Knoll 提交于
      Try to avoid a lot of work scanning for excluded files,
      by caching some more information when setting up the exclusion
      data structure.
      
      Speeds up 'git runstatus' on a repository containing the Qt sources by 30% and
      reduces the amount of instructions executed (as measured by valgrind) by a
      factor of 2.
      Signed-off-by: NJunio C Hamano <gitster@pobox.com>
      68492fc7
  17. 21 10月, 2007 1 次提交
    • L
      Fix directory scanner to correctly ignore files without d_type · 07134421
      Linus Torvalds 提交于
      On Fri, 19 Oct 2007, Todd T. Fries wrote:
      > If DT_UNKNOWN exists, then we have to do a stat() of some form to
      > find out the right type.
      
      That happened in the case of a pathname that was ignored, and we did
      not ask for "dir->show_ignored". That test used to be *together*
      with the "DTYPE(de) != DT_DIR", but splitting the two tests up
      means that we can do that (common) test before we even bother to
      calculate the real dtype.
      
      Of course, that optimization only matters for systems that don't
      have, or don't fill in DTYPE properly.
      
      I also clarified the real relationship between "exclude" and
      "dir->show_ignored". It used to do
      
      	if (exclude != dir->show_ignored) {
      		..
      
      which wasn't exactly obvious, because it triggers for two different
      cases:
      
       - the path is marked excluded, but we are not interested in ignored
         files: ignore it
      
       - the path is *not* excluded, but we *are* interested in ignored
         files: ignore it unless it's a directory, in which case we might
         have ignored files inside the directory and need to recurse
         into it).
      
      so this splits them into those two cases, since the first case
      doesn't even care about the type.
      
      I also made a the DT_UNKNOWN case a separate helper function,
      and added some commentary to the cases.
      
      		Linus
      Signed-off-by: NShawn O. Pearce <spearce@spearce.org>
      07134421
  18. 30 9月, 2007 1 次提交
  19. 02 8月, 2007 1 次提交
  20. 01 8月, 2007 1 次提交
  21. 17 6月, 2007 1 次提交
  22. 13 6月, 2007 3 次提交
    • J
      builtin-add: simplify (and increase accuracy of) exclude handling · e96980ef
      Jeff King 提交于
      Previously, the code would always set up the excludes, and then manually
      pick through the pathspec we were given, assuming that non-added but
      existing paths were just ignored. This was mostly correct, but would
      erroneously mark a totally empty directory as 'ignored'.
      
      Instead, we now use the collect_ignored option of dir_struct, which
      unambiguously tells us whether a path was ignored. This simplifies the
      code, and means empty directories are now just not mentioned at all.
      
      Furthermore, we now conditionally ask dir_struct to respect excludes,
      depending on whether the '-f' flag has been set. This means we don't have
      to pick through the result, checking for an 'ignored' flag; ignored entries
      were either added or not in the first place.
      
      We can safely get rid of the special 'ignored' flags to dir_entry, which
      were not used anywhere else.
      Signed-off-by: NJeff King <peff@peff.net>
      Signed-off-by: NJonas Fonseca <fonseca@diku.dk>
      Signed-off-by: NJunio C Hamano <gitster@pobox.com>
      e96980ef
    • J
      dir_struct: add collect_ignored option · 2abd31b0
      Jeff King 提交于
      When set, this option will cause read_directory to keep
      track of which entries were ignored. While this shouldn't
      effect functionality in most cases, it can make warning
      messages to the user much more useful.
      Signed-off-by: NJeff King <peff@peff.net>
      Signed-off-by: NJunio C Hamano <gitster@pobox.com>
      2abd31b0
    • J
      refactor dir_add_name · 6815e569
      Jeff King 提交于
      This is in preparation for keeping two entry lists in the
      dir object.
      
      This patch adds and uses the ALLOC_GROW() macro, which
      implements the commonly used idiom of growing a dynamic
      array using the alloc_nr function (not just in dir.c, but
      everywhere).
      
      We also move creation of a dir_entry to dir_entry_new.
      Signed-off-by: NJeff King <peff@peff.net>
      Signed-off-by: NJunio C Hamano <gitster@pobox.com>
      6815e569
  23. 22 5月, 2007 1 次提交
  24. 08 5月, 2007 1 次提交
  25. 23 4月, 2007 1 次提交
    • J
      dir.c(common_prefix): Fix two bugs · c7f34c18
      Johannes Schindelin 提交于
      The function common_prefix() is used to find the common subdirectory of
      a couple of pathnames. When checking if the next pathname matches up with
      the prefix, it incorrectly checked the whole path, not just the prefix
      (including the slash). Thus, the expensive part of the loop was executed
      always.
      
      The other bug is more serious: if the first and the last pathname in the
      list have a longer common prefix than the common prefix for _all_ pathnames
      in the list, the longer one would be chosen. This bug was probably hidden
      by the fact that bash's wildcard expansion sorts the results, and the code
      just so happens to work with sorted input.
      Signed-off-by: NJohannes Schindelin <johannes.schindelin@gmx.de>
      Signed-off-by: NJunio C Hamano <junkio@cox.net>
      c7f34c18
  26. 13 4月, 2007 1 次提交
  27. 12 4月, 2007 1 次提交
    • L
      Teach directory traversal about subprojects · 09595258
      Linus Torvalds 提交于
      This is the promised cleaned-up version of teaching directory traversal
      (ie the "read_directory()" logic) about subprojects. That makes "git add"
      understand to add/update subprojects.
      
      It now knows to look at the index file to see if a directory is marked as
      a subproject, and use that as information as whether it should be recursed
      into or not.
      
      It also generally cleans up the handling of directory entries when
      traversing the working tree, by splitting up the decision-making process
      into small functions of their own, and adding a fair number of comments.
      
      Finally, it teaches "add_file_to_cache()" that directory names can have
      slashes at the end, since the directory traversal adds them to make the
      difference between a file and a directory clear (it always did that, but
      my previous too-ugly-to-apply subproject patch had a totally different
      path for subproject directories and avoided the slash for that case).
      Signed-off-by: NLinus Torvalds <torvalds@linux-foundation.org>
      Signed-off-by: NJunio C Hamano <junkio@cox.net>
      09595258
  28. 10 4月, 2007 1 次提交
  29. 01 4月, 2007 1 次提交
    • L
      Optimize directory listing with pathspec limiter. · 9fc42d60
      Linus Torvalds 提交于
      The way things are set up, you can now pass a "pathspec" to the
      "read_directory()" function. If you pass NULL, it acts exactly
      like it used to do (read everything). If you pass a non-NULL
      pointer, it will simplify it into a "these are the prefixes
      without any special characters", and stop any readdir() early if
      the path in question doesn't match any of the prefixes.
      
      NOTE! This does *not* obviate the need for the caller to do the *exact*
      pathspec match later. It's a first-level filter on "read_directory()", but
      it does not do the full pathspec thing. Maybe it should. But in the
      meantime, builtin-add.c really does need to do first
      
      	read_directory(dir, .., pathspec);
      	if (pathspec)
      		prune_directory(dir, pathspec, baselen);
      
      ie the "prune_directory()" part will do the *exact* pathspec pruning,
      while the "read_directory()" will use the pathspec just to do some quick
      high-level pruning of the directories it will recurse into.
      Signed-off-by: NLinus Torvalds <torvalds@linux-foundation.org>
      Signed-off-by: NJunio C Hamano <junkio@cox.net>
      9fc42d60
  30. 08 3月, 2007 1 次提交
    • S
      Cast 64 bit off_t to 32 bit size_t · dc49cd76
      Shawn O. Pearce 提交于
      Some systems have sizeof(off_t) == 8 while sizeof(size_t) == 4.
      This implies that we are able to access and work on files whose
      maximum length is around 2^63-1 bytes, but we can only malloc or
      mmap somewhat less than 2^32-1 bytes of memory.
      
      On such a system an implicit conversion of off_t to size_t can cause
      the size_t to wrap, resulting in unexpected and exciting behavior.
      Right now we are working around all gcc warnings generated by the
      -Wshorten-64-to-32 option by passing the off_t through xsize_t().
      
      In the future we should make xsize_t on such problematic platforms
      detect the wrapping and die if such a file is accessed.
      Signed-off-by: NShawn O. Pearce <spearce@spearce.org>
      Signed-off-by: NJunio C Hamano <junkio@cox.net>
      dc49cd76
  31. 09 1月, 2007 1 次提交
  32. 30 12月, 2006 2 次提交
    • J
      Fix 'git add' with .gitignore · 4d06f8ac
      Junio C Hamano 提交于
      When '*.ig' is ignored, and you have two files f.ig and d.ig/foo
      in the working tree,
      
      	$ git add .
      
      correctly ignored f.ig but failed to ignore d.ig/foo.  This was
      caused by a thinko in an earlier commit 4888c534, when we tried
      to allow adding otherwise ignored files.
      
      After reverting that commit, this takes a much simpler approach.
      When we have an unmatched pathspec that talks about an existing
      pathname, we know it is an ignored path the user tried to add,
      so we include it in the set of paths directory walker returned.
      
      This does not let you say "git add -f D" on an ignored directory
      D and add everything under D.  People can submit a patch to
      further allow it if they want to, but I think it is a saner
      behaviour to require explicit paths to be spelled out in such a
      case.
      Signed-off-by: NJunio C Hamano <junkio@cox.net>
      4d06f8ac
    • J
      Revert "read_directory: show_both option." · c889763b
      Junio C Hamano 提交于
      This reverts commit 4888c534.
      c889763b
  33. 25 12月, 2006 1 次提交