Fix README typo: no reason to use force -B
Compare/contrast git-subtree in HOW DOES THIS WORK

Move phrasing from COMPARE WITH GIT-SUBTREE to HOW DOES THIS WORK.

Mrrrr it's hard balancing writing for both people who do and don't know
about git-subtree. I do think it's important to contrast against
git-subtree for people who are like "wait git-subtree split and merge do
the same thing I think?".
Add separate `git-subhistory assimilate`

Recommend --word-diff-regex='\w+|.' to view diff.

Main reason is for automated test to run without git merge --edit
launching $EDITOR and blocking the automated test.

This might be a good example of pressure to be well-factored by
testability. `git-subhistory merge` is crazy simple, almost literally
just `git-subhistory assimilate "$@" && git merge ASSIMILATE_HEAD`,
`git-subtree assimilate` does just one thing and does it well, and can
be tested in isolation.
Update tests to match new README example

The new README example, in turn, was written specifically with being a
better test case in mind, by illustrating (and testing) what happens to
"stuff outside Sub" and more than one "commit to rewrite".

Add add_and_commit() util function so creating test commits are
one-liners rather than three-liners.
Use trap to remove temp directory on script exit

I just realized that the temporary directory won't be cleaned up on any
error at all, even expected ones like a missing argument.

Turns out there's a POSIX-specified way to do cleanup whenever the
script exits, whether under erroneous conditions or not:
http://pubs.opengroup.org/onlinepubs/007904975/utilities/trap.html
Use $GIT_DIR everywhere, simplifies filter-branch commands

...and uniformizes access to the temporary directory whether from code
running in the git-subhistory.sh environment or in a filter-branch
command.

Bonus: merge_name() is now copied verbatim, no modifications from
git-merge.sh
Indent add_and_commit() with tabs not spaces #indentation #tabsVsSpaces

as per git/Documentation/CodingGuidelines
Fix git checkout not being quiet in summary mode
Move parsing <subproj-path> back into subcommands

Whoops, just realized that unlike 'split', 'merge' and 'assimilate'
should work even if path/to/sub/ doesn't exist at all, like when
importing in somebody else's library as a subproject, or when
transitioning from a submodule to subhistory.

(This just preps for that, that still needs specialized code in
subhistory_assimilate().)

Incredibly, there's appears to be no universal way in shell to normalize
away .'s, ..'s, //'s, etc. in paths, nor is this gaping hole in basic
functionality plugged by any git utilities, cd+pwd appears to be the
best way to do that. (There's a C function, realpath(), which there are
binary wrappers for, and many Linux platforms have readlink, but no
universal builtin that I can find.) This is problematic because
'assimilate', like 'split' shouldn't change the working tree in any way
at all, but needs the path to be normalized (git-read-tree is picky).

It's not a huge deal because the real use of 'assimilate' is 'merge',
which has to create the subdirectory to merge the subproject into
anyway, but it's frustrating because it's not the "right thing" for
'assimilate', and is entirely due to an outrageous limitation of shell
scripting.
Fix assimilating subprojs that weren't from split

like when importing in somebody else's library as a subproject, or when
transitioning from a submodule to subhistory.

Recommend -w to view diff.

Basically, check if "path/to/sub/" has history at all yet, if so do the
original thing, if not just rewrite every commit with its tree moved
under "path/to/sub/" (like the last example of `git help filter-branch`,
but simpler and in a cross-platform way: only GNU sed does what you want
to \t like used in that example, not BSD sed. I should submit a
documentation patch for that).

Also, subhistory_merge() makes sure "path/to/sub/" already exists for
get_path_to_sub() in subhistory_assimilate().