diff mbox series

[v2] bpftool: exclude bash-completion/bpftool from .gitignore pattern

Message ID 1556718359-1598-1-git-send-email-yamada.masahiro@socionext.com
State New
Headers show
Series [v2] bpftool: exclude bash-completion/bpftool from .gitignore pattern | expand

Commit Message

Masahiro Yamada May 1, 2019, 1:45 p.m. UTC
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, from the point of .gitignore grammar, the following check-in file
is also considered to be ignored:

  tools/bpf/bpftool/bash-completion/bpftool

As the manual gitignore(5) says "Files already tracked by Git are not
affected", this is not a problem as far as Git is concerned.

However, Git is not the only program that parses .gitignore because
.gitignore is useful to distinguish build artifacts from source files.

For example, tar(1) supports the --exclude-vcs-ignore option. As of
writing, this option does not work perfectly, but it intends to create
a tarball excluding files specified by .gitignore.

So, I believe it is better to fix this issue.

You can fix it by prefixing the pattern with a slash; the leading slash
means the specified pattern is relative to the current directory.

Signed-off-by: Masahiro Yamada <yamada.masahiro@socionext.com>

---

Changes in v2:
  - Add more information to the commit log to clarify my main motivation
  - Touch "bpftool" pattern only

 tools/bpf/bpftool/.gitignore | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

-- 
2.7.4

Comments

Quentin Monnet May 1, 2019, 2:02 p.m. UTC | #1
2019-05-01 22:45 UTC+0900 ~ Masahiro Yamada <yamada.masahiro@socionext.com>
> 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, from the point of .gitignore grammar, the following check-in file

> is also considered to be ignored:

> 

>   tools/bpf/bpftool/bash-completion/bpftool

> 

> As the manual gitignore(5) says "Files already tracked by Git are not

> affected", this is not a problem as far as Git is concerned.

> 

> However, Git is not the only program that parses .gitignore because

> .gitignore is useful to distinguish build artifacts from source files.

> 

> For example, tar(1) supports the --exclude-vcs-ignore option. As of

> writing, this option does not work perfectly, but it intends to create

> a tarball excluding files specified by .gitignore.

> 

> So, I believe it is better to fix this issue.

> 

> You can fix it by prefixing the pattern with a slash; the leading slash

> means the specified pattern is relative to the current directory.

> 

> Signed-off-by: Masahiro Yamada <yamada.masahiro@socionext.com>

> ---

> 

> Changes in v2:

>   - Add more information to the commit log to clarify my main motivation

>   - Touch "bpftool" pattern only

> 

>  tools/bpf/bpftool/.gitignore | 2 +-

>  1 file changed, 1 insertion(+), 1 deletion(-)

> 

> diff --git a/tools/bpf/bpftool/.gitignore b/tools/bpf/bpftool/.gitignore

> index 67167e4..8248b8d 100644

> --- a/tools/bpf/bpftool/.gitignore

> +++ b/tools/bpf/bpftool/.gitignore

> @@ -1,5 +1,5 @@

>  *.d

> -bpftool

> +/bpftool

>  bpftool*.8

>  bpf-helpers.*

>  FEATURE-DUMP.bpftool

> 


Thanks a lot for the changes!

Reviewed-by: Quentin Monnet <quentin.monnet@netronome.com>
Alexei Starovoitov May 5, 2019, 6:44 a.m. UTC | #2
On Wed, May 1, 2019 at 7:02 AM Quentin Monnet
<quentin.monnet@netronome.com> wrote:
>

> 2019-05-01 22:45 UTC+0900 ~ Masahiro Yamada <yamada.masahiro@socionext.com>

> > 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, from the point of .gitignore grammar, the following check-in file

> > is also considered to be ignored:

> >

> >   tools/bpf/bpftool/bash-completion/bpftool

> >

> > As the manual gitignore(5) says "Files already tracked by Git are not

> > affected", this is not a problem as far as Git is concerned.

> >

> > However, Git is not the only program that parses .gitignore because

> > .gitignore is useful to distinguish build artifacts from source files.

> >

> > For example, tar(1) supports the --exclude-vcs-ignore option. As of

> > writing, this option does not work perfectly, but it intends to create

> > a tarball excluding files specified by .gitignore.

> >

> > So, I believe it is better to fix this issue.

> >

> > You can fix it by prefixing the pattern with a slash; the leading slash

> > means the specified pattern is relative to the current directory.

> >

> > Signed-off-by: Masahiro Yamada <yamada.masahiro@socionext.com>

> > ---

> >

> > Changes in v2:

> >   - Add more information to the commit log to clarify my main motivation

> >   - Touch "bpftool" pattern only

> >

> >  tools/bpf/bpftool/.gitignore | 2 +-

> >  1 file changed, 1 insertion(+), 1 deletion(-)

> >

> > diff --git a/tools/bpf/bpftool/.gitignore b/tools/bpf/bpftool/.gitignore

> > index 67167e4..8248b8d 100644

> > --- a/tools/bpf/bpftool/.gitignore

> > +++ b/tools/bpf/bpftool/.gitignore

> > @@ -1,5 +1,5 @@

> >  *.d

> > -bpftool

> > +/bpftool

> >  bpftool*.8

> >  bpf-helpers.*

> >  FEATURE-DUMP.bpftool

> >

>

> Thanks a lot for the changes!

>

> Reviewed-by: Quentin Monnet <quentin.monnet@netronome.com>


Applied. Thanks
diff mbox series

Patch

diff --git a/tools/bpf/bpftool/.gitignore b/tools/bpf/bpftool/.gitignore
index 67167e4..8248b8d 100644
--- a/tools/bpf/bpftool/.gitignore
+++ b/tools/bpf/bpftool/.gitignore
@@ -1,5 +1,5 @@ 
 *.d
-bpftool
+/bpftool
 bpftool*.8
 bpf-helpers.*
 FEATURE-DUMP.bpftool