summary/revert: make --heads DWIM and add alternative
commit3700341ee453526fc915a267ade60de06b370de4
authorKyle J. McKay <mackyle@gmail.com>
Mon, 13 Mar 2017 00:07:48 +0000 (12 17:07 -0700)
committerKyle J. McKay <mackyle@gmail.com>
Mon, 13 Mar 2017 00:07:48 +0000 (12 17:07 -0700)
tree81588df522e3fba4591bc25b918fa31b58b21880
parentbd2e29c8ad73e376de9f0cd9b521301881a4d85a
summary/revert: make --heads DWIM and add alternative

When the TopGit branches are not up-to-date, then using
`git merge-base --independent` to discover what the roots
of the TopGit dependency graph may not work properly.

To get the correct TopGit dependency graph roots, examine
the various .topdeps files instead.  The roots are simply
the TopGit branches that are not mentioned in any of the
.topdeps files.

For `tg summary`, perform the TopGit heads computation
for the `--heads` option as that's what's usually intended
there, but add a new `--heads-independent` option to get
the old `git merge-base --independent` variation as that
can sometimes be useful.

For `tg revert`, however, keep the `git merge-base --independent`
behavior for `--heads` as that's supposed to show independent
heads stored in the tag data.  But add a new `--topgit-heads`
that shows only the roots of the TopGit dependency tree that
are stored in the tag data.  Do, however, make the `--rdeps`
option default to using the new `--topgit-heads` mode since,
in that case, that's likely the expected default.

For usability though `tg revert` will accept --heads-independent
and `tg summary` will accept --topgit-heads too.

Signed-off-by: Kyle J. McKay <mackyle@gmail.com>
README
tg-revert.sh
tg-summary.sh