All of lore.kernel.org
 help / color / mirror / Atom feed
* [Buildroot] [PATCH] Create a .gitignore file in the CANONICAL_O directory
@ 2024-02-06 13:20 yegorslists--- via buildroot
  2024-02-06 13:30 ` Yann E. MORIN
  0 siblings, 1 reply; 6+ messages in thread
From: yegorslists--- via buildroot @ 2024-02-06 13:20 UTC (permalink / raw)
  To: buildroot

From: Yegor Yefremov <yegorslists@googlemail.com>

This .gitignore file ignores all files in an output directory and
hence doesn't change the git status.

Remove "/output" entry from the main .gitignore file as it is already
handled by this general approach.

Signed-off-by: Yegor Yefremov <yegorslists@googlemail.com>
---
 .gitignore | 1 -
 Makefile   | 3 +++
 2 files changed, 3 insertions(+), 1 deletion(-)

diff --git a/.gitignore b/.gitignore
index bb02d9f572..14b7ca5040 100644
--- a/.gitignore
+++ b/.gitignore
@@ -1,4 +1,3 @@
-/output
 /dl
 /.auto.deps
 /.config.cmd
diff --git a/Makefile b/Makefile
index ac625152c6..86d4444745 100644
--- a/Makefile
+++ b/Makefile
@@ -63,6 +63,9 @@ ifneq ($(findstring @,$(CANONICAL_O)),)
 $(error The build directory can not contain a '@')
 endif
 
+# Create a default .gitignore file that ignores everything
+$(shell echo "*" > "$(CANONICAL_O)/.gitignore")
+
 CANONICAL_CURDIR = $(realpath $(CURDIR))
 
 REQ_UMASK = 0022
-- 
2.34.1

_______________________________________________
buildroot mailing list
buildroot@buildroot.org
https://lists.buildroot.org/mailman/listinfo/buildroot

^ permalink raw reply related	[flat|nested] 6+ messages in thread

* Re: [Buildroot] [PATCH] Create a .gitignore file in the CANONICAL_O directory
  2024-02-06 13:20 [Buildroot] [PATCH] Create a .gitignore file in the CANONICAL_O directory yegorslists--- via buildroot
@ 2024-02-06 13:30 ` Yann E. MORIN
  2024-02-06 13:37   ` Arnout Vandecappelle via buildroot
  0 siblings, 1 reply; 6+ messages in thread
From: Yann E. MORIN @ 2024-02-06 13:30 UTC (permalink / raw)
  To: yegorslists; +Cc: buildroot

Yegor, All,

On 2024-02-06 14:20 +0100, yegorslists--- via buildroot spake thusly:
> From: Yegor Yefremov <yegorslists@googlemail.com>
> 
> This .gitignore file ignores all files in an output directory and
> hence doesn't change the git status.
> 
> Remove "/output" entry from the main .gitignore file as it is already
> handled by this general approach.

What are you trying to achieve with this that does not work currently?

Regards,
Yann E. MORIN.

> Signed-off-by: Yegor Yefremov <yegorslists@googlemail.com>
> ---
>  .gitignore | 1 -
>  Makefile   | 3 +++
>  2 files changed, 3 insertions(+), 1 deletion(-)
> 
> diff --git a/.gitignore b/.gitignore
> index bb02d9f572..14b7ca5040 100644
> --- a/.gitignore
> +++ b/.gitignore
> @@ -1,4 +1,3 @@
> -/output
>  /dl
>  /.auto.deps
>  /.config.cmd
> diff --git a/Makefile b/Makefile
> index ac625152c6..86d4444745 100644
> --- a/Makefile
> +++ b/Makefile
> @@ -63,6 +63,9 @@ ifneq ($(findstring @,$(CANONICAL_O)),)
>  $(error The build directory can not contain a '@')
>  endif
>  
> +# Create a default .gitignore file that ignores everything
> +$(shell echo "*" > "$(CANONICAL_O)/.gitignore")
> +
>  CANONICAL_CURDIR = $(realpath $(CURDIR))
>  
>  REQ_UMASK = 0022
> -- 
> 2.34.1
> 
> _______________________________________________
> buildroot mailing list
> buildroot@buildroot.org
> https://lists.buildroot.org/mailman/listinfo/buildroot

-- 
.-----------------.--------------------.------------------.--------------------.
|  Yann E. MORIN  | Real-Time Embedded | /"\ ASCII RIBBON | Erics' conspiracy: |
| +33 662 376 056 | Software  Designer | \ / CAMPAIGN     |  ___               |
| +33 561 099 427 `------------.-------:  X  AGAINST      |  \e/  There is no  |
| http://ymorin.is-a-geek.org/ | _/*\_ | / \ HTML MAIL    |   v   conspiracy.  |
'------------------------------^-------^------------------^--------------------'
_______________________________________________
buildroot mailing list
buildroot@buildroot.org
https://lists.buildroot.org/mailman/listinfo/buildroot

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [Buildroot] [PATCH] Create a .gitignore file in the CANONICAL_O directory
  2024-02-06 13:30 ` Yann E. MORIN
@ 2024-02-06 13:37   ` Arnout Vandecappelle via buildroot
  2024-02-12  9:00     ` Yegor Yefremov via buildroot
  0 siblings, 1 reply; 6+ messages in thread
From: Arnout Vandecappelle via buildroot @ 2024-02-06 13:37 UTC (permalink / raw)
  To: Yann E. MORIN, yegorslists; +Cc: buildroot



On 06/02/2024 14:30, Yann E. MORIN wrote:
> Yegor, All,
> 
> On 2024-02-06 14:20 +0100, yegorslists--- via buildroot spake thusly:
>> From: Yegor Yefremov <yegorslists@googlemail.com>
>>
>> This .gitignore file ignores all files in an output directory and
>> hence doesn't change the git status.
>>
>> Remove "/output" entry from the main .gitignore file as it is already
>> handled by this general approach.
> 
> What are you trying to achieve with this that does not work currently?

  I you do `make O=output-test-mypkg` (which I do quite a lot), that output 
directory doesn't get ignored by git. We could ignore output* but maybe you name 
the output directory o-foo or something.

  Putting a .gitignore in a generated directory is a very elegant solution for 
that. It is used by e.g. virtualenv, pytest, and a load of other applications 
that generate output in a directory.

  Since the .gitignore is created in the output directory, it is no longer 
necessary to put output/ in the .gitignore file.


  All of the above could be put in the commit message, of course, but for me 
Yegor's commit message was sufficiently clear :-)

  Regards,
  Arnout


> 
> Regards,
> Yann E. MORIN.
> 
>> Signed-off-by: Yegor Yefremov <yegorslists@googlemail.com>
>> ---
>>   .gitignore | 1 -
>>   Makefile   | 3 +++
>>   2 files changed, 3 insertions(+), 1 deletion(-)
>>
>> diff --git a/.gitignore b/.gitignore
>> index bb02d9f572..14b7ca5040 100644
>> --- a/.gitignore
>> +++ b/.gitignore
>> @@ -1,4 +1,3 @@
>> -/output
>>   /dl
>>   /.auto.deps
>>   /.config.cmd
>> diff --git a/Makefile b/Makefile
>> index ac625152c6..86d4444745 100644
>> --- a/Makefile
>> +++ b/Makefile
>> @@ -63,6 +63,9 @@ ifneq ($(findstring @,$(CANONICAL_O)),)
>>   $(error The build directory can not contain a '@')
>>   endif
>>   
>> +# Create a default .gitignore file that ignores everything
>> +$(shell echo "*" > "$(CANONICAL_O)/.gitignore")
>> +
>>   CANONICAL_CURDIR = $(realpath $(CURDIR))
>>   
>>   REQ_UMASK = 0022
>> -- 
>> 2.34.1
>>
>> _______________________________________________
>> buildroot mailing list
>> buildroot@buildroot.org
>> https://lists.buildroot.org/mailman/listinfo/buildroot
> 
_______________________________________________
buildroot mailing list
buildroot@buildroot.org
https://lists.buildroot.org/mailman/listinfo/buildroot

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [Buildroot] [PATCH] Create a .gitignore file in the CANONICAL_O directory
  2024-02-06 13:37   ` Arnout Vandecappelle via buildroot
