diff mbox series

tools/ocaml: Rationalise .gitignore

Message ID 20240906145524.186148-1-andrew.cooper3@citrix.com (mailing list archive)
State New
Headers show
Series tools/ocaml: Rationalise .gitignore | expand

Commit Message

Andrew Cooper Sept. 6, 2024, 2:55 p.m. UTC
The root .gitignore is quite stale from recent (and less recent) removals, but
also fails to work for the forthcoming dynamic plugin work.

Strip all Ocaml content out of the root .gitignore, and provide a more local
.gitignore's with up-to-date patterns.

Signed-off-by: Andrew Cooper <andrew.cooper3@citrix.com>
---
CC: Christian Lindig <christian.lindig@citrix.com>
CC: David Scott <dave@recoil.org>
CC: Edwin Török <edwin.torok@cloud.com>
CC: Rob Hoes <Rob.Hoes@citrix.com>
CC: Andrii Sultanov <andrii.sultanov@cloud.com>

I'm on the fence as to whether put paths.ml in the general ignore, but that
would be making an assumption about future code
---
 .gitignore                       | 28 ----------------------------
 tools/ocaml/.gitignore           |  5 +++++
 tools/ocaml/libs/xc/.gitignore   |  1 +
 tools/ocaml/libs/xs/.gitignore   |  1 +
 tools/ocaml/xenstored/.gitignore |  3 +++
 5 files changed, 10 insertions(+), 28 deletions(-)
 create mode 100644 tools/ocaml/.gitignore
 create mode 100644 tools/ocaml/libs/xc/.gitignore
 create mode 100644 tools/ocaml/libs/xs/.gitignore
 create mode 100644 tools/ocaml/xenstored/.gitignore

Comments

Andrew Cooper Sept. 6, 2024, 3:17 p.m. UTC | #1
On 06/09/2024 3:55 pm, Andrew Cooper wrote:
> diff --git a/tools/ocaml/.gitignore b/tools/ocaml/.gitignore
> new file mode 100644
> index 000000000000..3687c2af4f26
> --- /dev/null
> +++ b/tools/ocaml/.gitignore
> @@ -0,0 +1,5 @@
> +/**/META
> +/**/.ocamldep.make
> +/**/*.annot
> +/**/*.cm[ixao]
> +/**/*.cmx[as]

Ah, having double checked the docs, these would be more idiomatic
without the leading /

I've fixed up locally.

~Andrew
Christian Lindig Sept. 9, 2024, 8:16 a.m. UTC | #2
> On 6 Sep 2024, at 15:55, Andrew Cooper <Andrew.Cooper3@citrix.com> wrote:
> 
> The root .gitignore is quite stale from recent (and less recent) removals, but
> also fails to work for the forthcoming dynamic plugin work.
> 
> Strip all Ocaml content out of the root .gitignore, and provide a more local
> .gitignore's with up-to-date patterns.
> 
> Signed-off-by: Andrew Cooper <andrew.cooper3@citrix.com>
> ---
> CC: Christian Lindig <christian.lindig@citrix.com>
> CC: David Scott <dave@recoil.org>
> CC: Edwin Török <edwin.torok@cloud.com>
> CC: Rob Hoes <Rob.Hoes@citrix.com>
> CC: Andrii Sultanov <andrii.sultanov@cloud.com>

