tg-files: list files changed by the topic branch

this could also be a --name-only option to tg-patch. But I like the
similarity to 'quilt files'.

Signed-off-by: Bert Wesarg <bert.wesarg@googlemail.com>
Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de>
README: clearify note describing short-comings of tg log

Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de>
provide a global temporary directory

The standard procedure 'tmp=mktemp; trap "rm $tmp" 0' was broken with the
introduction of the pager. Which overwrites the trap itself to close and
remove the pager fifo.

Now tg provides a temp playground and all other temp files should be created
inside this directory and only this directory will be removed with the exit
trap. setup_pager still overwrites the trap, but keeps the rm command from
the global temp directory. To simplify this the new function get_temp() is
provided.

Signed-off-by: Bert Wesarg <bert.wesarg@googlemail.com>
Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de>
cat_file: take -i/-w parameters

This changes the way how cat_file selects the source of the file. It
accepts an optional parameter which is either -i or -w and will react on this
instead of the branch name. tg-patch is updated accordingly and can now
accepts the current branch name as argument with -i or -w given.

cat_file was also broken for the worktree case when we are not in the top level.

Also, tg-patch allowed to be on the top-base branch, but -i and -w doesn't
make sense there too.

Signed-off-by: Bert Wesarg <bert.wesarg@googlemail.com>
Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de>
tg-export: use pretty_tree -b for base

Signed-off-by: Bert Wesarg <bert.wesarg@googlemail.com>
tg-files: simplify arg checking and add sanity check for -i/-w

Signed-off-by: Bert Wesarg <bert.wesarg@googlemail.com>
branch_empty: use pretty_tree and therefore respect -i/-w

Signed-off-by: Bert Wesarg <bert.wesarg@googlemail.com>
tg-patch: use pretty_tree and diff-tree to generate the patch

Signed-off-by: Bert Wesarg <bert.wesarg@googlemail.com>
list_deps: accept -i/-w

Signed-off-by: Bert Wesarg <bert.wesarg@googlemail.com>
tg-summary: accept -i/-w

Signed-off-by: Bert Wesarg <bert.wesarg@googlemail.com>
tg-mail: accept -i/-w

Signed-off-by: Bert Wesarg <bert.wesarg@googlemail.com>
tg-prev/tg-next: commands to explore dependencies

Two new commands to explore the dependencies of TopGit branches:

  a) tg prev [-i | -w] [NAME]
     outputs the dependencies of NAME

  b) tg next [-i | -w] [NAME]
     outputs branches which depends on NAME

Obviously, quilt next was the inspiration.

Signed-off-by: Bert Wesarg <bert.wesarg@googlemail.com>
Merge commit 'index-wt~2' of git://repo.or.cz/topgit/bertw
tg-create: let format.signoff control adding of Signed-off-by

GIT manual stresses that adding of Signed-off-by should be explicit
user decision. Some projects do ask for no Signed-off-by lines. So
make sure it is added by tg-create.sh only when explicity requested
by user.

Signed-off-by: Andrey Borzenkov <arvidjaar@gmail.com>
tg.sh: check for removed branch in branch_annihilated

Check that branch was not deleted by external means; prevents
errors from further git commands due to non-existing refs.

Signed-off-by: Andrey Borzenkov <arvidjaar@gmail.com>
tg-export.sh: support tag objects as parent

Currently tg-export fails with

Collapsing u/quota-pull
fatal: 2770ca86dec8b9cc36bf50127e5aff7f29557e3c is not a valid 'commit' object

Check for and resolve tag objects for parent.

Signed-off-by: Andrey Borzenkov <arvidjaar@gmail.com>
tg-update: add -a support for all branches

Allow branch filtering by pattern (same as git-for-each-ref(1))

Return to original branch after all branches were processed. In case
of error stays on last branch being processed.

Signed-off-by: Andrey Borzenkov <arvidjaar@gmail.com>
Merge branch 'x' into github
tg-update: clarify that there could be multiple PATTERNs
tg-update: strip refs/top-bases/ from PATTERNs just in case