This page shows the Git graphical repository visualization for Natural Order Comparator, useful for sorting text in an order humans might expect. It also demonstrates proper code safety, documentation, and unit testing.
wpollock@PollockHome ~/winhome/Documents/eclipse-workspace/NatOrderComparator
$ git mylog
Commit: c505e14, Parent(s): , Author: Wayne Pollock, Date: Thu Dec 31 00:13:21 2015 -0500
Initial commit
Commit: c0a658b, Parent(s): c505e14, Author: Wayne Pollock, Date: Thu Dec 31 00:20:50 2015 -0500
Created initial test suite.
Also created skeleton comparator, and added package-info.java package description.
Commit: fa7a06f, Parent(s): c0a658b, Author: Wayne Pollock, Date: Thu Dec 31 00:24:52 2015 -0500
Worked on unit tests, enough to start working on the code itself.
Commit: 6a36836, Parent(s): fa7a06f, Author: Wayne Pollock, Date: Thu Dec 31 03:43:32 2015 -0500
Finished initial (working?) version.
Java doc API HTML looks good.
Still need to review and add more unit tests.
Commit: 90f4074, Parent(s): 6a36836, Author: Wayne Pollock, Date: Tue Jan 5 05:05:35 2016 -0500
Completed unit test suite.
Also fixed copy-paste bug with BigInteger constructor reusing s1 (now uses s2).
Added @Throws to method compare's doc comment, to document it must (by
contract) throw NullPointerException rather than IllegalArgumentException.
Commit: 61c3f92, Parent(s): 90f4074, Author: Wayne Pollock, Date: Tue Jan 5 05:06:31 2016 -0500
Final version.
This version updated the generated Java doc HTML, and added that
directory to .gitignore.
The above Git command used an alias.
Here's how I defined the alias and a custom log format, in my
.gitconfig
file:
$ # Create custom log format, use with alias command: $ git config --global pretty.myfmt \ 'Commit: %h, Parent(s): %p, Author: %an, Date: %ad%n%B%n' $ git config --global alias.mylog \ 'log --pretty=myfmt --full-history --branches --reverse' $ cat .gitconfig [user] name = Wayne Pollock email = pollock@acm.org [core] safecrlf = false [merge] tool = vimdiff [pretty] myfmt = Commit: %h, Parent(s): %p, Author: %an, Date: %ad%n%B%n [alias] mylog = log --pretty=myfmt --full-history --branches --reverse