@ 2024-02-12  9:00     ` Yegor Yefremov via buildroot
  2024-02-12 20:07       ` Yann E. MORIN
  0 siblings, 1 reply; 6+ messages in thread
From: Yegor Yefremov via buildroot @ 2024-02-12  9:00 UTC (permalink / raw)
  To: Arnout Vandecappelle; +Cc: Yann E. MORIN, buildroot

Hi Yann,

On Tue, Feb 6, 2024 at 2:37 PM Arnout Vandecappelle <arnout@mind.be> wrote:
>
>
>
> On 06/02/2024 14:30, Yann E. MORIN wrote:
> > Yegor, All,
> >
> > On 2024-02-06 14:20 +0100, yegorslists--- via buildroot spake thusly:
> >> From: Yegor Yefremov <yegorslists@googlemail.com>
> >>
> >> This .gitignore file ignores all files in an output directory and
> >> hence doesn't change the git status.
> >>
> >> Remove "/output" entry from the main .gitignore file as it is already
> >> handled by this general approach.
> >
> > What are you trying to achieve with this that does not work currently?
>
>   I you do `make O=output-test-mypkg` (which I do quite a lot), that output
> directory doesn't get ignored by git. We could ignore output* but maybe you name
> the output directory o-foo or something.
>
>   Putting a .gitignore in a generated directory is a very elegant solution for
> that. It is used by e.g. virtualenv, pytest, and a load of other applications
> that generate output in a directory.
>
>   Since the .gitignore is created in the output directory, it is no longer
> necessary to put output/ in the .gitignore file.
>
>
>   All of the above could be put in the commit message, of course, but for me
> Yegor's commit message was sufficiently clear :-)

Were we able to convince you?

Regards,
Yegor

>   Regards,
>   Arnout
>
>
> >
> > Regards,
> > Yann E. MORIN.
> >
> >> Signed-off-by: Yegor Yefremov <yegorslists@googlemail.com>
> >> ---
> >>   .gitignore | 1 -
> >>   Makefile   | 3 +++
> >>   2 files changed, 3 insertions(+), 1 deletion(-)
> >>
> >> diff --git a/.gitignore b/.gitignore
> >> index bb02d9f572..14b7ca5040 100644
> >> --- a/.gitignore
> >> +++ b/.gitignore
> >> @@ -1,4 +1,3 @@
> >> -/output
> >>   /dl
> >>   /.auto.deps
> >>   /.config.cmd
> >> diff --git a/Makefile b/Makefile
> >> index ac625152c6..86d4444745 100644
> >> --- a/Makefile
> >> +++ b/Makefile
> >> @@ -63,6 +63,9 @@ ifneq ($(findstring @,$(CANONICAL_O)),)
> >>   $(error The build directory can not contain a '@')
> >>   endif
> >>
> >> +# Create a default .gitignore file that ignores everything
> >> +$(shell echo "*" > "$(CANONICAL_O)/.gitignore")
> >> +
> >>   CANONICAL_CURDIR = $(realpath $(CURDIR))
> >>
> >>   REQ_UMASK = 0022
> >> --
> >> 2.34.1
> >>
> >> _______________________________________________
> >> buildroot mailing list
> >> buildroot@buildroot.org
> >> https://lists.buildroot.org/mailman/listinfo/buildroot
> >
_______________________________________________
buildroot mailing list
buildroot@buildroot.org
https://lists.buildroot.org/mailman/listinfo/buildroot

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [Buildroot] [PATCH] Create a .gitignore file in the CANONICAL_O directory
  2024-02-12  9:00     ` Yegor Yefremov via buildroot
@ 2024-02-12 20:07       ` Yann E. MORIN
  2024-02-12 21:51         ` Arnout Vandecappelle via buildroot
  0 siblings, 1 reply; 6+ messages in thread
From: Yann E. MORIN @ 2024-02-12 20:07 UTC (permalink / raw)
  To: Yegor Yefremov; +Cc: buildroot

Yegor, All,

On 2024-02-12 10:00 +0100, Yegor Yefremov via buildroot spake thusly:
> On Tue, Feb 6, 2024 at 2:37 PM Arnout Vandecappelle <arnout@mind.be> wrote:
> > On 06/02/2024 14:30, Yann E. MORIN wrote:
> > > On 2024-02-06 14:20 +0100, yegorslists--- via buildroot spake thusly:
> > >> From: Yegor Yefremov <yegorslists@googlemail.com>
> > >> This .gitignore file ignores all files in an output directory and
> > >> hence doesn't change the git status.
> > > What are you trying to achieve with this that does not work currently?
> >   I you do `make O=output-test-mypkg` (which I do quite a lot), that output
> > directory doesn't get ignored by git. We could ignore output* but maybe you name
> > the output directory o-foo or something.
> >
> >   Putting a .gitignore in a generated directory is a very elegant solution for
> > that. It is used by e.g. virtualenv, pytest, and a load of other applications
> > that generate output in a directory.
> >
> >   Since the .gitignore is created in the output directory, it is no longer
> > necessary to put output/ in the .gitignore file.
> >   All of the above could be put in the commit message, of course, but for me
> > Yegor's commit message was sufficiently clear :-)
> Were we able to convince you?

I now understand the purpose. Saying I'm convinced is another stride.

In my case, I have all my output directories outside of the buildroot
tree. Having a .gitignore in there would be totally useless and
spurious, and would get caught by my (superficial) tests that no unknown
files gets created outside the build/ target/ and such dirs for example.

So there are pros and cons either ways...

Maybe just create .gitignore only if $(O) a sub-dir of $(TOPDIR) ?

Regards,
Yann E. MORIN.

-- 
.-----------------.--------------------.------------------.--------------------.
|  Yann E. MORIN  | Real-Time Embedded | /"\ ASCII RIBBON | Erics' conspiracy: |
| +33 662 376 056 | Software  Designer | \ / CAMPAIGN     |  ___               |
| +33 561 099 427 `------------.-------:  X  AGAINST      |  \e/  There is no  |
| http://ymorin.is-a-geek.org/ | _/*\_ | / \ HTML MAIL    |   v   conspiracy.  |
'------------------------------^-------^------------------^--------------------'
_______________________________________________
buildroot mailing list
buildroot@buildroot.org
https://lists.buildroot.org/mailman/listinfo/buildroot

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [Buildroot] [PATCH] Create a .gitignore file in the CANONICAL_O directory
  2024-02-12 20:07       ` Yann E. MORIN
@ 2024-02-12 21:51         ` Arnout Vandecappelle via buildroot
  0 siblings, 0 replies; 6+ messages in thread
