Received: by 2002:ac0:bc90:0:0:0:0:0 with SMTP id a16csp3098374img; Mon, 25 Mar 2019 03:50:18 -0700 (PDT) X-Google-Smtp-Source: APXvYqz3BNv9XjIOyexvS1+rziIueBdLtJCLtapx9/mmqC2pbJJ1K2wYt4GTVr22xZxCEb7YRJFk X-Received: by 2002:a17:902:8644:: with SMTP id y4mr23632589plt.99.1553511018705; Mon, 25 Mar 2019 03:50:18 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1553511018; cv=none; d=google.com; s=arc-20160816; b=HD7sYlW4m812kbCuqkvpkH4PQSQ/Q30JjfSV/ODZkLiOskAboCwNetKytkem8NWkOz 0It7Xil4zHy6TjYsygzpo4Tx2KhMIhQOTCauZn/51r4bcd4uP1q4qhVAd+bFampKZgFl gI+4rpYqbaxD+/7QCgkUjTqddQrLy0b2OIithEj2mWIKX89qZ2jE/yitRYgDEte+SUvl LZO2vifJh4GEsBOKzseDce697LRvXLvQSsAb3jPZseioFvHCBjI4Ot2LET95V6VGWF0U k7YjpCYh0BpqmtqsnZl3G6QUlf1pq3ovQb98/nHOoS4F+Wb/tvNRP/WJIXdqQjz8PNqx avvw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :organization:references:in-reply-to:message-id:subject:cc:to:from :date; bh=D+1Bk/OFrazZyEhGc6VCaqobaLuYrsLbsEE1BDuMHgA=; b=CGIGh9x6UndBtDh+2TmQAgDiQBe7NloT1NPRoPa4NtjuwNS//vMTOOdFiZoAwZkGLq O9PHbdZdd5B0LFehES6uU88T/nIZHLVnu0jOG55FyTCIZuengqvjimyy8n5wsXV+T81S ESMGCB6kFHEU4t+R8uGOBuqrKdAFlcqymaZbMRQfu/6vsnff9mCwUDk67LmrPqz5azSn w431OCarpEGlb+DFc3tceyO2sRsAVOJjeVh5jSxvbfoDwwYyXl3JQUz/8NLjc7ZNIgJA m9yOuZTi8ZFAxg1Ei2JUNUgigF5kSEC5QlhDi3byy+SPDQIUEpwMhY2U2Vmn42n1Q+Cy obMQ== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id z9si2338126pln.65.2019.03.25.03.50.03; Mon, 25 Mar 2019 03:50:18 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1730904AbfCYKsF (ORCPT + 99 others); Mon, 25 Mar 2019 06:48:05 -0400 Received: from usa-sjc-mx-foss1.foss.arm.com ([217.140.101.70]:45246 "EHLO foss.arm.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1730895AbfCYKsE (ORCPT ); Mon, 25 Mar 2019 06:48:04 -0400 Received: from usa-sjc-imap-foss1.foss.arm.com (unknown [10.72.51.249]) by usa-sjc-mx-foss1.foss.arm.com (Postfix) with ESMTP id D69191596; Mon, 25 Mar 2019 03:48:03 -0700 (PDT) Received: from donnerap.cambridge.arm.com (usa-sjc-imap-foss1.foss.arm.com [10.72.51.249]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPSA id 181E43F575; Mon, 25 Mar 2019 03:48:02 -0700 (PDT) Date: Mon, 25 Mar 2019 10:47:59 +0000 From: Andre Przywara To: Masahiro Yamada Cc: Vladimir Kondratiev , Linux Kernel Mailing List Subject: Re: [PATCH v2] kbuild: gitignore output directory Message-ID: <20190325104759.079a18ec@donnerap.cambridge.arm.com> In-Reply-To: References: <20190203084840.6113-1-vladimir.kondratiev@intel.com> <20190322155212.133029-1-andre.przywara@arm.com> Organization: ARM X-Mailer: Claws Mail 3.17.3 (GTK+ 2.24.32; aarch64-unknown-linux-gnu) MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Sun, 24 Mar 2019 11:22:11 +0900 Masahiro Yamada wrote: Hi Masahiro, > On Sat, Mar 23, 2019 at 12:53 AM Andre Przywara wrote: > > > > Hi, > > > > > When compiling into output directory using O=, many files > > > created under KBUILD_OUTPUT that git considers > > > as new ones; git clients, ex. "git gui" lists it, and it clutters > > > file list making it difficult to see what was really changed > > > > > > Generate .gitignore in output directory that ignores all > > > its content > > > > just found this when testing -rc1. > > Unfortunately this breaks my setup, because I keep a totally separate > > git repository in my build directories to track (various versions of) > > .config. So .gitignore there is carefully crafted to ignore most build > > artefacts, but not .config, for instance. > > > > I am not sure how git would interact with the build directory for you? > > Do you build into a subdirectory of the kernel tree? > > > > I was hoping that we would not overwrite unrelated files in directories > > outside of the kernel tree. In case this is about a subdirectory of the > > source tree, can we somehow check for this case? > > > I am not sure if it is worthwhile > adjusting the upstream kernel to > the workflow of an individual like this. I would argue that we should not overwrite files in the build directory which are unrelated to the actual kernel *build*. Another point is that one could easily add the build (sub-)directory to .git/info/exclude to make git ignore it, without touching any git monitored file at all. But I couldn't find an easy way to keep my .gitignore file in place. > If it is, we could like this: > > outputmakefile: > ifneq ($(KBUILD_SRC),) > $(Q)ln -fsn $(srctree) source > $(Q)$(CONFIG_SHELL) $(srctree)/scripts/mkmakefile $(srctree) > $(Q)test -e .gitignore || \ > { echo "# this is build directory, ignore it"; echo "*"; } > .gitignore Thanks, that looks good and fixes it for me! Cheers, Andre. > endif > > > > Cheers, > > Andre. > > > > > > > > Signed-off-by: Vladimir Kondratiev > > > Signed-off-by: Masahiro Yamada > > > --- > > > Makefile | 3 +++ > > > 1 file changed, 3 insertions(+) > > > > > > diff --git a/Makefile b/Makefile > > > index 97ee0be24d52..d487fca342c4 100644 > > > --- a/Makefile > > > +++ b/Makefile > > > @@ -483,10 +483,13 @@ PHONY += outputmakefile > > > # outputmakefile generates a Makefile in the output directory, if using a > > > # separate output directory. This allows convenient use of make in the > > > # output directory. > > > +# At the same time when output Makefile generated, generate .gitignore to > > > +# ignore whole output directory > > > outputmakefile: > > > ifneq ($(KBUILD_SRC),) > > > $(Q)ln -fsn $(srctree) source > > > $(Q)$(CONFIG_SHELL) $(srctree)/scripts/mkmakefile $(srctree) > > > + $(Q){ echo "# this is build directory, ignore it"; echo "*"; } > .gitignore > > > endif > > > > > > ifneq ($(shell $(CC) --version 2>&1 | head -n 1 | grep clang),) > > > -- > > > 2.17.1 > > > >