Acked-by: Christian Lindig <christian.lindig@cloud.com>
Edwin Torok Sept. 9, 2024, 12:31 p.m. UTC | #3
On Fri, Sep 6, 2024 at 3:55 PM Andrew Cooper <andrew.cooper3@citrix.com> wrote:
>
> The root .gitignore is quite stale from recent (and less recent) removals, but
> also fails to work for the forthcoming dynamic plugin work.
>
> Strip all Ocaml content out of the root .gitignore, and provide a more local
> .gitignore's with up-to-date patterns.
>
> Signed-off-by: Andrew Cooper <andrew.cooper3@citrix.com>
> ---
> CC: Christian Lindig <christian.lindig@citrix.com>
> CC: David Scott <dave@recoil.org>
> CC: Edwin Török <edwin.torok@cloud.com>
> CC: Rob Hoes <Rob.Hoes@citrix.com>
> CC: Andrii Sultanov <andrii.sultanov@cloud.com>
>
> I'm on the fence as to whether put paths.ml in the general ignore, but that
> would be making an assumption about future code
> ---
>  .gitignore                       | 28 ----------------------------
>  tools/ocaml/.gitignore           |  5 +++++
>  tools/ocaml/libs/xc/.gitignore   |  1 +
>  tools/ocaml/libs/xs/.gitignore   |  1 +
>  tools/ocaml/xenstored/.gitignore |  3 +++
>  5 files changed, 10 insertions(+), 28 deletions(-)
>  create mode 100644 tools/ocaml/.gitignore
>  create mode 100644 tools/ocaml/libs/xc/.gitignore
>  create mode 100644 tools/ocaml/libs/xs/.gitignore
>  create mode 100644 tools/ocaml/xenstored/.gitignore
>
> diff --git a/.gitignore b/.gitignore
> index d8b57e32f888..d88be80b28d6 100644
> --- a/.gitignore
> +++ b/.gitignore
> @@ -92,7 +92,6 @@ stubdom/mini-os-*
>  stubdom/mk-headers-*
>  stubdom/newlib-1.*
>  stubdom/newlib-x86*
> -stubdom/ocaml-*
>  stubdom/pciutils-*
>  stubdom/pkg-config/*
>  stubdom/polarssl-*
> @@ -339,33 +338,6 @@ tools/misc/xen-hvmcrash
>  tools/misc/xen-lowmemd
>  tools/vchan/vchan-node[12]
>  tools/vchan/vchan-socket-proxy
> -tools/ocaml/*/.ocamldep.make
> -tools/ocaml/*/*.cm[ixao]
> -tools/ocaml/*/*.cmxa
> -tools/ocaml/*/*.annot
> -tools/ocaml/*/*/.ocamldep.make
> -tools/ocaml/*/*/*.cm[ixao]
> -tools/ocaml/*/*/*.cmxa
> -tools/ocaml/*/*/*.annot
> -tools/ocaml/*/*/META
> -tools/ocaml/libs/xl/_libxl_types.inc
> -tools/ocaml/libs/xl/_libxl_types.ml.in
> -tools/ocaml/libs/xl/_libxl_types.mli.in
> -tools/ocaml/libs/xl/xenlight.ml
> -tools/ocaml/libs/xl/xenlight.mli
> -tools/ocaml/libs/xentoollog/_xtl_levels.*
> -tools/ocaml/libs/xentoollog/xentoollog.ml
> -tools/ocaml/libs/xentoollog/xentoollog.mli
> -tools/ocaml/libs/xs/paths.ml
> -tools/ocaml/libs/xc/xenctrl_abi_check.h
> -tools/ocaml/xenstored/oxenstored
> -tools/ocaml/xenstored/oxenstored.conf
> -tools/ocaml/xenstored/paths.ml
> -tools/ocaml/test/xtl
> -tools/ocaml/test/send_debug_keys
> -tools/ocaml/test/list_domains
> -tools/ocaml/test/dmesg
> -tools/ocaml/test/raise_exception
>  tools/debugger/kdd/kdd
>  tools/firmware/etherboot/ipxe.tar.gz
>  tools/firmware/etherboot/ipxe/
> diff --git a/tools/ocaml/.gitignore b/tools/ocaml/.gitignore
> new file mode 100644
> index 000000000000..3687c2af4f26
> --- /dev/null
> +++ b/tools/ocaml/.gitignore
> @@ -0,0 +1,5 @@
> +/**/META
> +/**/.ocamldep.make
> +/**/*.annot
> +/**/*.cm[ixao]

There is .cmt too, so:
*.cm[ioxat]

> +/**/*.cmx[as]

There is also this:
*.cmti

.cmt/.cmti files are the newer alternatives to .annot used by tools
like Merlin and the OCaml LSP server to show type information.

Looking through https://github.com/ocaml/ocaml/blob/trunk/.gitignore
we probably have the other wildcards covered in the generic .gitignore
(like *.o, *.a and *.so),
and also it doesn't use the leading **/ either, just '*.cmti' for
example, not sure which is better.

