gitignore: Clean up most of the gitignore mess
cover gitignore: Clean up most of the gitignore mess
Daniel Kiper has asked me to provide the following set of four patches:
1. Split patterns into two groups.
2. Alphabetically sort the patterns within each group.
3. Add / to patterns which should have one.
4. Add missing patterns.
However, I found that there was one step missing on the way to an easily readable .gitignore file, so I have added that additional step:
1. Split patterns into two groups.
2. Alphabetically sort the patterns within each group. 2a. Add leading / to all existing slash patterns.
3. Add / to patterns which should have one.
4. Add missing patterns.
Some of the remaining no-slash patterns (i.e. those matching anywhere in the directory tree) might work with a leading slash, but I could not research all of them (especially for old code and optionally built files), so I have left those for now.
Hans Ulrich Niedermann (5):
gitignore: Group patterns with and without slash
gitignore: Sort both pattern groups alphabetically
gitignore: Consistent leading slash is easier to read
gitignore: Add leading slashes where appropriate
gitignore: Add a few forgotten file patterns
.gitignore | 458 +++++++++++++++++++++++++++++------------------------ 1 file changed, 247 insertions(+), 211 deletions(-)
Signature · 1 line
2.25.3
PATCH 1/5 gitignore: Group patterns with and without slash
Group the .gitignore patterns into two groups:
* Patterns including a slash, i.e. matching only relative to the .gitignore file's directory.
* Pattern not including a slash, i.e. matching files anywhere in the .gitignore file's directory and all of its subdirectories.
--- .gitignore | 81 ++++++++++++++++++++++++++++-------------------------- 1 file changed, 42 insertions(+), 39 deletions(-)
.gitignore +42 -39
@@ -1,3 +1,4 @@ +# Ignore patterns in this directory and all subdirectories *~ 00_header 10_*
@@ -30,9 +31,6 @@ config.sub configure core_compress_test DISTLIST -docs/*.info -docs/stamp-vti -docs/version.texi ehci_test example_grub_script_test example_scripted_test
@@ -45,25 +43,18 @@ gensymlist.sh gentrigtables gentrigtables.exe gettext_strings_test -/gnulib grub-bin2h -/grub-bios-setup -/grub-bios-setup.exe grub_cmd_date grub_cmd_echo grub_cmd_regexp grub_cmd_set_date grub_cmd_sleep -/grub-editenv -/grub-editenv.exe grub-emu grub-emu-lite grub-emu.exe grub-emu-lite.exe grub_emu_init.c grub_emu_init.h -/grub-file -/grub-file.exe grub-fstest grub-fstest.exe grub_fstest_init.c
@@ -72,21 +63,10 @@ grub_func_test grub-install grub-install.exe grub-kbdcomp -/grub-macbless -/grub-macbless.exe grub-macho2img -/grub-menulst2cfg -/grub-menulst2cfg.exe -/grub-mk* grub-mount -/grub-ofpathname -/grub-ofpathname.exe -grub-core/build-grub-pe2elf.exe -/grub-probe -/grub-probe.exe grub_probe_init.c grub_probe_init.h -/grub-reboot grub_script_blanklines grub_script_blockarg grub_script_break
@@ -128,26 +108,20 @@ grub-shell grub-shell-tester grub-sparc64-setup grub-sparc64-setup.exe -/grub-syslinux2cfg -/grub-syslinux2cfg.exe gzcompress_test hddboot_test help_test *.img *.image *.image.exe -include/grub/cpu -include/grub/machine INSTALL.grub install-sh -lib/libgcrypt-grub libgrub_a_init.c *.log *.lst lzocompress_test *.marker Makefile -/m4 *.mod mod-*.c missing
@@ -159,14 +133,6 @@ partmap_test pata_test *.pf2 *.pp -po/*.mo -po/grub.pot -po/Makefile.in.in -po/Makevars -po/Makevars.template -po/POTFILES -po/Rules-quot -po/stamp-po printf_test priority_queue_unit_test pseries_test
@@ -190,13 +156,53 @@ compile depcomp mdate-sh texinfo.tex -grub-core/lib/libgcrypt-grub .deps .deps-util .deps-core .dirstamp Makefile.util.am contrib +widthspec.bin +widthspec.h +Makefile.utilgcry.def + +# Ignore patterns relative to this .gitignore file's directory +docs/*.info +docs/stamp-vti +docs/version.texi +/gnulib +/grub-bios-setup +/grub-bios-setup.exe +/grub-editenv +/grub-editenv.exe +/grub-file +/grub-file.exe +/grub-macbless +/grub-macbless.exe +/grub-menulst2cfg +/grub-menulst2cfg.exe +/grub-mk* +/grub-ofpathname +/grub-ofpathname.exe +grub-core/build-grub-pe2elf.exe +/grub-probe +/grub-probe.exe +/grub-reboot +/grub-syslinux2cfg +/grub-syslinux2cfg.exe +include/grub/cpu +include/grub/machine +lib/libgcrypt-grub +/m4 +po/*.mo +po/grub.pot +po/Makefile.in.in +po/Makevars +po/Makevars.template +po/POTFILES +po/Rules-quot +po/stamp-po +grub-core/lib/libgcrypt-grub grub-core/bootinfo.txt grub-core/Makefile.core.am grub-core/Makefile.gcry.def
@@ -214,11 +220,8 @@ grub-core/kernel.img.bin util/bash-completion.d/grub grub-core/lib/gnulib grub-core/rs_decoder.h -widthspec.bin -widthspec.h docs/stamp-1 docs/version-dev.texi -Makefile.utilgcry.def po/*.po po/*.gmo po/LINGUAS
Signature · 1 line
2.25.3
Re: [PATCH 1/5] gitignore: Group patterns with and without slash
Quoted 7 lines · Hans Ulrich Niedermann
Group the .gitignore patterns into two groups:
* Patterns including a slash, i.e. matching only relative to the .gitignore file's directory.
* Pattern not including a slash, i.e. matching files anywhere in the .gitignore file's directory and all of its subdirectories.
I would reverse order of these sentences to make them in line with the order in .gitignore file.
Quoted 123 lines
Signed-off-by Hans Ulrich Niedermann <[email protected]>--- .gitignore | 81 ++++++++++++++++++++++++++++-------------------------- 1 file changed, 42 insertions(+), 39 deletions(-).gitignore +1
-36@@ -1,3 +1,4 @@ +# Ignore patterns in this directory and all subdirectories *~ 00_header 10_*@@ -30,9 +31,6 @@ config.sub configure core_compress_test DISTLIST -docs/*.info -docs/stamp-vti -docs/version.texi ehci_test example_grub_script_test example_scripted_test@@ -45,25 +43,18 @@ gensymlist.sh gentrigtables gentrigtables.exe gettext_strings_test -/gnulib grub-bin2h -/grub-bios-setup -/grub-bios-setup.exe grub_cmd_date grub_cmd_echo grub_cmd_regexp grub_cmd_set_date grub_cmd_sleep -/grub-editenv -/grub-editenv.exe grub-emu grub-emu-lite grub-emu.exe grub-emu-lite.exe grub_emu_init.c grub_emu_init.h -/grub-file -/grub-file.exe grub-fstest grub-fstest.exe grub_fstest_init.c@@ -72,21 +63,10 @@ grub_func_test grub-install grub-install.exe grub-kbdcomp -/grub-macbless -/grub-macbless.exe grub-macho2img -/grub-menulst2cfg -/grub-menulst2cfg.exe -/grub-mk* grub-mount -/grub-ofpathname -/grub-ofpathname.exe -grub-core/build-grub-pe2elf.exe -/grub-probe -/grub-probe.exe grub_probe_init.c grub_probe_init.h -/grub-reboot grub_script_blanklines grub_script_blockarg grub_script_break@@ -128,26 +108,20 @@ grub-shell grub-shell-tester grub-sparc64-setup grub-sparc64-setup.exe -/grub-syslinux2cfg -/grub-syslinux2cfg.exe gzcompress_test hddboot_test help_test *.img *.image *.image.exe -include/grub/cpu -include/grub/machine INSTALL.grub install-sh -lib/libgcrypt-grub libgrub_a_init.c *.log *.lst lzocompress_test *.marker Makefile -/m4 *.mod mod-*.c missing@@ -159,14 +133,6 @@ partmap_test pata_test *.pf2 *.pp -po/*.mo -po/grub.pot -po/Makefile.in.in -po/Makevars -po/Makevars.template -po/POTFILES -po/Rules-quot -po/stamp-po printf_test priority_queue_unit_test pseries_test@@ -190,13 +156,53 @@ compile depcomp mdate-sh texinfo.tex -grub-core/lib/libgcrypt-grub .deps .deps-util .deps-core .dirstamp
.gitignore compile · line 172
Quoted 10 lines
.gitignore +8
-0Makefile.util.am contrib +widthspec.bin +widthspec.h +Makefile.utilgcry.def + +# Ignore patterns relative to this .gitignore file's directory +docs/*.info +docs/stamp-vti +docs/version.texi
You are doing more in this patch than you said in the commit message. Please do not do that. Just one logical change per patch please. I would like to see only currently existing entries prefixed with "/" added here by this patch. One of subsequent patches should move relevant entries from above and add here with "/" prefix.
Quoted 5 lines
.gitignore +5
-0+/gnulib +/grub-bios-setup +/grub-bios-setup.exe +/grub-editenv +/grub-editenv.exe
.gitignore compile · line 187
Quoted 10 lines
.gitignore +10
-0+/grub-file +/grub-file.exe +/grub-macbless +/grub-macbless.exe +/grub-menulst2cfg +/grub-menulst2cfg.exe +/grub-mk* +/grub-ofpathname +/grub-ofpathname.exe +grub-core/build-grub-pe2elf.exe
Ditto...
.gitignore compile · line 195
Quoted 8 lines
.gitignore +8
-0+/grub-probe +/grub-probe.exe +/grub-reboot +/grub-syslinux2cfg +/grub-syslinux2cfg.exe +include/grub/cpu +include/grub/machine +lib/libgcrypt-grub
Ditto and below...
Daniel
Re: [PATCH 1/5] gitignore: Group patterns with and without slash
Quoted 11 lines · Daniel Kiper
Quoted 7 lines · Hans Ulrich Niedermann
Group the .gitignore patterns into two groups:
* Patterns including a slash, i.e. matching only relative to the .gitignore file's directory.
* Pattern not including a slash, i.e. matching files anywhere in the .gitignore file's directory and all of its subdirectories.
I would reverse order of these sentences to make them in line with the order in .gitignore file.
I can fix that before push...
Quoted 131 lines
Quoted 131 lines
Signed-off-by Hans Ulrich Niedermann <[email protected]>--- .gitignore | 81 ++++++++++++++++++++++++++++-------------------------- 1 file changed, 42 insertions(+), 39 deletions(-).gitignore +7
-36@@ -1,3 +1,4 @@ +# Ignore patterns in this directory and all subdirectories *~ 00_header 10_*@@ -30,9 +31,6 @@ config.sub configure core_compress_test DISTLIST -docs/*.info -docs/stamp-vti -docs/version.texi ehci_test example_grub_script_test example_scripted_test@@ -45,25 +43,18 @@ gensymlist.sh gentrigtables gentrigtables.exe gettext_strings_test -/gnulib grub-bin2h -/grub-bios-setup -/grub-bios-setup.exe grub_cmd_date grub_cmd_echo grub_cmd_regexp grub_cmd_set_date grub_cmd_sleep -/grub-editenv -/grub-editenv.exe grub-emu grub-emu-lite grub-emu.exe grub-emu-lite.exe grub_emu_init.c grub_emu_init.h -/grub-file -/grub-file.exe grub-fstest grub-fstest.exe grub_fstest_init.c@@ -72,21 +63,10 @@ grub_func_test grub-install grub-install.exe grub-kbdcomp -/grub-macbless -/grub-macbless.exe grub-macho2img -/grub-menulst2cfg -/grub-menulst2cfg.exe -/grub-mk* grub-mount -/grub-ofpathname -/grub-ofpathname.exe -grub-core/build-grub-pe2elf.exe -/grub-probe -/grub-probe.exe grub_probe_init.c grub_probe_init.h -/grub-reboot grub_script_blanklines grub_script_blockarg grub_script_break@@ -128,26 +108,20 @@ grub-shell grub-shell-tester grub-sparc64-setup grub-sparc64-setup.exe -/grub-syslinux2cfg -/grub-syslinux2cfg.exe gzcompress_test hddboot_test help_test *.img *.image *.image.exe -include/grub/cpu -include/grub/machine INSTALL.grub install-sh -lib/libgcrypt-grub libgrub_a_init.c *.log *.lst lzocompress_test *.marker Makefile -/m4 *.mod mod-*.c missing@@ -159,14 +133,6 @@ partmap_test pata_test *.pf2 *.pp -po/*.mo -po/grub.pot -po/Makefile.in.in -po/Makevars -po/Makevars.template -po/POTFILES -po/Rules-quot -po/stamp-po printf_test priority_queue_unit_test pseries_test@@ -190,13 +156,53 @@ compile depcomp mdate-sh texinfo.tex -grub-core/lib/libgcrypt-grub .deps .deps-util .deps-core .dirstamp Makefile.util.am contrib +widthspec.bin +widthspec.h +Makefile.utilgcry.def + +# Ignore patterns relative to this .gitignore file's directory +docs/*.info
Quoted 8 lines
.gitignore compile · line 172
Quoted 2 lines
.gitignore +2
-0+docs/stamp-vti +docs/version.texiYou are doing more in this patch than you said in the commit message. Please do not do that. Just one logical change per patch please. I would like to see only currently existing entries prefixed with "/" added here by this patch. One of subsequent patches should move relevant entries from above and add here with "/" prefix.
Please ignore that...
Daniel
PATCH 2/5 gitignore: Sort both pattern groups alphabetically
In reply to Hans Ulrich NiedermannAlphabetically sort the two groups of gitignore patterns:
* The group of patterns with slashes, matching relative to the .gitignore file's directory
* The group of patterns without slashes, matching anywhere in the directory subtree.
--- .gitignore | 200 ++++++++++++++++++++++++++--------------------------- 1 file changed, 100 insertions(+), 100 deletions(-)
.gitignore +100 -100
@@ -1,14 +1,42 @@ # Ignore patterns in this directory and all subdirectories +*.1 +*.8 +*.a +*.exec +*.exec.exe +*.image +*.image.exe +*.img +*.log +*.lst +*.marker +*.mod +*.o +*.pf2 +*.pp +*.trs *~ +.deps +.deps-core +.deps-util +.dirstamp 00_header 10_* 20_linux_xen 30_os-prober 40_custom 41_custom -*.1 -*.8 ABOUT-NLS +DISTLIST +GPATH +GRTAGS +GSYMS +GTAGS +INSTALL.grub +Makefile +Makefile.in +Makefile.util.am +Makefile.utilgcry.def aclocal.m4 ahci_test ascii.bitmaps
@@ -20,23 +48,23 @@ build-grub-gen-widthspec build-grub-mkfont cdboot_test cmp_test +compile +config-util.h +config-util.h.in config.cache config.guess config.h -config-util.h -config-util.h.in config.log config.status config.sub configure +contrib core_compress_test -DISTLIST +depcomp ehci_test example_grub_script_test example_scripted_test example_unit_test -*.exec -*.exec.exe fddboot_test genkernsyms.sh gensymlist.sh
@@ -44,34 +72,43 @@ gentrigtables gentrigtables.exe gettext_strings_test grub-bin2h -grub_cmd_date -grub_cmd_echo -grub_cmd_regexp -grub_cmd_set_date -grub_cmd_sleep grub-emu grub-emu-lite -grub-emu.exe grub-emu-lite.exe -grub_emu_init.c -grub_emu_init.h +grub-emu.exe grub-fstest grub-fstest.exe -grub_fstest_init.c -grub_fstest_init.h -grub_func_test grub-install grub-install.exe grub-kbdcomp grub-macho2img grub-mount +grub-script-check +grub-script-check.exe +grub-set-default +grub-shell +grub-shell-tester +grub-sparc64-setup +grub-sparc64-setup.exe +grub_cmd_date +grub_cmd_echo +grub_cmd_regexp +grub_cmd_set_date +grub_cmd_sleep +grub_emu_init.c +grub_emu_init.h +grub_fstest_init.c +grub_fstest_init.h +grub_func_test grub_probe_init.c grub_probe_init.h +grub_script.tab.c +grub_script.tab.h +grub_script.yy.c +grub_script.yy.h grub_script_blanklines grub_script_blockarg grub_script_break -grub-script-check -grub-script-check.exe grub_script_check_init.c grub_script_check_init.h grub_script_comments
@@ -97,86 +134,75 @@ grub_script_strcmp grub_script_test grub_script_vars1 grub_script_while1 -grub_script.tab.c -grub_script.tab.h -grub_script.yy.c -grub_script.yy.h -grub-set-default grub_setup_init.c grub_setup_init.h -grub-shell -grub-shell-tester -grub-sparc64-setup -grub-sparc64-setup.exe gzcompress_test hddboot_test help_test -*.img -*.image -*.image.exe -INSTALL.grub install-sh libgrub_a_init.c -*.log -*.lst lzocompress_test -*.marker -Makefile -*.mod -mod-*.c +mdate-sh missing +mod-*.c netboot_test -*.o -*.a ohci_test partmap_test pata_test -*.pf2 -*.pp printf_test priority_queue_unit_test pseries_test stamp-h -stamp-h1 stamp-h.in +stamp-h1 symlist.c symlist.h +texinfo.tex trigtables.c -*.trs uhci_test -update-grub_lib unidata.c -xzcompress_test -Makefile.in -GPATH -GRTAGS -GSYMS -GTAGS -compile -depcomp -mdate-sh -texinfo.tex -.deps -.deps-util -.deps-core -.dirstamp -Makefile.util.am -contrib +update-grub_lib widthspec.bin widthspec.h -Makefile.utilgcry.def +xzcompress_test # Ignore patterns relative to this .gitignore file's directory docs/*.info +docs/stamp-1 docs/stamp-vti +docs/version-dev.texi docs/version.texi +/garbage-gen +/garbage-gen.exe /gnulib /grub-bios-setup /grub-bios-setup.exe +grub-core/*.module +grub-core/*.module.exe +grub-core/*.pp +grub-core/Makefile.core.am +grub-core/Makefile.gcry.def +grub-core/bootinfo.txt +grub-core/build-grub-module-verifier +grub-core/build-grub-pe2elf.exe +grub-core/contrib +grub-core/gdb_grub +grub-core/genmod.sh +grub-core/gensyminfo.sh +grub-core/gmodule.pl +grub-core/grub.chrp +grub-core/kernel.img.bin +grub-core/lib/gnulib +grub-core/lib/libgcrypt-grub +grub-core/modinfo.sh +grub-core/rs_decoder.h /grub-editenv /grub-editenv.exe /grub-file /grub-file.exe +/grub-fs-tester +/grub-glue-efi +/grub-glue-efi.exe /grub-macbless /grub-macbless.exe /grub-menulst2cfg
@@ -184,57 +210,31 @@ docs/version.texi /grub-mk* /grub-ofpathname /grub-ofpathname.exe -grub-core/build-grub-pe2elf.exe /grub-probe /grub-probe.exe /grub-reboot +/grub-render-label +/grub-render-label.exe /grub-syslinux2cfg /grub-syslinux2cfg.exe include/grub/cpu +include/grub/gcrypt/g10lib.h +include/grub/gcrypt/gcrypt.h include/grub/machine lib/libgcrypt-grub /m4 +po/*.gmo po/*.mo -po/grub.pot +po/*.po +po/LINGUAS po/Makefile.in.in po/Makevars po/Makevars.template po/POTFILES +po/POTFILES-shell.in +po/POTFILES.in po/Rules-quot +po/grub.pot +po/remove-potcdate.sed po/stamp-po -grub-core/lib/libgcrypt-grub -grub-core/bootinfo.txt -grub-core/Makefile.core.am -grub-core/Makefile.gcry.def -grub-core/contrib -grub-core/gdb_grub -grub-core/genmod.sh -grub-core/gensyminfo.sh -grub-core/gmodule.pl -grub-core/grub.chrp -grub-core/modinfo.sh -grub-core/*.module -grub-core/*.module.exe -grub-core/*.pp -grub-core/kernel.img.bin util/bash-completion.d/grub -grub-core/lib/gnulib -grub-core/rs_decoder.h -docs/stamp-1 -docs/version-dev.texi -po/*.po -po/*.gmo -po/LINGUAS -po/remove-potcdate.sed -include/grub/gcrypt/gcrypt.h -include/grub/gcrypt/g10lib.h -po/POTFILES.in -po/POTFILES-shell.in -/grub-glue-efi -/grub-render-label -/grub-glue-efi.exe -/grub-render-label.exe -/garbage-gen -/garbage-gen.exe -/grub-fs-tester -grub-core/build-grub-module-verifier
Signature · 1 line
2.25.3
PATCH 3/5 gitignore: Consistent leading slash is easier to read
In reply to Hans Ulrich NiedermannAs all gitignore patterns containing a left or middle slash match only relative to the .gitignore file's directory, we write them all in the same manner with a leading slash.
This makes the file significantly easier to read.
--- .gitignore | 88 +++++++++++++++++++++++++++--------------------------- 1 file changed, 44 insertions(+), 44 deletions(-)
.gitignore +44 -44
@@ -167,35 +167,35 @@ widthspec.h xzcompress_test # Ignore patterns relative to this .gitignore file's directory -docs/*.info -docs/stamp-1 -docs/stamp-vti -docs/version-dev.texi -docs/version.texi +/docs/*.info +/docs/stamp-1 +/docs/stamp-vti +/docs/version-dev.texi +/docs/version.texi /garbage-gen /garbage-gen.exe /gnulib /grub-bios-setup /grub-bios-setup.exe -grub-core/*.module -grub-core/*.module.exe -grub-core/*.pp -grub-core/Makefile.core.am -grub-core/Makefile.gcry.def -grub-core/bootinfo.txt -grub-core/build-grub-module-verifier -grub-core/build-grub-pe2elf.exe -grub-core/contrib -grub-core/gdb_grub -grub-core/genmod.sh -grub-core/gensyminfo.sh -grub-core/gmodule.pl -grub-core/grub.chrp -grub-core/kernel.img.bin -grub-core/lib/gnulib -grub-core/lib/libgcrypt-grub -grub-core/modinfo.sh -grub-core/rs_decoder.h +/grub-core/*.module +/grub-core/*.module.exe +/grub-core/*.pp +/grub-core/Makefile.core.am +/grub-core/Makefile.gcry.def +/grub-core/bootinfo.txt +/grub-core/build-grub-module-verifier +/grub-core/build-grub-pe2elf.exe +/grub-core/contrib +/grub-core/gdb_grub +/grub-core/genmod.sh +/grub-core/gensyminfo.sh +/grub-core/gmodule.pl +/grub-core/grub.chrp +/grub-core/kernel.img.bin +/grub-core/lib/gnulib +/grub-core/lib/libgcrypt-grub +/grub-core/modinfo.sh +/grub-core/rs_decoder.h /grub-editenv /grub-editenv.exe /grub-file
@@ -217,24 +217,24 @@ grub-core/rs_decoder.h /grub-render-label.exe /grub-syslinux2cfg /grub-syslinux2cfg.exe -include/grub/cpu -include/grub/gcrypt/g10lib.h -include/grub/gcrypt/gcrypt.h -include/grub/machine -lib/libgcrypt-grub +/include/grub/cpu +/include/grub/gcrypt/g10lib.h +/include/grub/gcrypt/gcrypt.h +/include/grub/machine +/lib/libgcrypt-grub /m4 -po/*.gmo -po/*.mo -po/*.po -po/LINGUAS -po/Makefile.in.in -po/Makevars -po/Makevars.template -po/POTFILES -po/POTFILES-shell.in -po/POTFILES.in -po/Rules-quot -po/grub.pot -po/remove-potcdate.sed -po/stamp-po -util/bash-completion.d/grub +/po/*.gmo +/po/*.mo +/po/*.po +/po/LINGUAS +/po/Makefile.in.in +/po/Makevars +/po/Makevars.template +/po/POTFILES +/po/POTFILES-shell.in +/po/POTFILES.in +/po/Rules-quot +/po/grub.pot +/po/remove-potcdate.sed +/po/stamp-po +/util/bash-completion.d/grub
Signature · 1 line
2.25.3
Re: [PATCH 3/5] gitignore: Consistent leading slash is easier to read
Quoted 3 lines · Hans Ulrich Niedermann
As all gitignore patterns containing a left or middle slash match only relative to the .gitignore file's directory, we write them all in the same manner with a leading slash.
Ehhh... And this commit message makes me think that I should withdrew my comment for #1 patch... So, I do it... Sorry for the confusion...
Daniel
PATCH 4/5 gitignore: Add leading slashes where appropriate
In reply to Hans Ulrich NiedermannGoing through the list of gitignore patterns without a slash, this adds a leading slash where it appears to have been forgotten.
Some gitignore patterns like .deps/ or Makefile clearly should match everywhere, so those definitively need no leading slash.
For some patterns like contrib or ascii.bitmaps, it is unclear where in the source tree they should match. Those patterns are kept as they are, matching the patterns in the whole tree of subdirectories.
--- .gitignore | 234 ++++++++++++++++++++++++++--------------------------- 1 file changed, 117 insertions(+), 117 deletions(-)
.gitignore +117 -117
@@ -16,167 +16,95 @@ *.pp *.trs *~ -.deps -.deps-core -.deps-util +.deps/ +.deps-core/ +.deps-util/ .dirstamp -00_header -10_* -20_linux_xen -30_os-prober -40_custom -41_custom -ABOUT-NLS DISTLIST GPATH GRTAGS GSYMS GTAGS -INSTALL.grub Makefile Makefile.in -Makefile.util.am -Makefile.utilgcry.def -aclocal.m4 -ahci_test ascii.bitmaps -ascii.h -autom4te.cache -build-aux -build-grub-gen-asciih -build-grub-gen-widthspec -build-grub-mkfont -cdboot_test -cmp_test -compile -config-util.h -config-util.h.in -config.cache -config.guess -config.h -config.log -config.status -config.sub -configure contrib -core_compress_test -depcomp -ehci_test -example_grub_script_test -example_scripted_test -example_unit_test -fddboot_test genkernsyms.sh gensymlist.sh -gentrigtables -gentrigtables.exe -gettext_strings_test grub-bin2h grub-emu grub-emu-lite grub-emu-lite.exe grub-emu.exe -grub-fstest -grub-fstest.exe -grub-install -grub-install.exe -grub-kbdcomp grub-macho2img -grub-mount -grub-script-check -grub-script-check.exe -grub-set-default -grub-shell -grub-shell-tester -grub-sparc64-setup -grub-sparc64-setup.exe -grub_cmd_date -grub_cmd_echo -grub_cmd_regexp -grub_cmd_set_date -grub_cmd_sleep grub_emu_init.c grub_emu_init.h -grub_fstest_init.c -grub_fstest_init.h -grub_func_test grub_probe_init.c -grub_probe_init.h +grub_probe_inti.h grub_script.tab.c grub_script.tab.h grub_script.yy.c grub_script.yy.h -grub_script_blanklines -grub_script_blockarg -grub_script_break grub_script_check_init.c grub_script_check_init.h -grub_script_comments -grub_script_continue -grub_script_dollar -grub_script_echo1 -grub_script_echo_keywords -grub_script_escape_comma -grub_script_eval -grub_script_expansion -grub_script_final_semicolon -grub_script_for1 -grub_script_functions -grub_script_gettext -grub_script_if -grub_script_leading_whitespace -grub_script_no_commands -grub_script_not -grub_script_return -grub_script_setparams -grub_script_shift -grub_script_strcmp -grub_script_test -grub_script_vars1 -grub_script_while1 grub_setup_init.c grub_setup_init.h -gzcompress_test -hddboot_test -help_test -install-sh -libgrub_a_init.c -lzocompress_test mdate-sh -missing mod-*.c -netboot_test -ohci_test -partmap_test -pata_test -printf_test -priority_queue_unit_test -pseries_test -stamp-h -stamp-h.in -stamp-h1 -symlist.c -symlist.h -texinfo.tex -trigtables.c -uhci_test -unidata.c update-grub_lib widthspec.bin -widthspec.h -xzcompress_test # Ignore patterns relative to this .gitignore file's directory +/00_header +/10_* +/20_linux_xen +/30_os-prober +/40_custom +/41_custom +/ABOUT-NLS +/aclocal.m4 +/ahci_test +/ascii.h +/autom4te.cache/ +/build-aux/ +/build-grub-gen-asciih +/build-grub-gen-widthspec +/build-grub-mkfont +/cdboot_test +/cmp_test +/compile +/config-util.h +/config-util.h.in +/config.cache +/config.guess +/config.h +/config.log +/config.status +/config.sub +/configure +/core_compress_test +/depcomp /docs/*.info /docs/stamp-1 /docs/stamp-vti /docs/version-dev.texi /docs/version.texi +/ehci_test +/example_grub_script_test +/example_scripted_test +/example_unit_test +/fddboot_test /garbage-gen /garbage-gen.exe +/gettext_strings_test /gnulib /grub-bios-setup /grub-bios-setup.exe +/grub_cmd_date +/grub_cmd_echo +/grub_cmd_regexp +/grub_cmd_set_date +/grub_cmd_sleep /grub-core/*.module /grub-core/*.module.exe /grub-core/*.pp
@@ -189,6 +117,8 @@ xzcompress_test /grub-core/gdb_grub /grub-core/genmod.sh /grub-core/gensyminfo.sh +/grub-core/gentrigtables +/grub-core/gentrigtables.exe /grub-core/gmodule.pl /grub-core/grub.chrp /grub-core/kernel.img.bin
@@ -196,18 +126,31 @@ xzcompress_test /grub-core/lib/libgcrypt-grub /grub-core/modinfo.sh /grub-core/rs_decoder.h +/grub-core/symlist.c +/grub-core/symlist.h +/grub-core/trigtables.c +/grub-core/unidata.c /grub-editenv /grub-editenv.exe /grub-file /grub-file.exe /grub-fs-tester +/grub-fstest +/grub-fstest.exe +/grub_fstest_init.c +/grub_fstest_init.h +/grub_func_test /grub-glue-efi /grub-glue-efi.exe +/grub-install +/grub-install.exe +/grub-kbdcomp /grub-macbless /grub-macbless.exe /grub-menulst2cfg /grub-menulst2cfg.exe /grub-mk* +/grub-mount /grub-ofpathname /grub-ofpathname.exe /grub-probe
@@ -215,14 +158,61 @@ xzcompress_test /grub-reboot /grub-render-label /grub-render-label.exe +/grub-script-check +/grub-script-check.exe +/grub_script_blanklines +/grub_script_blockarg +/grub_script_break +/grub_script_comments +/grub_script_continue +/grub_script_dollar +/grub_script_echo1 +/grub_script_echo_keywords +/grub_script_escape_comma +/grub_script_eval +/grub_script_expansion +/grub_script_final_semicolon +/grub_script_for1 +/grub_script_functions +/grub_script_gettext +/grub_script_if +/grub_script_leading_whitespace +/grub_script_no_commands +/grub_script_not +/grub_script_return +/grub_script_setparams +/grub_script_shift +/grub_script_strcmp +/grub_script_vars1 +/grub_script_while1 +/grub_script_test +/grub-set-default +/grub-shell +/grub-shell-tester +/grub-sparc64-setup +/grub-sparc64-setup.exe /grub-syslinux2cfg /grub-syslinux2cfg.exe +/gzcompress_test +/hddboot_test +/help_test +/INSTALL.grub +/install-sh /include/grub/cpu /include/grub/gcrypt/g10lib.h /include/grub/gcrypt/gcrypt.h /include/grub/machine /lib/libgcrypt-grub -/m4 +/libgrub_a_init.c +/lzocompress_test +/m4/ +/Makefile.util.am +/Makefile.utilgcry.def +/missing +/netboot_test +/ohci_test +/partmap_test +/pata_test /po/*.gmo /po/*.mo /po/*.po
@@ -237,4 +227,14 @@ xzcompress_test /po/grub.pot /po/remove-potcdate.sed /po/stamp-po +/printf_test +/priority_queue_unit_test +/pseries_test +/stamp-h +/stamp-h.in +/stamp-h1 +/texinfo.tex +/uhci_test /util/bash-completion.d/grub +/widthspec.h +/xzcompress_test
Signature · 1 line
2.25.3
PATCH 5/5 gitignore: Add a few forgotten file patterns
In reply to Hans Ulrich NiedermannAdd a few patterns to .gitignore to cover files which are generated by building grub ("make", "make check", "make dist") but which have been forgotten in the past.
--- .gitignore | 33 +++++++++++++++++++++++++++++++++ 1 file changed, 33 insertions(+)
.gitignore +33 -0
@@ -59,6 +59,7 @@ widthspec.bin /10_* /20_linux_xen /30_os-prober +/30_uefi-firmware /40_custom /41_custom /ABOUT-NLS
@@ -66,11 +67,13 @@ widthspec.bin /ahci_test /ascii.h /autom4te.cache/ +/btrfs_test /build-aux/ /build-grub-gen-asciih /build-grub-gen-widthspec /build-grub-mkfont /cdboot_test +/ChangeLog /cmp_test /compile /config-util.h
@@ -83,8 +86,11 @@ widthspec.bin /config.sub /configure /core_compress_test +/cpio_test +/date_test /depcomp /docs/*.info +/docs/*.info-[0-9]* /docs/stamp-1 /docs/stamp-vti /docs/version-dev.texi
@@ -93,11 +99,18 @@ widthspec.bin /example_grub_script_test /example_scripted_test /example_unit_test +/exfat_test +/ext234_test +/f2fs_test +/fat_test /fddboot_test +/file_filter_test /garbage-gen /garbage-gen.exe /gettext_strings_test /gnulib +/grub-2.[0-9]*/ +/grub-2.[0-9]*.tar.gz /grub-bios-setup /grub-bios-setup.exe /grub_cmd_date
@@ -105,6 +118,8 @@ widthspec.bin /grub_cmd_regexp /grub_cmd_set_date /grub_cmd_sleep +/grub_cmd_test +/grub_cmd_tr /grub-core/*.module /grub-core/*.module.exe /grub-core/*.pp
@@ -196,20 +211,27 @@ widthspec.bin /gzcompress_test /hddboot_test /help_test +/hfs_test +/hfsplus_test /INSTALL.grub /install-sh /include/grub/cpu /include/grub/gcrypt/g10lib.h /include/grub/gcrypt/gcrypt.h /include/grub/machine +/iso9660_test +/jfs_test /lib/libgcrypt-grub /libgrub_a_init.c /lzocompress_test /m4/ /Makefile.util.am /Makefile.utilgcry.def +/minixfs_test /missing /netboot_test +/nilfs2_test +/ntfs_test /ohci_test /partmap_test /pata_test
@@ -230,11 +252,22 @@ widthspec.bin /printf_test /priority_queue_unit_test /pseries_test +/reiserfs_test +/romfs_test +/squashfs_test /stamp-h /stamp-h.in /stamp-h1 +/syslinux_test +/tar_test +/test_sha512sum +/test_unset +/tests/syslinux/ubuntu10.04_grub.cfg /texinfo.tex +/udf_test /uhci_test /util/bash-completion.d/grub /widthspec.h +/xfs_test /xzcompress_test +/zfs_test
Signature · 1 line
2.25.3
Quoted 17 lines · Hans Ulrich Niedermann
Daniel Kiper has asked me to provide the following set of four patches:
1. Split patterns into two groups.
2. Alphabetically sort the patterns within each group.
3. Add / to patterns which should have one.
4. Add missing patterns.However, I found that there was one step missing on the way to an easily readable .gitignore file, so I have added that additional step:
1. Split patterns into two groups.
2. Alphabetically sort the patterns within each group. 2a. Add leading / to all existing slash patterns.
3. Add / to patterns which should have one.
4. Add missing patterns.
Quoted 4 lines
Some of the remaining no-slash patterns (i.e. those matching anywhere in the directory tree) might work with a leading slash, but I could not research all of them (especially for old code and optionally built files), so I have left those for now.
Except one nit which I fix before push,
"Reviewed-by: Daniel Kiper <[email protected]>" for all...
Daniel