Hi, 2010/10/4 Uwe Kleine-KÃnig <u.kleine-koenig@xxxxxxxxxxxxxx>: > Hi Bert, > > On Sun, Oct 03, 2010 at 11:25:54PM +0200, Bert Wesarg wrote: >> 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@xxxxxxxxxxxxxx> >> >> --- >> Â.gitignore         |  Â2 + >> ÂREADME           |  Â8 ++++++ >> Âcontrib/tg-completion.bash |  Â1 + >> Âtg-files.sh        Â|  52 ++++++++++++++++++++++++++++++++++++++++++++ >> Â4 files changed, 63 insertions(+), 0 deletions(-) >> >> diff --git a/.gitignore b/.gitignore >> index 0342e09..0dc4d0e 100644 .gitignore >> --- a/.gitignore >> +++ b/.gitignore >> @@ -22,6 +22,8 @@ >> Â/tg-depend.txt >> Â/tg-export >> Â/tg-export.txt >> +/tg-files >> +/tg-files.txt >> Â/tg-import >> Â/tg-import.txt >> Â/tg-info >> diff --git a/README b/README >> index f103d92..46f564a 100644 README >> --- a/README >> +++ b/README >> @@ -272,6 +272,14 @@ tg depend >> >>    TODO: Subcommand for removing dependencies, obviously >> >> +tg files >> +~~~~~~~~ >> +   List files changed by the current or specified topic branch. >> + >> +   Options: >> +    -i      Âlist files based on index instead of branch >> +    -w      Âlist files based on working tree instead of branch >> + >> Âtg info >> Â~~~~~~~ >>    Show a summary information about the current or specified >> diff --git a/contrib/tg-completion.bash b/contrib/tg-completion.bash >> index 0ee233c..38567d0 100755 contrib/tg-completion.bash >> --- a/contrib/tg-completion.bash >> +++ b/contrib/tg-completion.bash >> @@ -467,6 +467,7 @@ _tg () >>    delete)   Â_tg_delete ;; >>    depend)   Â_tg_depend ;; >>    export)   Â_tg_export ;; >> +   files)    _tg_patch ;; >>    help)    Â_tg_help ;; >>    import)   Â_tg_import ;; >>    info)    Â_tg_info ;; >> diff --git a/tg-files.sh b/tg-files.sh >> new file mode 100644 >> index 0000000..0723bf1 tg-files.sh >> --- /dev/null >> +++ b/tg-files.sh >> @@ -0,0 +1,52 @@ >> +#!/bin/sh >> +# TopGit - A different patch queue manager >> +# (c) Petr Baudis <pasky@xxxxxxx> Â2008 >> +# GPLv2 >> + >> +name= >> + >> +topic= >> +diff_opts= >> +diff_committed_only=yes   Â# will be unset for index/worktree >> + >> + >> +## Parse options >> + >> +while [ -n "$1" ]; do >> +   arg="$1"; shift >> +   case "$arg" in >> +   -i) >> +       topic='(i)' >> +       diff_opts="$diff_opts --cached"; >> +       diff_committed_only=;; >> +   -w) >> +       topic='(w)' >> +       diff_committed_only=;; >> +   -*) >> +       echo "Usage: tg [...] files [-i | -w] [NAME]" >&2 >> +       exit 1;; >> +   *) >> +       [ -z "$name" ] || die "name already specified ($name)" >> +       name="$arg";; >> +   esac >> +done >> + >> + >> +[ -n "$name" Â-a Â-z "$diff_committed_only" ] Â&& >> +   die "-i/-w are mutually exclusive with NAME" >> + >> +[ -n "$name" ] || name="$(git symbolic-ref HEAD | sed 's#^refs/\(heads\|top-bases\)/##')" >> +base_rev="$(git rev-parse --short --verify "refs/top-bases/$name" 2>/dev/null)" || >> +   die "not a TopGit-controlled branch" >> + >> +# if not index/worktree, topic is current branch >> +[ -z "$topic" ] && topic="$name" >> + >> + >> + >> +# Evil obnoxious hack to work around the lack of git diff --exclude >> +git diff --name-only $diff_opts "$base_rev" ${diff_committed_only:+"$name"} -- | >> +   fgrep -vx ".topdeps" | >> +   fgrep -vx ".topmsg" || : # fgrep likes to fail randomly? > Instead of using fgrep you could export the branch and call git diff > --name-only $diff_opts on the resulting commit? If you mean using tg-export, than I think this is a bad idea. The operation will than be O(n), with n the total number of depending branches. I think a pretty_tree on the base and the branch with git diff-tree should suffice: git diff-tree --name-only $(pretty_tree refs/top-bases/$name) $(pretty_tree $name) Bert > > Best regards > Uwe > > -- > Pengutronix e.K.              | Uwe Kleine-KÃnig      Â| > Industrial Linux Solutions         | http://www.pengutronix.de/ Â| > -- To unsubscribe from this list: send the line "unsubscribe git" in the body of a message to majordomo@xxxxxxxxxxxxxxx More majordomo info at http://vger.kernel.org/majordomo-info.html