> diff --git a/tools/ocaml/libs/xc/.gitignore b/tools/ocaml/libs/xc/.gitignore
> new file mode 100644
> index 000000000000..1b26ad32b6c3
> --- /dev/null
> +++ b/tools/ocaml/libs/xc/.gitignore
> @@ -0,0 +1 @@
> +/xenctrl_abi_check.h
> diff --git a/tools/ocaml/libs/xs/.gitignore b/tools/ocaml/libs/xs/.gitignore
> new file mode 100644
> index 000000000000..4d556ef38cac
> --- /dev/null
> +++ b/tools/ocaml/libs/xs/.gitignore
> @@ -0,0 +1 @@
> +/paths.ml
> diff --git a/tools/ocaml/xenstored/.gitignore b/tools/ocaml/xenstored/.gitignore
> new file mode 100644
> index 000000000000..2b432de4fc91
> --- /dev/null
> +++ b/tools/ocaml/xenstored/.gitignore
> @@ -0,0 +1,3 @@
> +/oxenstored
> +/oxenstored.conf
> +/paths.ml
> --
> 2.39.2
>
Andrew Cooper Sept. 9, 2024, 1:11 p.m. UTC | #4
On 09/09/2024 1:31 pm, Edwin Torok wrote:
> On Fri, Sep 6, 2024 at 3:55 PM Andrew Cooper <andrew.cooper3@citrix.com> wrote:
>> The root .gitignore is quite stale from recent (and less recent) removals, but
>> also fails to work for the forthcoming dynamic plugin work.
>>
>> Strip all Ocaml content out of the root .gitignore, and provide a more local
>> .gitignore's with up-to-date patterns.
>>
>> Signed-off-by: Andrew Cooper <andrew.cooper3@citrix.com>
>> ---
>> CC: Christian Lindig <christian.lindig@citrix.com>
>> CC: David Scott <dave@recoil.org>
>> CC: Edwin Török <edwin.torok@cloud.com>
>> CC: Rob Hoes <Rob.Hoes@citrix.com>
>> CC: Andrii Sultanov <andrii.sultanov@cloud.com>
>>
>> I'm on the fence as to whether put paths.ml in the general ignore, but that
>> would be making an assumption about future code
>> ---
>>  .gitignore                       | 28 ----------------------------
>>  tools/ocaml/.gitignore           |  5 +++++
>>  tools/ocaml/libs/xc/.gitignore   |  1 +
>>  tools/ocaml/libs/xs/.gitignore   |  1 +
>>  tools/ocaml/xenstored/.gitignore |  3 +++
>>  5 files changed, 10 insertions(+), 28 deletions(-)
>>  create mode 100644 tools/ocaml/.gitignore
>>  create mode 100644 tools/ocaml/libs/xc/.gitignore
>>  create mode 100644 tools/ocaml/libs/xs/.gitignore
>>  create mode 100644 tools/ocaml/xenstored/.gitignore
>>
>> diff --git a/.gitignore b/.gitignore
>> index d8b57e32f888..d88be80b28d6 100644
>> --- a/.gitignore
>> +++ b/.gitignore
>> @@ -92,7 +92,6 @@ stubdom/mini-os-*
>>  stubdom/mk-headers-*
>>  stubdom/newlib-1.*
>>  stubdom/newlib-x86*
>> -stubdom/ocaml-*
>>  stubdom/pciutils-*
>>  stubdom/pkg-config/*
>>  stubdom/polarssl-*
>> @@ -339,33 +338,6 @@ tools/misc/xen-hvmcrash
>>  tools/misc/xen-lowmemd
>>  tools/vchan/vchan-node[12]
>>  tools/vchan/vchan-socket-proxy
>> -tools/ocaml/*/.ocamldep.make
>> -tools/ocaml/*/*.cm[ixao]
>> -tools/ocaml/*/*.cmxa
>> -tools/ocaml/*/*.annot
>> -tools/ocaml/*/*/.ocamldep.make
>> -tools/ocaml/*/*/*.cm[ixao]
>> -tools/ocaml/*/*/*.cmxa
>> -tools/ocaml/*/*/*.annot
>> -tools/ocaml/*/*/META
>> -tools/ocaml/libs/xl/_libxl_types.inc
>> -tools/ocaml/libs/xl/_libxl_types.ml.in
>> -tools/ocaml/libs/xl/_libxl_types.mli.in
>> -tools/ocaml/libs/xl/xenlight.ml
>> -tools/ocaml/libs/xl/xenlight.mli
>> -tools/ocaml/libs/xentoollog/_xtl_levels.*
>> -tools/ocaml/libs/xentoollog/xentoollog.ml
>> -tools/ocaml/libs/xentoollog/xentoollog.mli
>> -tools/ocaml/libs/xs/paths.ml
>> -tools/ocaml/libs/xc/xenctrl_abi_check.h
>> -tools/ocaml/xenstored/oxenstored
>> -tools/ocaml/xenstored/oxenstored.conf
>> -tools/ocaml/xenstored/paths.ml
>> -tools/ocaml/test/xtl
>> -tools/ocaml/test/send_debug_keys
>> -tools/ocaml/test/list_domains
>> -tools/ocaml/test/dmesg
>> -tools/ocaml/test/raise_exception
>>  tools/debugger/kdd/kdd
>>  tools/firmware/etherboot/ipxe.tar.gz
>>  tools/firmware/etherboot/ipxe/
>> diff --git a/tools/ocaml/.gitignore b/tools/ocaml/.gitignore
>> new file mode 100644
>> index 000000000000..3687c2af4f26
>> --- /dev/null
>> +++ b/tools/ocaml/.gitignore
>> @@ -0,0 +1,5 @@
>> +/**/META
>> +/**/.ocamldep.make
>> +/**/*.annot
>> +/**/*.cm[ixao]
> There is .cmt too, so:
> *.cm[ioxat]
>
>> +/**/*.cmx[as]
> There is also this:
> *.cmti
>
> .cmt/.cmti files are the newer alternatives to .annot used by tools
> like Merlin and the OCaml LSP server to show type information.

