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

+1 -1
View File
@@ -1,4 +1,4 @@
#
# sort with: sort -d -u
# sort with: ../bin/sgi
iocccsize
iocccsize.o
+1 -1
View File
@@ -1,5 +1,5 @@
#
# sort with: sort -d -u
# sort with: ../../bin/sgi
*.dSYM
identify.unl
indent
+2 -2
View File
@@ -1,7 +1,7 @@
#
# sort with: sort -d -u
correct
# sort with: ../../bin/sgi
*.dSYM
correct
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
dg1.Z
guidelines2.txt
+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,7 +1,7 @@
#
# sort with: sort -d -u
apholife
# sort with: ../../bin/sgi
*.dSYM
apholife
indent
indent.c
indent.o
+2 -2
View File
@@ -1,12 +1,12 @@
#
# sort with: sort -d -u
# sort with: ../../bin/sgi
*.dSYM
Darwin
Darwin.alt
FreeBSD
FreeBSD.alt
Linux
Linux.alt
*.dSYM
indent
indent.c
indent.o
+1 -1
View File
@@ -1,5 +1,5 @@
#
# sort with: sort -d -u
# sort with: ../../bin/sgi
*.dSYM
ascii
indent
+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
fib
fib.c
+2 -2
View File
@@ -1,11 +1,11 @@
#
# sort with: sort -d -u
# sort with: ../../bin/sgi
*.dSYM
Eugene_Onegin.txt
IOCCC-Rules-Guidelines.txt
IOCCC-hints.output.txt
IOCCC-hints.txt
Shakespeare.txt
*.dSYM
gru1
gru2
gru3
+1 -1
View File
@@ -1,5 +1,5 @@
#
# sort with: sort -d -u
# sort with: ../../bin/sgi
*.dSYM
indent
indent.c
+4 -4
View File
@@ -1,23 +1,23 @@
#
# sort with: sort -d -u
# sort with: ../../bin/sgi
*.dSYM
a
b
c
d
*.dSYM
e
indent
indent.c
indent.o
input.txt
original.txt
output.txt
output1.txt
output2.txt
output.txt
prog
prog.orig
scrambled.txt
scrambled1.txt
scrambled2.txt
scrambled3.txt
scrambled.txt
unscrambled.txt