Buildroot Archive on lore.kernel.org
 help / color / mirror / Atom feed
* [Buildroot] [PATCH v2] Create a .gitignore file in the CANONICAL_O directory
@ 2024-02-13 14:30 yegorslists--- via buildroot
  2024-02-13 17:00 ` Yann E. MORIN
  0 siblings, 1 reply; 2+ messages in thread
From: yegorslists--- via buildroot @ 2024-02-13 14:30 UTC (permalink / raw)
  To: buildroot; +Cc: yann.morin.1998, thomas.petazzoni

From: Yegor Yefremov <yegorslists@googlemail.com>

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

The .gitignore file will be only created if $(O) is a subfolder of
$(TOPDIR).

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>
---
Changes v1 -> v2:
    - create .gitignore only if $(O) is a subfolder of $(TOPDIR) (Yann
      E. MORIN)

 .gitignore | 1 -
 Makefile   | 7 +++++++
 2 files changed, 7 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..71764ce1fa 100644
--- a/Makefile
+++ b/Makefile
@@ -65,6 +65,13 @@ endif

 CANONICAL_CURDIR = $(realpath $(CURDIR))

+# Create a default .gitignore file that ignores everything and doesn't make git
+# repository "dirty". Perform this action only if $(O) is a subfolder of
+# $(TOPDIR).
+ifeq ($(realpath $(dir $(CANONICAL_O))),$(CANONICAL_CURDIR))
+$(shell echo "*" > "$(CANONICAL_O)/.gitignore")
+endif
+
 REQ_UMASK = 0022

 # Make sure O= is passed (with its absolute canonical path) everywhere the
--
2.34.1

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

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

end of thread, other threads:[~2024-02-13 17:00 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2024-02-13 14:30 [Buildroot] [PATCH v2] Create a .gitignore file in the CANONICAL_O directory yegorslists--- via buildroot
2024-02-13 17:00 ` Yann E. MORIN

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox