add tool to sort .gitignore content

We sort with lines starting with # first.
We sort with lines starting with * second.
We sort with lines that do not start with [#!*] third.
We sort with lines starting with ! fourth.

Example usage in vim with a keyboard macro <escape>f:

```vim
:map ^[f 1G!G../../bin/sgi^M
```

 or via .vimrc:

```vimrc
" sort the entire .gitignore file using ../../bin/sgi
:map  ^[f 1G!G../../bin/sgi^M
```

 NOTE: The ^[ above is ((Escape)) and ^M is ((Control-M)).

Example usage in shell:

```sh
rm -f t && ../../bin/sgi < .gitignore > t && mv -f t .gitignore
```

Suggested usage:

```sh
bin/all-run.sh bin/sort.gitignore -v 1
```

Sorted all winner .gitignore according to this method.
Sorted all year level .gitignore according to this method.
Sorted top level .gitignore according to this method.
This commit is contained in:
Landon Curt Noll committed 2024-02-01 14:35:49 -08:00
1 parent 5619029d33
commit 657a0be130
341 files changed
+919 -447

No files matched your search

+2 -2
View File
@@ -1,8 +1,8 @@
#
# sort with: sort -d -u
# sort with: ../../bin/sgi
*.dSYM
birken
birken.orig
*.dSYM
indent
indent.c
indent.o
+3 -3
View File
@@ -1,9 +1,9 @@
#
# sort with: sort -d -u
borsanyi
borsanyi.orig
# sort with: ../../bin/sgi
*.dSYM
*.gif
borsanyi
borsanyi.orig
indent
indent.c
indent.o
+1 -1
View File
@@ -1,5 +1,5 @@
#
# sort with: sort -d -u
# sort with: ../../bin/sgi
*.dSYM
grothe
grothe.orig
+1 -1
View File
@@ -1,5 +1,5 @@
#
# sort with: sort -d -u
# sort with: ../../bin/sgi
*.dSYM
hamre
hamre.orig
+1 -1
View File
@@ -1,5 +1,5 @@
#
# sort with: sort -d -u
# sort with: ../../bin/sgi
*.dSYM
indent
indent.c
+1 -1
View File
@@ -1,5 +1,5 @@
#
# sort with: sort -d -u
# sort with: ../../bin/sgi
*.dSYM
indent
indent.c
+1 -1
View File
@@ -1,5 +1,5 @@
#
# sort with: sort -d -u
# sort with: ../../bin/sgi
*.dSYM
indent
indent.c
+1 -1
View File
@@ -1,5 +1,5 @@
#
# sort with: sort -d -u
# sort with: ../../bin/sgi
*.dSYM
indent
indent.c
+3 -3
View File
@@ -1,12 +1,12 @@
#
# sort with: sort -d -u
# sort with: ../../bin/sgi
*.dSYM
*.png
*.xbm
indent
indent.c
indent.o
*.png
prog.orig
stewart
stewart.html
stewart.orig
*.xbm
+2 -2
View File
@@ -1,7 +1,7 @@
#
# sort with: sort -d -u
cube.gif
# sort with: ../../bin/sgi
*.dSYM
cube.gif
indent
indent.c
indent.o
+1 -1
View File
@@ -1,5 +1,5 @@
#
# sort with: sort -d -u
# sort with: ../../bin/sgi
*.dSYM
indent
indent.c
+1 -1
View File
@@ -1,5 +1,5 @@
#
# sort with: sort -d -u
# sort with: ../../bin/sgi
*.dSYM
indent
indent.c
+2 -2
View File
@@ -1,5 +1,6 @@
#
# sort with: sort -d -u
# sort with: ../../bin/sgi
*.dSYM
ADVENTUR/
BASICS/
C
@@ -17,7 +18,6 @@ WS33/
WS33-1/
WS33-2/
WS33-KPR/
*.dSYM
indent
indent.c
indent.o
+1 -1
View File
@@ -1,5 +1,5 @@
#
# sort with: sort -d -u
# sort with: ../../bin/sgi
*.dSYM
indent
indent.c