From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mga11.intel.com (mga11.intel.com [192.55.52.93]) by dpdk.org (Postfix) with ESMTP id 1884595B4 for ; Mon, 7 Dec 2015 14:32:19 +0100 (CET) Received: from orsmga002.jf.intel.com ([10.7.209.21]) by fmsmga102.fm.intel.com with ESMTP; 07 Dec 2015 05:32:19 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.20,394,1444719600"; d="scan'208";a="866327826" Received: from irvmail001.ir.intel.com ([163.33.26.43]) by orsmga002.jf.intel.com with ESMTP; 07 Dec 2015 05:32:18 -0800 Received: from sivlogin002.ir.intel.com (sivlogin002.ir.intel.com [10.237.217.37]) by irvmail001.ir.intel.com (8.14.3/8.13.6/MailSET/Hub) with ESMTP id tB7DWHkA020727; Mon, 7 Dec 2015 13:32:17 GMT Received: from sivlogin002.ir.intel.com (localhost [127.0.0.1]) by sivlogin002.ir.intel.com with ESMTP id tB7DWHgo000930; Mon, 7 Dec 2015 13:32:17 GMT Received: (from fyigit@localhost) by sivlogin002.ir.intel.com with œ id tB7DWGsU000926; Mon, 7 Dec 2015 13:32:16 GMT X-Authentication-Warning: sivlogin002.ir.intel.com: fyigit set sender to ferruh.yigit@intel.com using -f Date: Mon, 7 Dec 2015 13:32:16 +0000 From: Ferruh Yigit To: Thomas Monjalon Message-ID: <20151207133216.GA11273@sivlogin002.ir.intel.com> Mail-Followup-To: Thomas Monjalon , dev@dpdk.org References: <1446160974-31675-1-git-send-email-ferruh.yigit@intel.com> <1448634897-1193-1-git-send-email-ferruh.yigit@intel.com> <1582860.nH8UZnCz1p@xps13> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <1582860.nH8UZnCz1p@xps13> User-Agent: Mutt/1.5.17 (2007-11-01) Cc: dev@dpdk.org Subject: Re: [dpdk-dev] [PATCH v2] scripts: add git hook scripts for checkpatch and auto doc generation X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: patches and discussions about DPDK List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 07 Dec 2015 13:32:20 -0000 On Thu, Dec 03, 2015 at 11:09:30AM -0800, Thomas Monjalon wrote: > Ferruh, > I have a lot of questions :) > > 2015-11-27 14:34, Ferruh Yigit: > > --- a/scripts/checkpatches.sh > > +++ b/scripts/checkpatches.sh > > @@ -43,6 +43,7 @@ length=${DPDK_CHECKPATCH_LINE_LENGTH:-80} > > > > # override default Linux options > > options="--no-tree" > > +options="$options ${GIT_HOOK_OPTIONS}" > > What is the purpose of this variable? > Why adding some options would be specific to git hooks? > When you use "commit -s", sign-off msg added after this script run, also when you do "commit --ammend" that piece of patch does not have sign-off part, so pre-commit hook can have problems with sign-off check and git hook specific option is to pass --no-signoff option. > > +++ b/scripts/git-hooks/deploy.sh > > @@ -0,0 +1,20 @@ > > + > > +SELF=$(basename $0) > > + > > +if [ ! -f ${SELF} ]; then > > + echo "Please run script from folder where script is" > > + exit 1 > > +fi > > You do not need to exit. Just cd $(dirname $0). > Thanks, I will do that. > > +for f in ${FILES}; do > > + ln -sf ${SCRIPT_FOLDER}/${f} ${TARGET_FOLDER}/${f} > > +done; > > You do not need the ; > OK > > --- /dev/null > > +++ b/scripts/git-hooks/post-commit > > +if [ -n "$RTE_DOC_OUT" ]; then > > + OUT_CMD="O=${RTE_DOC_OUT}" > > +fi > > How to pass RTE_DOC_OUT to the hook? > Why not use load-devel-config.sh? > It is possbile pass by exporting it as environment variable, but since load-devel-config is already there, I will use it. > > +make ${OUT_CMD} doc-guides-html 2>&1 > /dev/null > > +make ${OUT_CMD} doc-api-html 2>&1 > /dev/null > > Why hiding the errors? > To prevent noise, but I double check and enabling error messages not noisy, so I will enable it. > > --- /dev/null > > +++ b/scripts/git-hooks/post-merge > > Does it work for "git pull --rebase"? No, it is not working, for that pre-rebase is required, easy to create a link for that but I am not sure about increasing number of hooks, with pre-rebase hook, an internal rebase too will trigger doc generation, which is not good I believe. > > > --- /dev/null > > +++ b/scripts/git-hooks/pre-commit > > +# If "git commit" called with "--no-verify" option, pre-commit hooks > > +# bypassed and this script not called, checkpatch bypassed > > Possible reword: It is skipped with the option "--no-verify" of "git commit". > OK, thanks. > > +RTE_CHECKPATCH=$PWD/scripts/checkpatches.sh > > What is PWD when calling the hook. May it be a subdir? > Even you call git commands from a subdir, git hooks scripts run from root dir, so this will be always correct. > > +PATCH=/tmp/dpdk-git-auto-checkpatch-$$.patch > > You need to remove this temporary file when exiting. > But it would be better to use stdin. > It may need a patch on checkpatches.sh wrapper. > In chekpatch.pl: "When FILE is - read standard input". > I also prefer using stdin, and previous patch was like that, but checkpatches.sh requires a file, let me check possible update in checkpatches.sh > > +export GIT_HOOK_OPTIONS=--no-signoff > > This variable is wrongly named. > Will rename. > > +git diff --cached > ${PATCH} > > +exec ${RTE_CHECKPATCH} ${PATCH} > > When the new "make install" will be applied, I think we should skip > these files. Please consider patching mk/rte.sdkinstall.mk. ok, I will update skdinstall.mk Thanks for the review. ferruh