1. 09 2月, 2006 1 次提交
  2. 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
  3. 29 12月, 2005 1 次提交
  4. 24 12月, 2005 1 次提交
  5. 29 11月, 2005 1 次提交
  6. 08 11月, 2005 1 次提交
  7. 07 11月, 2005 1 次提交
  8. 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
  9. 18 10月, 2005 1 次提交
  10. 03 10月, 2005 1 次提交
  11. 25 9月, 2005 1 次提交
  12. 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
  13. 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
  14. 25 8月, 2005 1 次提交
  15. 24 8月, 2005 1 次提交
  16. 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
  17. 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
  18. 30 7月, 2005 2 次提交
  19. 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
  20. 27 5月, 2005 1 次提交
  21. 25 5月, 2005 1 次提交
  22. 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
  23. 20 5月, 2005 1 次提交
  24. 13 5月, 2005 2 次提交
    • J
      [PATCH 3/3] Add git-ls-files -k. · 6ca45943
      Junio C Hamano 提交于
      When checkout-cache attempts to check out a non-directory where
      a directory exists on the work tree, or to check out a file
      under directory D when path D is a non-directory on the work
      tree, the attempt fails.  Before running checkout-cache, the
      user can run git-ls-files with the -k (killed) option to get a
      list of such paths.  The tagged output format uses "K" to denote
      them.  This is useful for Porcelain layer to be careful when
      dealing with the recently corrected behaviour of checkout-cache.
      Signed-off-by: NJunio C Hamano <junkio@cox.net>
      Signed-off-by: NPetr Baudis <pasky@ucw.cz>
      6ca45943
    • J
      [PATCH 2/3] Support symlinks in git-ls-files --others. · a15c1c60
      Junio C Hamano 提交于
      It is kind of surprising that this was missed in the last round,
      but the work tree scanner in git-ls-files was still deliberately
      ignoring symlinks.  This patch fixes it, so that --others will
      correctly report unregistered symlinks.
      Signed-off-by: NJunio C Hamano <junkio@cox.net>
      Signed-off-by: NPetr Baudis <pasky@ucw.cz>
      a15c1c60
  25. 06 5月, 2005 1 次提交
  26. 05 5月, 2005 1 次提交
  27. 01 5月, 2005 3 次提交
  28. 29 4月, 2005 2 次提交
  29. 27 4月, 2005 1 次提交
  30. 22 4月, 2005 1 次提交
    • L
      Add support for a "GIT_INDEX_FILE" environment variable. · bb233d69
      Linus Torvalds 提交于
      We use that to specify alternative index files, which can be useful
      if you want to (for example) generate a temporary index file to do
      some specific operation that you don't want to mess with your main
      one with.
      
      It defaults to the regular ".git/index" if it hasn't been specified.
      bb233d69
  31. 17 4月, 2005 1 次提交
  32. 16 4月, 2005 1 次提交