Re: [PATCH] Add git-find-new-files to spot files added to the tree, but not the repository
- From
Linus Torvalds <torvalds@osdl.org>
- Date
- Jul 23, 2005, 17:48 UTC
- Message-ID
- <Pine.LNX.4.58.0507231043330.6074@g5.osdl.org>
- In-Reply-To
- <Pine.LNX.4.58.0507231039290.6074@g5.osdl.org>
On Sat, 23 Jul 2005, Linus Torvalds wrote:
Show 17 quoted lines
> > > 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