Re: [TopGit PATCH] tg redepend: New command.
- From
Bert Wesarg <bert.wesarg@googlemail.com>
- Date
- Sep 1, 2008, 09:31 UTC
- Message-ID
- <36ca99e90809010231o439ab4acsaa3027366c551ff6@mail.gmail.com>
- In-Reply-To
- <1218808427.25300.2.camel@heerbeest>
Hi,
On Fri, Aug 15, 2008 at 15:53, Jan Nieuwenhuizen <janneke-list@xs4all.nl> wrote:
Show 7 quoted lines
> As discussed previously > > http://kerneltrap.org/mailarchive/git/2008/8/13/2925144 > > Change a topgit branch's dependencies by doing a rebase-by-merge. > >
is this script in use by you, or is it abandoned in favor of another idea?
Anyway, I have tried it today but it looks like the top-bases wasn't updated to the new deps. It points still to the old base. Second, I got an empty line in my .topdeps file.
Show 15 quoted lines
> +
> +if [ -n "$add" ]; then
> + add="${add/# }"
> + add="${add// / }"
> + dupes=$(grep -E "^${add// /|}/\$" "$root_dir/.topdeps" | tr '\n' ' ')
> + [ -z "$dupes" ] || die "already depend on: $dupes"
> + redeps=$(echo "$add" | cat "$root_dir/.topdeps" - | tr '\n' ' ' | sed -e 's/ \+$//')
> +elif [ -n "$remove" ]; then
> + remove="${remove// / }"
> + remove="${remove/# }"
> + avail=$(grep -E "^${remove// /|}/\$" "$root_dir/.topdeps" | sort | tr '\n' ' ')
> + remove_sorted=$(echo "$remove" | tr ' ' '\n' | grep -v '^$' | sort | tr '\n' ' ')
> + [ "$avail" = "$remove_sorted" ] || die "not depending on some of: $remove"
> + redeps=$(grep -vE "^${remove// /|}/\$" "$root_dir/.topdeps" | tr '\n' ' ')
> +fiIMHO all these "| tr '\n' ' '" aren't needed. bash do the right thing here.
Bert