threads / discuss / 1320

(unknown)

Subject: (unknown)

## tl;dr

One message between Jul 23, 2005 and Jul 23, 2005.

replies: 0people: 1as markdown or json

Junio Hamano· Jul 23, 2005, 09:10 UTC · lore
>From nobody Sat Jul 23 02:08:27 2005
To: Ryan Anderson <ryan@michonline.com>
Cc: git@vger.kernel.org
Subject: Re: [PATCH] Add git-find-new-files to spot files added to the tree,
 but not the repository
Bcc: junkio@cox.net
References: <20050723074219.GB3255@mythryan2.michonline.com>
From: Junio C Hamano <junio@twinsun.com>
Date: Sat, 23 Jul 2005 02:10:51 -0700
User-Agent: Gnus/5.1007 (Gnus v5.10.7) Emacs/21.4 (gnu/linux)
MIME-Version: 1.0
Content-Type: text/plain; charset=us-ascii
Ryan Anderson <ryan@michonline.com> 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 ...

Show 7 quoted lines
> +#	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".

← back to recent threads