Received: by 2002:ac0:bc90:0:0:0:0:0 with SMTP id a16csp2000945img; Sat, 23 Mar 2019 19:30:07 -0700 (PDT) X-Google-Smtp-Source: APXvYqzGk48u4cF7TRTqJHPGK0XNHXx563V6W2bQ9XXmA8mizvJllyv7J9Ag9i2ivfJLMr32FlyN X-Received: by 2002:a62:29c5:: with SMTP id p188mr16712120pfp.203.1553394607328; Sat, 23 Mar 2019 19:30:07 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1553394607; cv=none; d=google.com; s=arc-20160816; b=TYE8we6FDhv1L37kv+THXH7hRJYbIlNz3iieiHGd38KXzbZOFrWu8n2sX5YAZYt7wi k1LIjlarvJyUbugDuxqQrOItGoV9BCIZsfuSGDF6nth4hpTOLMKQNcVc7l84EnZiXnE5 1kQi5pSBstb39oHRRhJZ5QwEXQXdzdSBg27hUDWLzF9LyHah8EIcazE7IVElh49bR1gi XN1EvPqiXlKlvvpfxtSR3iJ3zyE38zC8hX2mgby0aqwAaJea3od94Dep71axn390H8Of haUtNN2M6wVR0i8v8hEnSs1clKNVngUhD/9WRVG6auQqkdehP4oN5oe+FmdcEPp6Odd6 7uXQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:dkim-signature:dkim-filter; bh=0BKPm+Ru2fB4N9zmFWmWzKSFfEVtQHafBqKAxQzeOVQ=; b=Krkr7o87mUvYTRFJV/UaCDG1TfDuehhXnUngj9QV41t2ymGwu1nrSklZro9OBERgCg gYPNb4FmBoM7Z32EfKkx8KO6JU3OEwNO3/s4gFQhuUonM7u5ae0mQGCvk/suHvLCRfjx ChKFGJExfoawAc5JH9cXSicVa/xyY7cRuoKsul9UUx1x7s79gu5noVbEwKrswOdebfaQ 8ZIA1P8X5aMktdrkSLcj1dXDORVEQryr1CG9bQDnUIW2SPVyGuFr/h5gLB5zASfx2QsZ r1tXm5oUkVxBiXUpFoqOjY9gXLQtMggrOIh5/EKXFVRbTM+IVBYqHmdPFZNDRrzk6m3z rkiQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@nifty.com header.s=dec2015msa header.b=onRPPSSH; 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 s21si898743pfh.260.2019.03.23.19.29.40; Sat, 23 Mar 2019 19:30:07 -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; dkim=pass header.i=@nifty.com header.s=dec2015msa header.b=onRPPSSH; 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 S1727963AbfCXCXH (ORCPT + 99 others); Sat, 23 Mar 2019 22:23:07 -0400 Received: from conssluserg-04.nifty.com ([210.131.2.83]:47226 "EHLO conssluserg-04.nifty.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727746AbfCXCXG (ORCPT ); Sat, 23 Mar 2019 22:23:06 -0400 Received: from mail-vs1-f47.google.com (mail-vs1-f47.google.com [209.85.217.47]) (authenticated) by conssluserg-04.nifty.com with ESMTP id x2O2Mlk4009950 for ; Sun, 24 Mar 2019 11:22:48 +0900 DKIM-Filter: OpenDKIM Filter v2.10.3 conssluserg-04.nifty.com x2O2Mlk4009950 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=nifty.com; s=dec2015msa; t=1553394168; bh=0BKPm+Ru2fB4N9zmFWmWzKSFfEVtQHafBqKAxQzeOVQ=; h=References:In-Reply-To:From:Date:Subject:To:Cc:From; b=onRPPSSHX9ZE/KzpxyLC9fAXA85Uk+NGHHtvsH/O589i8cX6IjcrC11IeCSqYROgK HFPXMJ5X9+ebrZrGzrlEpM3PAvZ/iaAZcteWi3y50j86MNExVGGnzEz8NAtf3Pn9gH 1mmB5R6sG1/LBurOOMKr6wx3SZ1IJNrMuRinAp1yC4vvOtinOPLC+fTSm9QHn7nYfa GbAYLOIdRWwT9ly9elRVyBvLvE0IE2wZoaYEGHDv/2NgwD30TieF08zKONhdD1rt7S rHu91yl4Ndiofn5FRmfthTevflWfM+7ozcZOkfIOwTrkEpwy39qbU0Hw4aNR9a4MAs 7X4+T0PaZf9VA== X-Nifty-SrcIP: [209.85.217.47] Received: by mail-vs1-f47.google.com with SMTP id n4so3502622vsm.3 for ; Sat, 23 Mar 2019 19:22:47 -0700 (PDT) X-Gm-Message-State: APjAAAW9gD7Xb3yu0fA/CK4+wdBe/e7BzyFEmKW1x4JvSs0RmQWb2Bc7 qzMjf6KqedwnmYO0oEuxC/4RYQ6Ll9r4o1FUbJo= X-Received: by 2002:a67:f105:: with SMTP id n5mr11059166vsk.181.1553394166974; Sat, 23 Mar 2019 19:22:46 -0700 (PDT) MIME-Version: 1.0 References: <20190203084840.6113-1-vladimir.kondratiev@intel.com> <20190322155212.133029-1-andre.przywara@arm.com> In-Reply-To: <20190322155212.133029-1-andre.przywara@arm.com> From: Masahiro Yamada Date: Sun, 24 Mar 2019 11:22:11 +0900 X-Gmail-Original-Message-ID: Message-ID: Subject: Re: [PATCH v2] kbuild: gitignore output directory To: Andre Przywara Cc: Vladimir Kondratiev , Linux Kernel Mailing List Content-Type: text/plain; charset="UTF-8" Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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. 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 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 > -- Best Regards Masahiro Yamada