I've included these.

>
> Looking through https://github.com/ocaml/ocaml/blob/trunk/.gitignore
> we probably have the other wildcards covered in the generic .gitignore
> (like *.o, *.a and *.so),

These are inherited from the top level .gitignore, as Xen is a
predominantly C-oriented project.

> and also it doesn't use the leading **/ either, just '*.cmti' for
> example, not sure which is better.

They're subtly different; it matters for some lines (META and
.ocamldep.make) we've got but not others, so I went for consistency.

~Andrew
diff mbox series

Patch

diff --git a/.gitignore b/.gitignore
index d8b57e32f888..d88be80b28d6 100644
--- a/.gitignore
+++ b/.gitignore
@@ -92,7 +92,6 @@  stubdom/mini-os-*
 stubdom/mk-headers-*
 stubdom/newlib-1.*
 stubdom/newlib-x86*
-stubdom/ocaml-*
 stubdom/pciutils-*
 stubdom/pkg-config/*
 stubdom/polarssl-*
@@ -339,33 +338,6 @@  tools/misc/xen-hvmcrash
 tools/misc/xen-lowmemd
 tools/vchan/vchan-node[12]
 tools/vchan/vchan-socket-proxy
-tools/ocaml/*/.ocamldep.make
-tools/ocaml/*/*.cm[ixao]
-tools/ocaml/*/*.cmxa
-tools/ocaml/*/*.annot
-tools/ocaml/*/*/.ocamldep.make
-tools/ocaml/*/*/*.cm[ixao]
-tools/ocaml/*/*/*.cmxa
-tools/ocaml/*/*/*.annot
-tools/ocaml/*/*/META
-tools/ocaml/libs/xl/_libxl_types.inc
-tools/ocaml/libs/xl/_libxl_types.ml.in
-tools/ocaml/libs/xl/_libxl_types.mli.in
-tools/ocaml/libs/xl/xenlight.ml
-tools/ocaml/libs/xl/xenlight.mli
-tools/ocaml/libs/xentoollog/_xtl_levels.*
-tools/ocaml/libs/xentoollog/xentoollog.ml
-tools/ocaml/libs/xentoollog/xentoollog.mli
-tools/ocaml/libs/xs/paths.ml
-tools/ocaml/libs/xc/xenctrl_abi_check.h
-tools/ocaml/xenstored/oxenstored
-tools/ocaml/xenstored/oxenstored.conf
-tools/ocaml/xenstored/paths.ml
-tools/ocaml/test/xtl
-tools/ocaml/test/send_debug_keys
-tools/ocaml/test/list_domains
-tools/ocaml/test/dmesg
-tools/ocaml/test/raise_exception
 tools/debugger/kdd/kdd
 tools/firmware/etherboot/ipxe.tar.gz
 tools/firmware/etherboot/ipxe/
diff --git a/tools/ocaml/.gitignore b/tools/ocaml/.gitignore
new file mode 100644
index 000000000000..3687c2af4f26
--- /dev/null
+++ b/tools/ocaml/.gitignore
@@ -0,0 +1,5 @@ 
+/**/META
+/**/.ocamldep.make
+/**/*.annot
+/**/*.cm[ixao]
+/**/*.cmx[as]
diff --git a/tools/ocaml/libs/xc/.gitignore b/tools/ocaml/libs/xc/.gitignore
new file mode 100644
index 000000000000..1b26ad32b6c3
--- /dev/null
+++ b/tools/ocaml/libs/xc/.gitignore
@@ -0,0 +1 @@ 
+/xenctrl_abi_check.h
diff --git a/tools/ocaml/libs/xs/.gitignore b/tools/ocaml/libs/xs/.gitignore
new file mode 100644
index 000000000000..4d556ef38cac
--- /dev/null
+++ b/tools/ocaml/libs/xs/.gitignore
@@ -0,0 +1 @@ 
+/paths.ml
diff --git a/tools/ocaml/xenstored/.gitignore b/tools/ocaml/xenstored/.gitignore
new file mode 100644
index 000000000000..2b432de4fc91
--- /dev/null
+++ b/tools/ocaml/xenstored/.gitignore
@@ -0,0 +1,3 @@ 
+/oxenstored
+/oxenstored.conf
+/paths.ml