From: Arnout Vandecappelle via buildroot @ 2024-02-12 21:51 UTC (permalink / raw)
  To: Yann E. MORIN, Yegor Yefremov; +Cc: buildroot



On 12/02/2024 21:07, Yann E. MORIN wrote:
> Yegor, All,
> 
> On 2024-02-12 10:00 +0100, Yegor Yefremov via buildroot spake thusly:
>> On Tue, Feb 6, 2024 at 2:37 PM Arnout Vandecappelle <arnout@mind.be> wrote:
>>> On 06/02/2024 14:30, Yann E. MORIN wrote:
>>>> On 2024-02-06 14:20 +0100, yegorslists--- via buildroot spake thusly:
>>>>> From: Yegor Yefremov <yegorslists@googlemail.com>
>>>>> This .gitignore file ignores all files in an output directory and
>>>>> hence doesn't change the git status.
>>>> What are you trying to achieve with this that does not work currently?
>>>    I you do `make O=output-test-mypkg` (which I do quite a lot), that output
>>> directory doesn't get ignored by git. We could ignore output* but maybe you name
>>> the output directory o-foo or something.
>>>
>>>    Putting a .gitignore in a generated directory is a very elegant solution for
>>> that. It is used by e.g. virtualenv, pytest, and a load of other applications
>>> that generate output in a directory.
>>>
>>>    Since the .gitignore is created in the output directory, it is no longer
>>> necessary to put output/ in the .gitignore file.
>>>    All of the above could be put in the commit message, of course, but for me
>>> Yegor's commit message was sufficiently clear :-)
>> Were we able to convince you?
> 
> I now understand the purpose. Saying I'm convinced is another stride.
> 
> In my case, I have all my output directories outside of the buildroot
> tree. Having a .gitignore in there would be totally useless and
> spurious, and would get caught by my (superficial) tests that no unknown
> files gets created outside the build/ target/ and such dirs for example.

  That sounds like something you should update regularly, because we regularly 
add new stuff in the output directory.


> So there are pros and cons either ways...
> 
> Maybe just create .gitignore only if $(O) a sub-dir of $(TOPDIR) ?

  That would be quite complicated, while this patch is pretty simple.

  Regards,
  Arnout

> 
> Regards,
> Yann E. MORIN.
> 
_______________________________________________
buildroot mailing list
buildroot@buildroot.org
https://lists.buildroot.org/mailman/listinfo/buildroot

^ permalink raw reply	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2024-02-12 21:51 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2024-02-06 13:20 [Buildroot] [PATCH] Create a .gitignore file in the CANONICAL_O directory yegorslists--- via buildroot
2024-02-06 13:30 ` Yann E. MORIN
2024-02-06 13:37   ` Arnout Vandecappelle via buildroot
2024-02-12  9:00     ` Yegor Yefremov via buildroot
2024-02-12 20:07       ` Yann E. MORIN
2024-02-12 21:51         ` Arnout Vandecappelle via buildroot

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.