From patchwork Tue Mar 26 04:26:58 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Masahiro Yamada X-Patchwork-Id: 10870399 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 26E391575 for ; Tue, 26 Mar 2019 04:27:27 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 0B680290AC for ; Tue, 26 Mar 2019 04:27:27 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id F3197290B0; Tue, 26 Mar 2019 04:27:26 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-7.9 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,MAILING_LIST_MULTI,RCVD_IN_DNSWL_HI autolearn=ham version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 8DB8D290AC for ; Tue, 26 Mar 2019 04:27:26 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726285AbfCZE1Y (ORCPT ); Tue, 26 Mar 2019 00:27:24 -0400 Received: from conuserg-09.nifty.com ([210.131.2.76]:56907 "EHLO conuserg-09.nifty.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725776AbfCZE1Y (ORCPT ); Tue, 26 Mar 2019 00:27:24 -0400 Received: from pug.e01.socionext.com (p14092-ipngnfx01kyoto.kyoto.ocn.ne.jp [153.142.97.92]) (authenticated) by conuserg-09.nifty.com with ESMTP id x2Q4R5cf022680; Tue, 26 Mar 2019 13:27:05 +0900 DKIM-Filter: OpenDKIM Filter v2.10.3 conuserg-09.nifty.com x2Q4R5cf022680 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=nifty.com; s=dec2015msa; t=1553574426; bh=luaBYMoq4WHRW4hlBUkSayGbn0IoOPI5Kl//OZWr9Zg=; h=From:To:Cc:Subject:Date:From; b=VVP0CUW9SUp2L0deEQyuLVk4Z6DPFoQXURh4sLlw+8f3wflI5yny7tebNNtWsUsh4 JoJ9vLZiWwkMGOod2/7+m8TKC32AHNrh2xxK3IlDK3mC84WuJSaBGJ9PxTNHX73TU8 befG44PU09DgTOByJrJTtvzUngQtJTKdcNiH9xPv5b+LkVx8AxATYm1dlqRLITjIH+ lSTpD90hZdAmo5WgNN1mhrvE1fnUBAL6gA18npQ8OjGrhZUINPK069KzPXNDkUz8jx j6091w8HeMbejLqEa4NmkpmczoAqO5rP1wND+Z73Gm/29WH5LQfrgz6XvmkeOr7q6w qM28DBof75qFQ== X-Nifty-SrcIP: [153.142.97.92] From: Masahiro Yamada To: linux-kbuild@vger.kernel.org Cc: Andre Przywara , Vladimir Kondratiev , Masahiro Yamada , Michal Marek , linux-kernel@vger.kernel.org Subject: [PATCH] kbuild: do not overwrite .gitignore in output directory Date: Tue, 26 Mar 2019 13:26:58 +0900 Message-Id: <1553574418-21033-1-git-send-email-yamada.masahiro@socionext.com> X-Mailer: git-send-email 2.7.4 Sender: linux-kbuild-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kbuild@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP Commit 3a51ff344204 ("kbuild: gitignore output directory") seemed to bother people who version-control output directories. Andre Przywara says: "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." Link: https://lkml.org/lkml/2019/3/22/1819 Reported-by: Andre Przywara Signed-off-by: Masahiro Yamada Tested-by: Andre Przywara Reviewed-by: Andre Przywara --- Makefile | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/Makefile b/Makefile index 5fe5431..70fc778 100644 --- a/Makefile +++ b/Makefile @@ -499,7 +499,8 @@ 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 + $(Q)test -e .gitignore || \ + { echo "# this is build directory, ignore it"; echo "*"; } > .gitignore endif ifneq ($(shell $(CC) --version 2>&1 | head -n 1 | grep clang),)