1. 01 8月, 2006 1 次提交
    • L
      Fix up some fallout from "setup_git_directory()" cleanups · 3e04228b
      Linus Torvalds 提交于
      git-ls-files was broken by the setup_git_directory() calling changes,
      because I had missed the fact that the "prefix" variable in that file was
      static to the whole file, and unlike git-ls-tree (where I had fixed it
      up), it ended up using two different variables with the same name
      depending on what the scoping happened to be.
      
      This fixes it up properly (by just removing the static variable, and
      passing the automatic one around properly), and git-ls-files should work
      again.
      Signed-off-by: NLinus Torvalds <torvalds@osdl.org>
      Signed-off-by: NJunio C Hamano <junkio@cox.net>
      3e04228b
  2. 29 7月, 2006 1 次提交
  3. 24 5月, 2006 1 次提交
  4. 17 5月, 2006 2 次提交
  5. 27 3月, 2006 1 次提交
    • P
      Optionally do not list empty directories in git-ls-files --others · b0a3de42
      Petr Baudis 提交于
      Without the --directory flag, git-ls-files wouldn't ever list directories,
      producing no output for empty directories, which is good since they cannot
      be added and they bear no content, even untracked one (if Git ever starts
      tracking directories on their own, this should obviously change since the
      content notion will change).
      
      With the --directory flag however, git-ls-files would list even empty
      directories. This may be good in some situations but sometimes you want to
      prevent that. This patch adds a --no-empty-directory option which makes
      git-ls-files omit empty directories.
      Signed-off-by: NPetr Baudis <pasky@suse.cz>
      b0a3de42
  6. 19 3月, 2006 1 次提交
  7. 18 3月, 2006 1 次提交
  8. 25 2月, 2006 1 次提交
    • S
      git ls files recursively show ignored files · 1e358405
      Shawn Pearce 提交于
      Make git-ls-files --others --ignored recurse into non-excluded
      subdirectories.
      
      Typically when asking git-ls-files to display all files which are
      ignored by one or more exclude patterns one would want it to recurse
      into subdirectories which are not themselves excluded to see if
      there are any excluded files contained within those subdirectories.
      Signed-off-by: NJunio C Hamano <junkio@cox.net>
      1e358405
  9. 22 2月, 2006 1 次提交
  10. 15 2月, 2006 2 次提交
  11. 12 2月, 2006 1 次提交
  12. 09 2月, 2006 2 次提交
  13. 08 1月, 2006 4 次提交
    • J
      ls-files --others --directory: give trailing slash · 0907fedb
      Junio C Hamano 提交于
      This adds a trailing slash to directory names in the output
      when "--others --directory" option shows only untracked
      directories and not their contents, to make them stand out.
      Signed-off-by: NJunio C Hamano <junkio@cox.net>
      0907fedb
    • J
      ls-files --others --directory: fix a bug with index entry ordering · 657907e7
      Junio C Hamano 提交于
      When both howto-index.sh and howto/make-dist.txt exist under
      Documentation/ directory, dir_exists() mistakenly checked it
      without the trailing slash to see if there was something under
      Documentation/howto directory, and did not realize there was,
      because '-' sorts earlier than '/' and cache_name_pos() finds
      howto-index.sh, which is not under howto/ directory.  This
      caused --others --directory to show it which was incorrect.
      
      Check the directory name with the trailing slash, because having
      an entry that has such as a prefix is what we are looking for.
      Signed-off-by: NJunio C Hamano <junkio@cox.net>
      657907e7
    • L
      ls-files -o: optionally skip showing the contents in "untracked" directories · 9518eb26
      Linus Torvalds 提交于
      Darrin Thompson notes that git-ls-files -o reports all the unknown
      files it finds in a work area.  Subversion and probably other systems
      "simply ignore all the files and directories inside an unknown
      directory and just note the directory as unknown."
      
      With --directory option, ls-files --others shows untracked directories
      without descending into them.
      Signed-off-by: NJunio C Hamano <junkio@cox.net>
      9518eb26
    • J
      [PATCH] Compilation: zero-length array declaration. · 8f1d2e6f
      Junio C Hamano 提交于
      ISO C99 (and GCC 3.x or later) lets you write a flexible array
      at the end of a structure, like this:
      
      	struct frotz {
      		int xyzzy;
      		char nitfol[]; /* more */
      	};
      
      GCC 2.95 and 2.96 let you to do this with "char nitfol[0]";
      unfortunately this is not allowed by ISO C90.
      
      This declares such construct like this:
      
      	struct frotz {
      		int xyzzy;
      		char nitfol[FLEX_ARRAY]; /* more */
      	};
      
      and git-compat-util.h defines FLEX_ARRAY to 0 for gcc 2.95 and
      empty for others.
      
      If you are using a C90 C compiler, you should be able
      to override this with CFLAGS=-DFLEX_ARRAY=1 from the
      command line of "make".
      Signed-off-by: NJunio C Hamano <junkio@cox.net>
      8f1d2e6f
  14. 29 12月, 2005 1 次提交
  15. 24 12月, 2005 1 次提交
  16. 29 11月, 2005 1 次提交
  17. 08 11月, 2005 1 次提交
  18. 07 11月, 2005 1 次提交
  19. 03 11月, 2005 1 次提交
    • A
      remove CR/LF from .gitignore · d317e438
      Alex Riesen 提交于
      For everyone cursed by dos/windows line endings (aka CRLF):
      
      The code reading the .gitignore files (excludes and excludes per
      directory) leaves \r in the patterns, which causes fnmatch to fail for
      no obvious reason. Just remove a "\r" preceding a "\n"
      unconditionally.
      Signed-off-by: NJunio C Hamano <junkio@cox.net>
      d317e438
  20. 18 10月, 2005 1 次提交
  21. 03 10月, 2005 1 次提交
  22. 25 9月, 2005 1 次提交
  23. 21 9月, 2005 1 次提交
    • J
      Show modified files in git-ls-files · b0391890
      Junio C Hamano 提交于
      Add -m/--modified to show files that have been modified wrt. the index.
      
      [jc: The original came from Brian Gerst on Sep 1st but it only checked
      if the paths were cache dirty without actually checking the files were
      modified.  I also added the usage string and a new test.]
      Signed-off-by: NJunio C Hamano <junkio@cox.net>
      b0391890
  24. 30 8月, 2005 1 次提交
    • J
      Revert "Replace zero-length array decls with []." · 2c04662d
      Junio C Hamano 提交于
      This reverts 6c5f9baa commit, whose
      change breaks gcc-2.95.
      
      Not that I ignore portability to compilers that are properly C99, but
      keeping compilation with GCC working is more important, at least for
      now.  We would probably end up declaring with "name[1]" and teach the
      allocator to subtract one if we really aimed for portability, but that
      is left for later rounds.
      Signed-off-by: NJunio C Hamano <junkio@cox.net>
      2c04662d
  25. 25 8月, 2005 1 次提交
  26. 24 8月, 2005 1 次提交
  27. 23 8月, 2005 1 次提交
    • L
      [PATCH] git-ls-files: generalized pathspecs · 56fc5108
      Linus Torvalds 提交于
      This generalizes the git "glob" string to be a lot more like the
      git-diff-* pathspecs (but there are still differences: the diff family
      doesn't do any globbing, and because the diff family always generates the
      full native pathname, it doesn't have the issue with "..").
      
      It does three things:
      
       - it allows multiple matching strings, ie you can do things like
      
      	git-ls-files arch/i386/ include/asm-i386/ | xargs grep pattern
      
       - the "matching" criteria is a combination of "exact path component
         match" (the same as the git-diff-* family), and "fnmatch()". However,
         you should be careful with the confusion between the git-ls-files
         internal globbing and the standard shell globbing, ie
      
      	git-ls-files fs/*.c
      
         does globbing in the shell, and does something totally different from
      
      	git-ls-files 'fs/*.c'
      
         which does the globbing inside git-ls-files.
      
         The latter has _one_ pathspec with a wildcard, and will match any .c
         file anywhere under the fs/ directory, while the former has been
         expanded by the shell into having _lots_ of pathspec entries, all of
         which are just in the top-level fs/ subdirectory. They will happily
         be matched exactly, but we will thus miss all the subdirectories under
         fs/.
      
         As a result, the first one will (on the current kernel) match 55 files,
         while the second one will match 664 files!
      
       - it uses the generic path prefixing, so that ".." and friends at the
         beginning of the path spec work automatically
      
         NOTE! When generating relative pathname output (the default), a
         pathspec that causes the base to be outside the current working
         directory will be rejected with an error message like:
      
      	fatal: git-ls-files: cannot generate relative filenames containing '..'
      
         because we do not actually generate ".." in the output. However, the
         ".." format works fine for the --full-name case:
      
      	cd arch/i386/kernel
      	git-ls-files --full-name ../mm/
      
         results in
      
      	arch/i386/mm/Makefile
      	arch/i386/mm/boot_ioremap.c
      	arch/i386/mm/discontig.c
      	arch/i386/mm/extable.c
      	arch/i386/mm/fault.c
      	arch/i386/mm/highmem.c
      	arch/i386/mm/hugetlbpage.c
      	arch/i386/mm/init.c
      	arch/i386/mm/ioremap.c
      	arch/i386/mm/mmap.c
      	arch/i386/mm/pageattr.c
      	arch/i386/mm/pgtable.c
      
         Perhaps more commonly, the generic path prefixing means that "." and
         "./" automatically get simplified and work properly.
      Signed-off-by: NLinus Torvalds <torvalds@osdl.org>
      Signed-off-by: NJunio C Hamano <junkio@cox.net>
      56fc5108
  28. 22 8月, 2005 1 次提交
    • L
      [PATCH] Make "git-ls-files" work in subdirectories · 5be4efbe
      Linus Torvalds 提交于
      This makes git-ls-files work inside a relative directory, and also adds
      some rudimentary filename globbing support. For example, in the kernel you
      can now do
      
      	cd arch/i386
      	git-ls-files
      
      and it will show all files under that subdirectory (and it will have
      removed the "arch/i386/" prefix unless you give it the "--full-name"
      option, so that you can feed the result to "xargs grep" or similar).
      
      The filename globbing is kind of strange: it does _not_ follow normal
      globbing rules, although it does look "almost" like a normal file glob
      (and it uses the POSIX.2 "fnmatch()" function).
      
      The glob pattern (there can be only one) is always split into a "directory
      part" and a "glob part", where the directory part is defined as any full
      directory path without any '*' or '?' characters. The "glob" part is
      whatever is left over.
      
      For example, when doing
      
      	git-ls-files 'arch/i386/p*/*.c'
      
      the "directory part" is is "arch/i386/", and the "glob part" is "p*/*.c".
      The directory part will be added to the prefix, and handled efficiently
      (ie we will not be searching outside of that subdirectory), while the glob
      part (if anything is left over) will be used to trigger "fnmatch()"
      matches.
      
      This is efficient and very useful, but can result in somewhat
      non-intuitive behaviour.
      
      For example:
      
      	git-ls-files 'arch/i386/*.[ch]'
      
      will find all .c and .h files under arch/i386/, _including_ things in
      lower subdirectories (ie it will match "arch/i386/kernel/process.c",
      because "kernel/process.c" will match the "*.c" specifier).
      
      Also, while
      
      	git-ls-files arch/i386/
      
      will show all files under that subdirectory, doing the same without the
      final slash would try to show the file "i386" under the "arch/"
      subdirectory, and since there is no such file (even if there is such a
      _directory_) it will not match anything at all.
      
      These semantics may not seem intuitive, but they are actually very
      practical. In particular, it makes it very simple to do
      
      	git-ls-files fs/*.c | xargs grep some_pattern
      
      and it does what you want.
      Signed-off-by: NLinus Torvalds <torvalds@osdl.org>
      Signed-off-by: NJunio C Hamano <junkio@cox.net>
      5be4efbe
  29. 30 7月, 2005 2 次提交
  30. 26 7月, 2005 1 次提交
    • J
      git-ls-files: --exclude mechanism updates. · f87f9497
      Junio C Hamano 提交于
      Add --exclude-per-directory=<name> option that specifies a file
      to contain exclude patterns local to that directory and its
      subdirectories.  Update the exclusion logic to be able to say
      "include files that match this more specific pattern, even
      though later exclude patterns may match them".  Also enhances
      that a pattern can contain '/' in which case fnmatch is called
      with FNM_PATHNAME flag to match the entire path. 
      Signed-off-by: NJunio C Hamano <junkio@cox.net>
      f87f9497
  31. 27 5月, 2005 1 次提交
  32. 25 5月, 2005 1 次提交
  33. 21 5月, 2005 1 次提交
    • L
      sparse cleanup · e99d59ff
      Linus Torvalds 提交于
      Fix various things that sparse complains about:
       - use NULL instead of 0
       - make sure we declare everything properly, or mark it static
       - use proper function declarations ("fn(void)" instead of "fn()")
      
      Sparse is always right.
      e99d59ff