Received: by 2002:ac0:bc90:0:0:0:0:0 with SMTP id a16csp803319img; Fri, 22 Mar 2019 08:54:31 -0700 (PDT) X-Google-Smtp-Source: APXvYqywHj0A8ovQLhZPhE7+tJVnfoMny81YmzmYpjjmEse9HseB7YT5MR4dH68JvZvPzMKQ9JKo X-Received: by 2002:a62:469a:: with SMTP id o26mr10153595pfi.251.1553270070895; Fri, 22 Mar 2019 08:54:30 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1553270070; cv=none; d=google.com; s=arc-20160816; b=f6NkX5ojmTDaqYC581MZBuK1jtxoYkxUIFAsRmVA8pHjY458hgg0LLsYbD7L62xKEJ DINt2cwokU3Gmc//XPsqAAwgVuE2+Wm/+BfhA8fJmkpXfJgi9QuiMP7RdQk+t0PIctj9 q/nhdgT2QGYr7qGDcN+VLZVpC5SjIryLZOZLKSBnIzVgPXNmuT+vuTCiZ08WVMTo7A46 EAH8hn9r7RyLjSC41J2WUxosJdlCRRrTaHN9UjMf3qFjYOJjyQoDsDQQ29f2HThDPMPF FrAbI52258yw0YbdOZcUVecSVkbA+vMm56feusjkhSEQqwGZHCcT6xfIO+pPM4ef8wir tsZg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:references:in-reply-to:message-id:date :subject:cc:to:from; bh=PlT+O9V8cnytEKQCe94WNQMfp5NhekRXOk9O+mk8kHg=; b=YWFtDxo8CPS8BUNZSnkhEZo3ZLBienfo/Km5hrkJZ3jMfQAMgtJ4yxXGDYsvc1DsRd 1v5KwuFon3yCpl7ZgyDXRBBIuQoi8cpcJ3l4KK2GqVcoI2LZCJpl836pJuDNaIBLkspm Z8DrEeyn8YCrqyDWcikWcXqOhRpyKPpRabvlFoI+Ho4jQK4lzDaKXi6JXeieodUux+9U rv8Nlx4+JbXkxg0O4rw6SGKtUZ5A/VZAUgLs7yQlDTtMOxba7yEeSh76J3r59SFkpvl/ 0SN3hsTk79/u45O33k43b/S+1FY3UnLWBeQPPteotQUeOphuk5ziPLb/Q9uJhD256gSU rz5w== 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 y18si7018650plp.357.2019.03.22.08.54.16; Fri, 22 Mar 2019 08:54:30 -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 S1727651AbfCVPwS (ORCPT + 99 others); Fri, 22 Mar 2019 11:52:18 -0400 Received: from foss.arm.com ([217.140.101.70]:48104 "EHLO foss.arm.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727257AbfCVPwS (ORCPT ); Fri, 22 Mar 2019 11:52:18 -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 C9FD7A78; Fri, 22 Mar 2019 08:52:17 -0700 (PDT) Received: from donnerap.arm.com (donnerap.cambridge.arm.com [10.1.197.44]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPSA id DD60A3F59C; Fri, 22 Mar 2019 08:52:16 -0700 (PDT) From: Andre Przywara To: Vladimir Kondratiev , Masahiro Yamada Cc: linux-kernel@vger.kernel.org Subject: Re: [PATCH v2] kbuild: gitignore output directory Date: Fri, 22 Mar 2019 15:52:12 +0000 Message-Id: <20190322155212.133029-1-andre.przywara@arm.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20190203084840.6113-1-vladimir.kondratiev@intel.com> References: <20190203084840.6113-1-vladimir.kondratiev@intel.com> Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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? 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