[pacman-dev] Add `build/` to gitignore

Message ID 20201209191452.24688-1-colin@fosskers.ca
State Rejected, archived
Headers show
Series [pacman-dev] Add `build/` to gitignore | expand

Commit Message

Colin Woodbury Dec. 9, 2020, 7:14 p.m. UTC
Since it's a transient directory for build artifacts, nothing in there will ever
been committed. Ignoring it also makes IDEs happier during file search.

Signed-off-by: Colin Woodbury <colin@fosskers.ca>
---
 .gitignore | 1 +
 1 file changed, 1 insertion(+)

Comments

Eli Schwartz Dec. 11, 2020, 1:42 a.m. UTC | #1
On 12/9/20 2:14 PM, Colin Woodbury wrote:
> Since it's a transient directory for build artifacts, nothing in there will ever
> been committed. Ignoring it also makes IDEs happier during file search.
> 
> Signed-off-by: Colin Woodbury <colin@fosskers.ca>
> ---
>   .gitignore | 1 +
>   1 file changed, 1 insertion(+)
> 
> diff --git a/.gitignore b/.gitignore
> index 01975fd2..638dfe39 100644
> --- a/.gitignore
> +++ b/.gitignore
> @@ -1,3 +1,4 @@
>   *~
>   *.o
>   pacman-*.tar.gz
> +build/*

I use builddir/ (and upstream usually recommends that these days since 
it's less likely to confuse "meson builddir" as a subcommand, compared 
to "meson build").

This is kind of the problem with trying to ignore a directory that isn't 
canonical.

Instead, I'd prefer to argue upstream in favor of 
https://github.com/mesonbuild/meson/issues/6509
Colin Woodbury Dec. 11, 2020, 2:12 a.m. UTC | #2
Right, having `meson` do it automatically would work well. I put forth the patch in the first place because the instructions on the Pacman website (master branch), if followed, place the artifacts in `build/`. Other newcomers to the project like me would hit the same thing, so some automated solution would be nice.

Is there anything we can do to move that `meson` proposal forward, other than complaining loudly? ;)

Colin

On Thu, 10 Dec 2020, at 17:42, Eli Schwartz wrote:
> On 12/9/20 2:14 PM, Colin Woodbury wrote:
> > Since it's a transient directory for build artifacts, nothing in there will ever
> > been committed. Ignoring it also makes IDEs happier during file search.
> > 
> > Signed-off-by: Colin Woodbury <colin@fosskers.ca>
> > ---
> >   .gitignore | 1 +
> >   1 file changed, 1 insertion(+)
> > 
> > diff --git a/.gitignore b/.gitignore
> > index 01975fd2..638dfe39 100644
> > --- a/.gitignore
> > +++ b/.gitignore
> > @@ -1,3 +1,4 @@
> >   *~
> >   *.o
> >   pacman-*.tar.gz
> > +build/*
> 
> I use builddir/ (and upstream usually recommends that these days since 
> it's less likely to confuse "meson builddir" as a subcommand, compared 
> to "meson build").
> 
> This is kind of the problem with trying to ignore a directory that isn't 
> canonical.
> 
> Instead, I'd prefer to argue upstream in favor of 
> https://github.com/mesonbuild/meson/issues/6509
> 
> -- 
> Eli Schwartz
> Bug Wrangler and Trusted User
> 
> 
> 
> *Attachments:*
>  * OpenPGP_signature
Ivy Foster Dec. 11, 2020, 2:40 a.m. UTC | #3
On 10 Dec 2020, at  6:12 pm -0800, Colin Woodbury wrote:
> Right, having `meson` do it automatically would work well. I put
> forth the patch in the first place because the instructions on the
> Pacman website (master branch), if followed, place the artifacts in
> `build/`. Other newcomers to the project like me would hit the same
> thing, so some automated solution would be nice.

If I may propose an alternative, this seems like an ideal use for
.../pacman/.git/info/exclude.

For those who don't know, .git/info/exclude is a secondary gitignore
file not under version control. It is specifically for files that
shouldn't be ignored at the project level, but that an individual
developer or user might want to ignore--such as for build artifacts in
non-standardized places, or your personal wrapper scripts for testing
whatever you're working on.

Cheers,
Ivy
Eli Schwartz Dec. 11, 2020, 2:56 a.m. UTC | #4
On 12/10/20 9:40 PM, Ivy Foster wrote:
> On 10 Dec 2020, at  6:12 pm -0800, Colin Woodbury wrote:
>> Right, having `meson` do it automatically would work well. I put
>> forth the patch in the first place because the instructions on the
>> Pacman website (master branch), if followed, place the artifacts in
>> `build/`. Other newcomers to the project like me would hit the same
>> thing, so some automated solution would be nice.
> 
> If I may propose an alternative, this seems like an ideal use for
> .../pacman/.git/info/exclude.
> 
> For those who don't know, .git/info/exclude is a secondary gitignore
> file not under version control. It is specifically for files that
> shouldn't be ignored at the project level, but that an individual
> developer or user might want to ignore--such as for build artifacts in
> non-standardized places, or your personal wrapper scripts for testing
> whatever you're working on.

I do this in $HOME/.config/git/ignore since this pattern is shared by 
multiple meson-using projects and I can't imagine "builddir/" being 
actually used for non build artifacts.

Still would be nice to autogenerate this on meson's side. I'm discussing 
it with them...
Eli Schwartz Dec. 13, 2020, 1:01 a.m. UTC | #5
On 12/10/20 9:12 PM, Colin Woodbury wrote:
> Right, having `meson` do it automatically would work well. I put
> forth the patch in the first place because the instructions on the
> Pacman website (master branch), if followed, place the artifacts in
> `build/`. Other newcomers to the project like me would hit the same
> thing, so some automated solution would be nice.
> 
> Is there anything we can do to move that `meson` proposal forward,
> other than complaining loudly? ;)

https://github.com/mesonbuild/meson/pull/8092

The proposal is getting traction. :D
Colin Woodbury Dec. 13, 2020, 10:17 p.m. UTC | #6
And now it's merged! :)

On Sat, 12 Dec 2020, at 17:01, Eli Schwartz wrote:
> On 12/10/20 9:12 PM, Colin Woodbury wrote:
> > Right, having `meson` do it automatically would work well. I put
> > forth the patch in the first place because the instructions on the
> > Pacman website (master branch), if followed, place the artifacts in
> > `build/`. Other newcomers to the project like me would hit the same
> > thing, so some automated solution would be nice.
> > 
> > Is there anything we can do to move that `meson` proposal forward,
> > other than complaining loudly? ;)
> 
> https://github.com/mesonbuild/meson/pull/8092
> 
> The proposal is getting traction. :D
> 
> -- 
> Eli Schwartz
> Bug Wrangler and Trusted User
> 
> 
> 
> *Attachments:*
>  * OpenPGP_signature
Eli Schwartz Dec. 14, 2020, 4:42 a.m. UTC | #7
On 12/13/20 5:17 PM, Colin Woodbury wrote:
> And now it's merged! :)
Indeed, thanks for the prodding on this mailing list which made it 
happen. meson 0.57 will automatically ignore configured build directories.

Hence, this proposed patch is obsolete.
Colin Woodbury Dec. 14, 2020, 5:50 p.m. UTC | #8
Thank Eli, I'll keep an eye out for 0.57. Yup, this patch can be sent to the dustbin. 

Cheers,
Colin

On Sun, 13 Dec 2020, at 20:42, Eli Schwartz wrote:
> On 12/13/20 5:17 PM, Colin Woodbury wrote:
> > And now it's merged! :)
> Indeed, thanks for the prodding on this mailing list which made it 
> happen. meson 0.57 will automatically ignore configured build directories.
> 
> Hence, this proposed patch is obsolete.
> 
> -- 
> Eli Schwartz
> Bug Wrangler and Trusted User
> 
> 
> 
> *Attachments:*
>  * OpenPGP_signature

Patch

diff --git a/.gitignore b/.gitignore
index 01975fd2..638dfe39 100644
--- a/.gitignore
+++ b/.gitignore
@@ -1,3 +1,4 @@ 
 *~
 *.o
 pacman-*.tar.gz
+build/*