Received: by 2002:a25:4158:0:0:0:0:0 with SMTP id o85csp4672753yba; Tue, 30 Apr 2019 02:24:16 -0700 (PDT) X-Google-Smtp-Source: APXvYqwD4DBWUmqTPTYTTbXUonKDrQjX4RqWe/Me/G1Bru0FElirT3ysYOjZdgWuCBYfBrPsMh4q X-Received: by 2002:a17:902:b40a:: with SMTP id x10mr67760623plr.231.1556616256733; Tue, 30 Apr 2019 02:24:16 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1556616256; cv=none; d=google.com; s=arc-20160816; b=m74XilYCcizidrZKd8lqykP9HZb6D9+RKd45n1wJHC9jnWgngwp3BQuf/2bzw16QOU Pi1mqXzhPqJjf3u8tqtCVe3QEjx3tYJLbF1H/NveY7V5PV1BEbg/+MILXZTAMgrfa6WR jn5ppndEwBRBF7J95baAuB/kTAHDgwl2M5NLp5Hs7JzMFGGHX+BqacqW45TXJYzAiBSh LMhtp3vIkEdeHmJhar2U37J8Ado/3/ZDkGFT1NsoM0z+AGalHGqYyMkBnt8KYdVJ+Bdf L8koG4PdR3miwQGTU1g4gSDZ8eeyKAG8QX7VztULDAsjwTZ7t9NjSr18qbPW3cskMyVb J8mA== 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 :content-language:in-reply-to:mime-version:user-agent:date :message-id:from:references:cc:to:subject:dkim-signature; bh=iaFDFnvVtS1iWSBFrIIKUe+7Fko1T4rJ0OHw8pGokPc=; b=Cv1X1hJkk4SIRy0nAbo1BRLyH80XP+CiEUKfTv3GPhPeHH72TfnABUJuMTqwUt4pnW b9Vwtuz8OA/SgLvmhJTtYXO6ouAmS8pWeV/svwvw6SM+ys5zaCMxv2LFgHp2IlgSww3p HoahhuHDqBJRa48numxWaLoAJ79T9+J0uwIhXaaZ2Ulbk7E3esqmSLx4GfRDdI7iOcd5 z3vCzTiPr+h8BIrIpAT7jFHiXfixGYOTuvNirwEkfRD4mL6hyGJlPTbNC4MA9Fqgz3Ne YGZXywFrFWkVVa8OSYhT378I4aQeoNaa09wTZjFgyPmJB0NTwyvfjFhXQC6PUKdotpWa eRGQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@netronome-com.20150623.gappssmtp.com header.s=20150623 header.b=SGZs7DUn; 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 p27si16162188pgb.364.2019.04.30.02.24.01; Tue, 30 Apr 2019 02:24:16 -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=@netronome-com.20150623.gappssmtp.com header.s=20150623 header.b=SGZs7DUn; 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 S1726263AbfD3JV5 (ORCPT + 99 others); Tue, 30 Apr 2019 05:21:57 -0400 Received: from mail-wm1-f68.google.com ([209.85.128.68]:33711 "EHLO mail-wm1-f68.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725938AbfD3JV4 (ORCPT ); Tue, 30 Apr 2019 05:21:56 -0400 Received: by mail-wm1-f68.google.com with SMTP id z6so1875311wmi.0 for ; Tue, 30 Apr 2019 02:21:55 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=netronome-com.20150623.gappssmtp.com; s=20150623; h=subject:to:cc:references:from:message-id:date:user-agent :mime-version:in-reply-to:content-language:content-transfer-encoding; bh=iaFDFnvVtS1iWSBFrIIKUe+7Fko1T4rJ0OHw8pGokPc=; b=SGZs7DUnbcoM2RcuSABcJ5nEoFb5Jh0yeaPcnF7PUPj+8pC9/WQCx9BoIHQSJleqz3 N/9J58myQKiVQXvIx8lwvoC+4AC9LE0osAegiYd5wfE42z2H/ePs54RyDNrRSTAa2IXw 7ByXxjQSOPkiK2LuY8u2671JH6lLW96Vv1MD5QJe62rqoc7RjuFVEEa0byaLidAP6+ss mJg+n7238TTgYfVBHgjWao3xUI8HqccPyvjGIsXVyTLswrqQWSqnLM/WCl2P2UDefbzq wY1iDaaKC5b4iIaEUCuRGx9TKrASiJp1IY0YURTny0z3gzpj5c7obFWhL8lZPD35gAo3 RPrA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:subject:to:cc:references:from:message-id:date :user-agent:mime-version:in-reply-to:content-language :content-transfer-encoding; bh=iaFDFnvVtS1iWSBFrIIKUe+7Fko1T4rJ0OHw8pGokPc=; b=H92WM55/6CNtsSPgOFwOF56vRY8kZ+tWLIXNigvKkYLexZXFYSbqzHxXrMnz16pxQq MpeBo4bL1c7bNR7ssjT3gyYPAARfLc6RtVj7ImpajHckiz3zVQgKmrhDCo1fQzgDR/9r ig4jpDBRb+H37YLUv2TjPni306G7OrfdcKG3vgFjUesuRoC7Nq19tIq/D4EqytdWVVB0 2M9s5oQHSFu/OfroJBj4nd0M/J1Qk49DcFIWgcaUJlLi6o7ejLjkuwYdBk49ppXFn9KF 2wzLgHlYeszk1+3CwHuDAm7SLgc5Kbs75IGuzpzJ0q8YJ9fJcJ658/vRMMszoWtqyB6q yWmQ== X-Gm-Message-State: APjAAAVNtoUAaSbYU4XfQMay2xNfhqoCrDow1QGU/vtLDCi19OVszUoS 3Y3zkhs6SrQwpmOMogYz3/4C3Q== X-Received: by 2002:a7b:c054:: with SMTP id u20mr2564880wmc.100.1556616114786; Tue, 30 Apr 2019 02:21:54 -0700 (PDT) Received: from [192.168.1.2] ([194.53.187.71]) by smtp.gmail.com with ESMTPSA id r2sm9694774wrr.65.2019.04.30.02.21.53 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Tue, 30 Apr 2019 02:21:54 -0700 (PDT) Subject: Re: [PATCH] bpftool: exclude bash-completion/bpftool from .gitignore pattern To: Masahiro Yamada Cc: Daniel Borkmann , Sirio Balmelli , Song Liu , Alexei Starovoitov , Networking , Yonghong Song , Taeung Song , Linux Kernel Mailing List , Jakub Kicinski , Martin KaFai Lau , bpf@vger.kernel.org References: <1556549259-16298-1-git-send-email-yamada.masahiro@socionext.com> From: Quentin Monnet Message-ID: Date: Tue, 30 Apr 2019 10:21:52 +0100 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:60.0) Gecko/20100101 Thunderbird/60.6.1 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: en-US Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 2019-04-30 09:15 UTC+0900 ~ Masahiro Yamada > Hi Quentin, > > > On Tue, Apr 30, 2019 at 12:33 AM Quentin Monnet > wrote: >> >> 2019-04-29 23:47 UTC+0900 ~ Masahiro Yamada >>> tools/bpf/bpftool/.gitignore has the "bpftool" pattern, which is >>> intended to ignore the following build artifact: >>> >>> tools/bpf/bpftool/bpftool >>> >>> However, the .gitignore entry is effective not only for the current >>> directory, but also for any sub-directories. >>> >>> So, the following file is also considered to be ignored: >>> >>> tools/bpf/bpftool/bash-completion/bpftool >>> >>> It is obviously version-controlled, so should be excluded from the >>> .gitignore pattern. >>> >>> You can fix it by prefixing the pattern with '/', which means it is >>> only effective in the current directory. >>> >>> I prefixed the other patterns consistently. IMHO, '/' prefixing is >>> safer when you intend to ignore specific files. >>> >>> Signed-off-by: Masahiro Yamada >>> --- >> >> Hi, >> >> “Files already tracked by Git are not affected” by the .gitignore (says >> the relevant man page), so bash completion file is not ignored. It would >> be if we were to add the sources to the index of a new Git repo. But >> sure, it does not cost much to make the .gitignore cleaner. > > Right, git seems to be flexible enough. > > > But, .gitignore is useful to identify > build artifacts in general. > In fact, other than git, some projects > already parse this. > > For example, tar(1) supports: > > --exclude-vcs-ignores > read exclude patterns from the VCS ignore files > > > As of writing, this option works only to some extent, > but I thought this would be useful to create a source > package without relying on "git archive". > > When I tried "tar --exclude-vcs-ignores", I noticed > tools/bpf/bpftool/bash-completion/bpftool was not > contained in the tarball. > > That's why I sent this patch. Ok, thanks for explaining! Makes sense to me now. > > I can add more info in v2 to clarify > my motivation though. Sounds good, yes please. > > >>> >>> tools/bpf/bpftool/.gitignore | 8 ++++---- >>> 1 file changed, 4 insertions(+), 4 deletions(-) >>> >>> diff --git a/tools/bpf/bpftool/.gitignore b/tools/bpf/bpftool/.gitignore >>> index 67167e4..19efcc8 100644 >>> --- a/tools/bpf/bpftool/.gitignore >>> +++ b/tools/bpf/bpftool/.gitignore >>> @@ -1,5 +1,5 @@ >>> *.d >>> -bpftool >>> -bpftool*.8 >>> -bpf-helpers.* >>> -FEATURE-DUMP.bpftool >>> +/bpftool >>> +/bpftool*.8 >>> +/bpf-helpers.* >> >> Careful when you add all those slashes, however. "bpftool*.8" and >> "bpf-helpers.*" should match files under Documentation/, so you do NOT >> want to prefix them with just a "/". > > OK, I should not have touched what I was unsure about. > Will fix in v2. Thanks! Quentin