From: Jean-Christophe PLAGNIOL-VILLARD Date: Thu, 16 Oct 2008 23:10:10 +0200 Subject: [U-Boot] [PATCH 1/1] add tool to check patch and file for CFG_ presence In-Reply-To: <20081016201818.1FF1C85EE174@gemini.denx.de> References: <20081016192014.31CA585EE1F3@gemini.denx.de> <1224184956-2864-1-git-send-email-plagnioj@jcrosoft.com> <20081016201818.1FF1C85EE174@gemini.denx.de> Message-ID: <20081016211010.GA2807@game.jcrosoft.org> List-Id: MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit To: u-boot@lists.denx.de On 22:18 Thu 16 Oct , Wolfgang Denk wrote: > Dear Jean-Christophe PLAGNIOL-VILLARD, > > In message <1224184956-2864-1-git-send-email-plagnioj@jcrosoft.com> you wrote: > > > > +find_config_errors: > > + @echo "Search for config errors" > > + @git-grep CFG_ | cut -d: -f1 | sort -u | xargs -I {} tools/find_config_errors -f {} > > + > > Hm... should we not just use "grep -r *" so this will also work when > we don't have a full git repository? > > And instead of running another process with "cut", a "-l" argument to > grep (or even git-grep) would do the same? [Also note that "git-grep" > is deprecated, "git grep" should be used instead.] > > I think we should change this into: > > grep -l -r * | xargs tools/find_config_errors -f It will not work with symlinks when you do not have a git repository you will check compile code, non use file patch maybe etc... and not ignoring files specified in the differents gitignore. I'll prefer to only activate it when we have a git reprository otherwise the user will use find_config_errors to check it's patch before send it as done with checkpatch.pl. so I'll propose instead find_config_errors: @echo "Search for config errors" @# Check for git and a git repo. @if head=`git rev-parse --verify HEAD 2>/dev/null`; then \ git grep -l CFG_ | sort -u | xargs -I {} tools/find_config_errors -f {} ;\ fi Best Regards, J.