Re: [TopGit PATCH 1/4] provide fan-in and -out traversal interface

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



2010/10/5 Uwe Kleine-KÃnig <u.kleine-koenig@xxxxxxxxxxxxxx>:
> On Tue, Oct 05, 2010 at 12:28:17AM +0200, Bert Wesarg wrote:
>> This adds general functions to get the list of all offending branches for
> Is offending the right word here? ÂI don't understand that.

I'm unsure about the right wording here too. 'offending' is definitive
the wrong word here. Somethink like this may be better:

This adds general functions to get the list of all branches which
either depends on a given one (fan-in), or all dependencies of a given
one (fan-out).

>
>> a given one. Either which depends on the given branch (fan-in) or all
>> dependencies (fan-out).
>>
>> Two simple users are provided which just lists the names or generates dot
>> input.
> This should then be used for tg summary --graphviz, too, doesn't it?

No. tg summary --graphviz outputs the whole graph. These will generate
only a subgraph based on a given topic. tg summary does not take a
topic as argument.

>
>>
>> Signed-off-by: Bert Wesarg <bert.wesarg@xxxxxxxxxxxxxx>
>>
>> ---
>> Âtg.sh | Â170 +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
>> Â1 files changed, 170 insertions(+), 0 deletions(-)
>>
>> diff --git a/tg.sh b/tg.sh
>> index 3718702..926b31b 100644 tg.sh
>> --- a/tg.sh
>> +++ b/tg.sh
>> @@ -351,6 +351,176 @@ setup_pager()
>> Â Â Â trap "exec >&-; rm \"$_pager_fifo\"; rmdir \"$_pager_fifo_dir\"; wait" EXIT
>> Â}
>>
>> +# traverse_fan_out(for_each_name, for_each_dep, name, head_deps)
> This uses an unusual format.
>
> please make it
>
> # traverse_fan_out FOR_EACH_NAME FOR_EACH_DEP NAME HEAD_DEPS
>

Yes. this makes it more consistent.

>> +#
>> +# traverse the dependencies of @name in bfs order and call @for_each_name
>> +# on each dep (i.e. node) and @for_each_dep on all dependencies (i.e. edge)
>> +# with source and dest as arguments.
>> +#
>> +# @name' needs to be a TopGit controlled branch
>> +#
>> +# @head_deps specifies where to take the .topdeps from for the HEAD branch
>> +# empty - from the committed tree
>> +# '(i)' - from the index
>> +# '(w)' - from the working dir
>> +#
>> +traverse_fan_out()
>> +{
>> + Â Â local for_each_name=$1
>> + Â Â local for_each_dep=$2
>> + Â Â local name=$3
>> + Â Â local head_deps=$4 || :
>> + Â Â local deps_src
>> + Â Â local head="$(git symbolic-ref HEAD | sed 's#^refs/\(heads\|top-bases\)/##')" || :
> I don't remember the exact problems, but some shells get using local and
> assignment in a single command wrong. ÂCan you please fix that up? Â(I
> fixed that up for one of your commits.)

Yes, that should be the right thing to do.

Bert
--
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


[Index of Archives]     [Linux Kernel Development]     [Gcc Help]     [IETF Annouce]     [DCCP]     [Netdev]     [Networking]     [Security]     [V4L]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux SCSI]     [Fedora Users]