[PATCH] gitignore: allow gitignore to ignore most dot file

Anup Patel anup at brainfault.org
Sat Aug 5 21:46:33 PDT 2023


On Tue, Aug 1, 2023 at 5:11 PM Inochi Amaoto <inochiama at outlook.com> wrote:
>
> Nowadays, most of the editor use files or directories begin with dot to
> store some settings. So let git ignore these files and directories to
> reduce potential mistakes.
>
> Add dot match to ignore any editor file and there are two exceptions:
> - .gitignore
> - .clang-format
>
> Signed-off-by: Inochi Amaoto <inochiama at outlook.com>
> Reviewed-by: Bin Meng <bmeng.cn at gmail.com>

Looks good to me.

Reviewed-by: Anup Patel <anup at brainfault.org>

Applied this patch to the riscv/opensbi repo.

Thanks,
Anup

> ---
> Changed from RFC:
> 1. fix typo
>
> Note:
> 1. AFAIK, the vim swap file is also begin with dot.
> 2. the patch also covers the patch `gitignore: add VSCode workspace dir`
> so that patch is not needed anymore.
> ---
>  .gitignore | 8 +++++++-
>  1 file changed, 7 insertions(+), 1 deletion(-)
>
> diff --git a/.gitignore b/.gitignore
> index c11afd3..fbba52e 100644
> --- a/.gitignore
> +++ b/.gitignore
> @@ -1,3 +1,10 @@
> +# ignore anything begin with dot
> +.*
> +
> +# exceptions we need even begin with dot
> +!.clang-format
> +!.gitignore
> +
>  # Object files
>  *.o
>  *.a
> @@ -10,4 +17,3 @@ install/
>  # Development friendly files
>  tags
>  cscope*
> -*.swp
> --
> 2.41.0
>
>
> --
> opensbi mailing list
> opensbi at lists.infradead.org
> http://lists.infradead.org/mailman/listinfo/opensbi



More information about the opensbi mailing list