Re: [PATCH] Add git-find-new-files to spot files added to the tree, but not the repository

2005-07-23 Thread Linus Torvalds


On Sat, 23 Jul 2005, Ryan Anderson wrote:

 Add git-find-new-files to find files that are in the tree, but not checked 
 into the repository.
 
 Most users will probably want to make clean before using this for real
 significant changes, as it does such a good job that it finds binaries that
 just got built.

You really want to run file on the files. We almost certainly don't want 
to add binary executables, object files etc etc to the tree, so why even 
show them?

You should also filter the list by the ignore file. And I'd suggest
ignoring dot-files by default, for example (maybe add a -a flag to 
disable that, the same way ls does).

Linus
-
To unsubscribe from this list: send the line unsubscribe git in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Re: [PATCH] Add git-find-new-files to spot files added to the tree, but not the repository

2005-07-23 Thread Linus Torvalds


On Sat, 23 Jul 2005, Linus Torvalds wrote:

 
 
 On Sat, 23 Jul 2005, Ryan Anderson wrote:
 
  Add git-find-new-files to find files that are in the tree, but not checked 
  into the repository.
  
  Most users will probably want to make clean before using this for real
  significant changes, as it does such a good job that it finds binaries that
  just got built.
 
 You really want to run file on the files. We almost certainly don't want 
 to add binary executables, object files etc etc to the tree, so why even 
 show them?
 
 You should also filter the list by the ignore file. And I'd suggest
 ignoring dot-files by default, for example (maybe add a -a flag to 
 disable that, the same way ls does).

Oh, and btw, maybe you didn't realize that git-ls-files --others already 
basically does what your script does? Without any filtering - it was meant 
to be run from a script, so something like

for i in $(git-ls-files --others)
do
if [ ! match_ignore $i ]; then
case $(file -b $i)
ELF*)
;;
*)
echo $i
;;
esac
fi
done

was what I was thinking of.

Linus
-
To unsubscribe from this list: send the line unsubscribe git in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Re: [PATCH] Add git-find-new-files to spot files added to the tree, but not the repository

2005-07-23 Thread Junio C Hamano
Ryan Anderson [EMAIL PROTECTED] writes:

 Add git-find-new-files to find files that are in the tree, but
 not checked into the repository.

You _ought_ to be able to just say:

 $ git-ls-files --others --exclude-from=exclude pattern file

and be done with it.  Also please see the thread about Cogito
and StGIT's use of .gitignore and .git/exclude files.

The current implementation of git-ls-files exclude mechanism
may have rooms for improvements; the last time I checked, it
only did the matching of patterns against filename without
leading directories).  The world will be a better place if
somebody extends it, instead of working around its limitation.

I may be tempted to doing it myself, but I'm in the middle of
something else, so ...

 +#find . -name .git -type d -prune -o -type f -print \
 +#| grep -v -e .tree1 -e .tree2 \
 +#| sed -e s/^\.\/// \
 +#| sort .tree1
 +#git-ls-files | grep -v -e .tree1 -e .tree2 \
 +#| sort .tree2
 +#diff -u .tree1 .tree2

It does not matter since the above is just an example and I
think you should be able to just use ls-files --others, but
just FYI, you could have written comm -23 .tree1 .tree2 above
instead of diff -u.

-
To unsubscribe from this list: send the line unsubscribe git in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html