Now allows to not overwrite files.
Now allows sed options to be passed to sed.
Allows specifying path to sed.
This script now has its own repo at https://github.com/xexyl/sgit. I
don't expect many people to use it but it seemed like it was worthy of a
repo as it is a pretty handy script (though far from perfect).
New version of sgit.
Script now allows for spaces in sed commands. Thus one can do something
like:
sgit -v3 -x -e 's/web site/website/g' .
to set verbosity to level 3, turn on tracing (see below) and change
occurrences of 'web site' to be 'website'.
Also added -x option to turn on tracing.
This is because it is macOS and it's indeed what OS I explained how to
get the entry to compile under. It might not matter much but since we're
making things consistent (this same change might need to be done
elsewhere) and as correct as possible this commit seems good.
My first 41st, 51st and 29th (all depending on the base) birthday
updates (possibly more will follow but this is not a certainty). All the
1990 entries now compile!
In one we used a patch from Yusuke Endoh (thank you Yusuke!) which we
credited him in the README and in another we used a tip from him (use
-ansi at the compiler line) to get the other to compile (again, thank
you Yusuke!). We fixed the others. In the case of 1990/tbr/tbr.c the
author had supplied a shorter version and we fixed that one too.
Added 1990/.gitignore which has the built files of 1990 so that after
doing `cd 1990 ; make all' running `git status .' will not show any
untracked files.
Since the original program does not compile and more than one of us
fixed it (the judges and me and probably others as well) and the fix is
in stein.c we remove the stein.orig.c.
Updated Makefile so this would not be a problem. Updated README.md to
not refer to make alt.
Accidentally committed absolute path of sed.
Also it now shows the sed commands with high enough -v level. This is to
help with a strange problem I discovered (not fixed yet).
Script no longer requires GNU sed but works with other sed
implementations as well (only other one tested is macOS however).
Uses getopts to parse options. Usage is now:
usage: sgit [-h] [-V] [-v level] [-e command] <glob...>
-h print help and exit
-V print version and exit
-v level set verbosity level
-e command append sed command to execute on globs
which means that yes one can specify more than one glob. As long as one
sed command is specified (chose -e to match sed) and one arg is
specified after the last option then the command line is okay (whether
the sed command or file is okay is another matter entirely).
Verbose output to help test / debug features or if just interested in
what's being done.
Added Makefiles for 1990 entries.
In a some cases the source code was modified.
Modified 1990 README.md files.
In some cases the program still cannot be compiled.
In `2011/borsanyi/README.md` there was a German UTF-8
character that was replaced by ASCII "ss".
This character prevented Jekyll::Converters::Markdown as in:
```
Conversion error: Jekyll::Converters::Markdown encountered an error while converting '2011/borsanyi/README.md':
1054
The source text contains invalid characters for the used encoding UTF-8
1055
/usr/local/bundle/gems/kramdown-2.3.2/lib/kramdown/parser/base.rb:93:in `adapt_source': The source text contains invalid characters for the used encoding UTF-8 (RuntimeError)
...
```
The file `2001/ollinger/README.md` contained a single lower case
small letter e with a acute mark as defined by the UTF-8 character
for the 2 bytes: 0xc3 0xa9.
Replaced the RAW UTF-8 character: "LATIN SMALL LETTER E WITH ACUTE"
with the HTML "é". Not sure what the best way to handle this,
however.
This character crashed markdown tools such as _qlmarkdown_
AND it prevented GitHub from rendering the web site. GitHub
reported in "Build with Jekyll":
```
Conversion error: Jekyll::Converters::Markdown encountered an error while converting '2001/ollinger/README.md':
847
The source text contains invalid characters for the used encoding UTF-8
848
/usr/local/bundle/gems/kramdown-2.3.2/lib/kramdown/parser/base.rb:93:in `adapt_source': The source text contains invalid characters for the used encoding UTF-8 (RuntimeError)
849
from /usr/local/bundle/gems/kramdown-2.3.2/lib/kramdown/parser/kramdown.rb:90:in `parse'
850
from /usr/local/bundle/gems/kramdown-parser-gfm-1.1.0/lib/kramdown/parser/gfm.rb:56:in `parse'
851
from /usr/local/bundle/gems/kramdown-2.3.2/lib/kramdown/parser/base.rb:69:in `parse'
852
from /usr/local/bundle/gems/kramdown-2.3.2/lib/kramdown/document.rb:102:in `initialize'
853
from /usr/local/bundle/gems/jekyll-3.9.3/lib/jekyll/converters/markdown/kramdown_parser.rb:42:in `new'
854
from /usr/local/bundle/gems/jekyll-3.9.3/lib/jekyll/converters/markdown/kramdown_parser.rb:42:in `convert'
855
from /usr/local/bundle/gems/jekyll-3.9.3/lib/jekyll/converters/markdown.rb:77:in `convert'
856
from /usr/local/bundle/gems/jekyll-3.9.3/lib/jekyll/renderer.rb:101:in `block in convert'
857
from /usr/local/bundle/gems/jekyll-3.9.3/lib/jekyll/renderer.rb:99:in `each'
858
from /usr/local/bundle/gems/jekyll-3.9.3/lib/jekyll/renderer.rb:99:in `reduce'
859
from /usr/local/bundle/gems/jekyll-3.9.3/lib/jekyll/renderer.rb:99:in `convert'
860
from /usr/local/bundle/gems/jekyll-3.9.3/lib/jekyll/renderer.rb:83:in `render_document'
861
from /usr/local/bundle/gems/jekyll-3.9.3/lib/jekyll/renderer.rb:62:in `run'
862
from /usr/local/bundle/gems/jekyll-3.9.3/lib/jekyll/site.rb:479:in `render_regenerated'
863
from /usr/local/bundle/gems/jekyll-3.9.3/lib/jekyll/site.rb:472:in `block in render_pages'
864
from /usr/local/bundle/gems/jekyll-3.9.3/lib/jekyll/site.rb:471:in `each'
865
from /usr/local/bundle/gems/jekyll-3.9.3/lib/jekyll/site.rb:471:in `render_pages'
866
from /usr/local/bundle/gems/jekyll-3.9.3/lib/jekyll/site.rb:192:in `render'
867
from /usr/local/bundle/gems/jekyll-3.9.3/lib/jekyll/site.rb:71:in `process'
868
from /usr/local/bundle/gems/jekyll-3.9.3/lib/jekyll/command.rb:28:in `process_site'
869
from /usr/local/bundle/gems/jekyll-3.9.3/lib/jekyll/commands/build.rb:65:in `build'
870
from /usr/local/bundle/gems/jekyll-3.9.3/lib/jekyll/commands/build.rb:36:in `process'
871
from /usr/local/bundle/gems/github-pages-228/bin/github-pages:70:in `block (3 levels) in <top (required)>'
872
from /usr/local/bundle/gems/mercenary-0.3.6/lib/mercenary/command.rb:220:in `block in execute'
873
from /usr/local/bundle/gems/mercenary-0.3.6/lib/mercenary/command.rb:220:in `each'
874
from /usr/local/bundle/gems/mercenary-0.3.6/lib/mercenary/command.rb:220:in `execute'
875
from /usr/local/bundle/gems/mercenary-0.3.6/lib/mercenary/program.rb:42:in `go'
876
from /usr/local/bundle/gems/mercenary-0.3.6/lib/mercenary.rb:19:in `program'
877
from /usr/local/bundle/gems/github-pages-228/bin/github-pages:6:in `<top (required)>'
878
from /usr/local/bundle/bin/github-pages:23:in `load'
879
from /usr/local/bundle/bin/github-pages:23:in `<main>'
```
Added `bin/sgit`.
This directory is NOT intended to become a huge software project
right now. For now it is just a convenient place to store tools.
Please avoid overthinking, over documenting tools under bin.
Later on there will be a tool that builds links in the web site
from JSON files, perhaps forms HTML files from markdown files, etc.
However we will have to make major progress on issue #1, issue #2,
issue #3 and issue #4 before such code can be written.
In some cases tools put under bin might go away later on
if they are no longer needed.
Probably one of the most requested mods was to merge years-spoiler.html
with years.html as how an entry does what it does, not what it does
at a high level is what is important.
This mod also allows us to maintain only one file for entry info.
The archive/archive-YYYY.tar.bz2 compressed tarballs
came from the old IOCCC web site files of the form
YYYY/YYYY.tar.bz2.
The directories archive/YYYY/ are added to .gitignore
so that one may unpack all of the archives without
adding content to this repo.
TODO: Mention the archive/archive-YYYY.tar.bz2 compressed tarballs
on the web site. Perhaps a archive/README.md file would be best.
Added `bin/sgit`.
This directory is NOT intended to become a huge software project
right now. For now it is just a convenient place to store tools.
Please avoid overthinking, over documenting tools under bin.
Later on there will be a tool that builds links in the web site
from JSON files, perhaps forms HTML files from markdown files, etc.
However we will have to make major progress on issue #1, issue #2,
issue #3 and issue #4 before such code can be written.
In some cases tools put under bin might go away later on
if they are no longer needed.
Probably one of the most requested mods was to merge years-spoiler.html
with years.html as how an entry does what it does, not what it does
at a high level is what is important.
This mod also allows us to maintain only one file for entry info.
The archive/archive-YYYY.tar.bz2 compressed tarballs
came from the old IOCCC web site files of the form
YYYY/YYYY.tar.bz2.
The directories archive/YYYY/ are added to .gitignore
so that one may unpack all of the archives without
adding content to this repo.
TODO: Mention the archive/archive-YYYY.tar.bz2 compressed tarballs
on the web site. Perhaps a archive/README.md file would be best.
There were two instructions for building but the one (with the compiler
line) did not work any more and once fixed it appears to be the same as
what the Makefile does so I've removed that example.
As well I fixed the file to refer to 'biggar' and not 'markb'.
To get it to compile we have to pass to the compiler -include unistd.h.
To get it to compile without warnings we had to add -Wno-parentheses to
the compiler invocation.
Updated the README to include an example invocation (using the program
source itself) as the old way no longer works (typing in long lines
directly).
Removed some comments that turn out to not be true (it does not need a
K&R compiler for instance).