From patchwork Mon Jan 30 09:04:26 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Like Xu X-Patchwork-Id: 13120533 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 1820FC54EED for ; Mon, 30 Jan 2023 09:07:56 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version:Message-Id:Date:Subject:Cc :To:From:Reply-To:Content-ID:Content-Description:Resent-Date:Resent-From: Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:In-Reply-To:References: List-Owner; bh=lL89S71cySvE39Fp2PaCnfM6IqFXyKN31ww7WIcb3Ak=; b=rjhFMO4x5b9rNx 6OgAymavYJsgQd//RKrLbJ1BlfUhXhn28VcNES19UkCNwk1WUJLODJ1EX3QwSNrVcTJH39pJK+C26 fHVFmbBhTAWrw2ikuV93zDfONQl6ayB8G38IBVv4dsb3J7nN3idy7TFy4POnrmaPYbPtXVq3TLZV1 hfHFnNQ9ImasB4FOlESjayXzspiPYs0pR4599tbNO8Eiu9tWtxVHxePK3X6vLVBco/OKn2NJHaBNm BgoTrS5bBEWjDKytLC/F981DtQe+05Uh7J8noAqmF274Lh49Z97bfy2jDcR1CQ/XLh1vBbMGp/GRh y0Iy333RRjEuCTtGFOpA==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1pMQ6Z-002l0f-Py; Mon, 30 Jan 2023 09:05:35 +0000 Received: from mail-pl1-x62b.google.com ([2607:f8b0:4864:20::62b]) by bombadil.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1pMQ5o-002kzj-Rh for linux-arm-kernel@lists.infradead.org; Mon, 30 Jan 2023 09:04:50 +0000 Received: by mail-pl1-x62b.google.com with SMTP id d3so10866025plr.10 for ; Mon, 30 Jan 2023 01:04:47 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:from:to:cc:subject:date:message-id:reply-to; bh=s6UNdUpKWpLSTSOHWKFbbLTpe021E5XwaO8VPJyBruA=; b=fDQUb7nqvxToI/bLKsxrjgL1kp+4v6u1YF5/SLsB8nGadBv9GlY3URT6jiA1YTcdME VaGMZzo020vEs+jm8HfIUJe5k/B3Q880/VFzh2SA7NDdOsmAFctCzrovUfYsY4Bz2SBQ cLRUlKyiVp7YvHbcFEuRmB/Iakam1la0sb4uz42Er+wFx9kxzQMQ27b1TGsg0vDdmkWd GcaMTCuz9va70pE18H+y0yQFDYevZaoyV8OYFvy02YgoFZbcwDwOww25QL/h+L9TSti5 U+lDhkIJngLsR3TqMLYWCXpK4KvV+l393w86+zWQ4Fr0Ke7GwIo9HTp3zSzBr0EB/GQj XB7w== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=s6UNdUpKWpLSTSOHWKFbbLTpe021E5XwaO8VPJyBruA=; b=moZKi3+VcCURkXhdvO4/Bmas8mfFlomxEZ4rskq0boiYELMWv/K4I8eDoY1S3jpQyv 9R4V1rk1qMqG86GAsLxKkjNCVoxl2la5WNi5FF1bWlResQT29mp0ViUgqluy/bjFBAr/ HonQIj3K1AN4OZgL75ycN5fdx+YyUf9vmHYEbJGNXO14O+JL2qybVw13rXtpHVaYQOxR BVRGvyl53W89F6KfcUggzJH/OKmDR9X0iA+MUEoH6LBhmIcQq2ZjUvRPSJAJH2L2Dnmn dn95Oufx/rMC4U5IqVtRxseUA3ijgbn3u9Q85JmFwfA/DzgJsbd+yVySZaXtwWAJ77TZ G/EA== X-Gm-Message-State: AO0yUKWGlZCCj5Oh1aTYeaBbGE1/TB5YcUDe9MS6OdcBrzds8xTtttP0 6mBg/xjdK4K0RYtJA463u+bc5xXfEq5dVNo2 X-Google-Smtp-Source: AK7set/3TAw8yhF6CPCb2wGY/0b8uhcN34CMIRKK2RrHevObDG2VhwyzGWNLsR1uIB/skeUSrEC0lA== X-Received: by 2002:a17:902:ce87:b0:196:341b:ed7 with SMTP id f7-20020a170902ce8700b00196341b0ed7mr21641187plg.15.1675069486498; Mon, 30 Jan 2023 01:04:46 -0800 (PST) Received: from localhost.localdomain ([103.7.29.32]) by smtp.gmail.com with ESMTPSA id x7-20020a1709029a4700b00192aa53a7d5sm7255321plv.8.2023.01.30.01.04.43 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 30 Jan 2023 01:04:46 -0800 (PST) From: Like Xu X-Google-Original-From: Like Xu To: Will Deacon , Paolo Bonzini , Masahiro Yamada Cc: Catalin Marinas , Shuah Khan , Miguel Ojeda , Wedson Almeida Filho , Alex Gaynor , Kees Cook , Andrew Davis , linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-kselftest@vger.kernel.org, kvm@vger.kernel.org Subject: [PATCH] .gitignore: Keep track of archived files as they are added to a new git repo Date: Mon, 30 Jan 2023 17:04:26 +0800 Message-Id: <20230130090426.13864-1-likexu@tencent.com> X-Mailer: git-send-email 2.39.1 MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20230130_010448_918673_1B9A542F X-CRM114-Status: GOOD ( 16.25 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org From: Like Xu With thousands of commits going into mainline each development cycle, the metadata .git folder size is gradually expanding (1GB+), and for some developers (most likely testers) who don't care about the lengthy git-log, they just use git-archive to distribute a certain version of code (~210MB) and rebuild git repository from anywhere for further code changes, e.g. $ git init && git add . -A Then unfortunately, the file tracking metadata from the original git-repo using "git add -f" will also be lost, to the point where part of source files wrapped by git-archive may be accidentally cleaned up: $ git clean -nxdf Would remove Documentation/devicetree/bindings/.yamllint Would remove drivers/clk/.kunitconfig Would remove drivers/gpu/drm/tests/.kunitconfig Would remove drivers/hid/.kunitconfig Would remove fs/ext4/.kunitconfig Would remove fs/fat/.kunitconfig Would remove kernel/kcsan/.kunitconfig Would remove lib/kunit/.kunitconfig Would remove mm/kfence/.kunitconfig Would remove tools/testing/selftests/arm64/tags/ Would remove tools/testing/selftests/kvm/.gitignore Would remove tools/testing/selftests/kvm/Makefile Would remove tools/testing/selftests/kvm/config Would remove tools/testing/selftests/kvm/settings This asymmetry is very troubling to those users since finding out which files to track with "git add -f" clearly requires priori knowledge on various subsystems. The eradication of this little issue requires naturally making git-init aware of all .gitignore restrictions at different file tree hierarchies. Similar issues can be troubleshot with "git check-ignore -v" for any mistakenly cleaned files. Signed-off-by: Like Xu --- .gitignore | 2 ++ tools/testing/selftests/arm64/.gitignore | 2 ++ tools/testing/selftests/kvm/.gitignore | 4 ++++ 3 files changed, 8 insertions(+) create mode 100644 tools/testing/selftests/arm64/.gitignore diff --git a/.gitignore b/.gitignore index 20dce5c3b9e0..fa39e98caee3 100644 --- a/.gitignore +++ b/.gitignore @@ -102,6 +102,8 @@ modules.order !.gitignore !.mailmap !.rustfmt.toml +!.yamllint +!.kunitconfig # # Generated include files diff --git a/tools/testing/selftests/arm64/.gitignore b/tools/testing/selftests/arm64/.gitignore new file mode 100644 index 000000000000..135d709d2d65 --- /dev/null +++ b/tools/testing/selftests/arm64/.gitignore @@ -0,0 +1,2 @@ +# SPDX-License-Identifier: GPL-2.0-only +!tags diff --git a/tools/testing/selftests/kvm/.gitignore b/tools/testing/selftests/kvm/.gitignore index 6d9381d60172..96561c8e06e0 100644 --- a/tools/testing/selftests/kvm/.gitignore +++ b/tools/testing/selftests/kvm/.gitignore @@ -5,3 +5,7 @@ !*.h !*.S !*.sh +!.gitignore +!Makefile +!settings +!config \ No newline at end of file