tg-contains.sh: new command to show containing TopGit branch(es)
commitfcea6a5e510285158ae9d8edcc5abddd91ab240d
authorKyle J. McKay <mackyle@gmail.com>
Mon, 13 Mar 2017 11:16:55 +0000 (13 04:16 -0700)
committerKyle J. McKay <mackyle@gmail.com>
Mon, 13 Mar 2017 11:16:55 +0000 (13 04:16 -0700)
tree14ecc257329f63a06eb6df3fe464eab709c1e761
parentd8a2aa937bc5c694714f6d06579089bf51fd8065
tg-contains.sh: new command to show containing TopGit branch(es)

Because TopGit branches are regularly merged into one another
(that's the whole point of the `tg update` command), the output
of `git branch --contains` is usually less than helpful in finding
the TopGit-controlled branch to which a fix should be applied
for a bug introduced by a particular commit.

Such a commit might be the result of running `git bisect` or
some other tool that has identified the source of the problem.

The `git branch --contains` output for such a commit will include
the sought after TopGit branch, but it will also include all
branches it's since been merged into with `tg update`.  When the
TopGit part of the DAG is complex this can cause many extra names
to be output by `git branch --contains` that obscure the elusive
correct result.

Now there's `tg contains` to extract the correct needle from the
`git branch --contains` haystack.

In a TopGit repository with multiple patch series, the -v option
will also provide the TopGit head of the patch series the result
belongs to.  It does, however, require some additional computing
time to come up with that information which is why it's not
enabled by default.

Signed-off-by: Kyle J. McKay <mackyle@gmail.com>
.gitignore
README
tg-contains.sh [new file with mode: 0644]
tg.sh