* [PATCH TopGit 1/3] tg-push: remove useless warning of missing bases for non-tgish branches
@ 2009-05-27 8:16 Bert Wesarg
2009-05-27 8:16 ` [TopGit PATCH v2 2/3] tg-push: prevent multiple occurences of branches Bert Wesarg
0 siblings, 1 reply; 5+ messages in thread
From: Bert Wesarg @ 2009-05-27 8:16 UTC (permalink / raw)
To: Petr Baudis, Petr Baudis
Cc: Bert Wesarg, git, martin f krafft, Uwe Kleine-Koenig, Marc Weber
Signed-off-by: Bert Wesarg <bert.wesarg@googlemail.com>
---
tg-push.sh | 6 +-----
1 files changed, 1 insertions(+), 5 deletions(-)
diff --git a/tg-push.sh b/tg-push.sh
index 8d09a02..40849ae 100644
--- a/tg-push.sh
+++ b/tg-push.sh
@@ -51,12 +51,8 @@ push_branch()
$tgish_deps_only && [ -z "$_dep_is_tgish" ] && return 0
echo "$_dep"
- local base="top-bases/$_dep"
- if ref_exists "$base"; then
+ [ -z "$_dep_is_tgish" ] ||
echo "top-bases/$_dep"
- else
- echo "warning, no base found $base" 1>&2
- fi
}
for name in $branches; do
--
tg: (b725fc9..) bw/push-remove-useless-warning (depends on: master)
^ permalink raw reply related [flat|nested] 5+ messages in thread
* [TopGit PATCH v2 2/3] tg-push: prevent multiple occurences of branches
2009-05-27 8:16 [PATCH TopGit 1/3] tg-push: remove useless warning of missing bases for non-tgish branches Bert Wesarg
@ 2009-05-27 8:16 ` Bert Wesarg
2009-05-27 8:17 ` [TopGit PATCH v2 3/3] tg-push: handle non-tgish branches Bert Wesarg
2009-05-28 7:23 ` [TopGit PATCH v2 2/3] tg-push: prevent multiple occurences of branches Uwe Kleine-König
0 siblings, 2 replies; 5+ messages in thread
From: Bert Wesarg @ 2009-05-27 8:16 UTC (permalink / raw)
To: Petr Baudis, Petr Baudis
Cc: Bert Wesarg, git, martin f krafft, Uwe Kleine-Koenig, Marc Weber
So, I finally tried the tg-push and got a lot of warnings and errors:
warning, no base found top-bases/master
warning, no base found top-bases/master
warning, no base found top-bases/master
warning, no base found top-bases/master
warning, no base found top-bases/master
warning, no base found top-bases/master
warning, no base found top-bases/master
warning, no base found top-bases/master
warning, no base found top-bases/master
warning, no base found top-bases/master
warning, no base found top-bases/master
error: Ref refs/heads/master is at b725fc951a37854fc65945ac5bcab3bc61ccbd94 but expected 0000000000000000000000000000000000000000
error: failed to lock refs/heads/master
error: Ref refs/heads/master is at b725fc951a37854fc65945ac5bcab3bc61ccbd94 but expected 0000000000000000000000000000000000000000
error: failed to lock refs/heads/master
error: Ref refs/heads/master is at b725fc951a37854fc65945ac5bcab3bc61ccbd94 but expected 0000000000000000000000000000000000000000
error: failed to lock refs/heads/master
error: Ref refs/heads/master is at b725fc951a37854fc65945ac5bcab3bc61ccbd94 but expected 0000000000000000000000000000000000000000
error: failed to lock refs/heads/master
error: Ref refs/heads/master is at b725fc951a37854fc65945ac5bcab3bc61ccbd94 but expected 0000000000000000000000000000000000000000
error: failed to lock refs/heads/master
error: Ref refs/heads/master is at b725fc951a37854fc65945ac5bcab3bc61ccbd94 but expected 0000000000000000000000000000000000000000
error: failed to lock refs/heads/master
error: Ref refs/heads/master is at b725fc951a37854fc65945ac5bcab3bc61ccbd94 but expected 0000000000000000000000000000000000000000
error: failed to lock refs/heads/master
error: Ref refs/heads/master is at b725fc951a37854fc65945ac5bcab3bc61ccbd94 but expected 0000000000000000000000000000000000000000
error: failed to lock refs/heads/master
error: Ref refs/heads/master is at b725fc951a37854fc65945ac5bcab3bc61ccbd94 but expected 0000000000000000000000000000000000000000
error: failed to lock refs/heads/master
error: Ref refs/heads/master is at b725fc951a37854fc65945ac5bcab3bc61ccbd94 but expected 0000000000000000000000000000000000000000
error: failed to lock refs/heads/master
error: Ref refs/heads/bw/log is at a16df35cc7009b36f6f71717ae3d9a3dc29987da but expected 0000000000000000000000000000000000000000
error: failed to lock refs/heads/bw/log
error: Ref refs/top-bases/bw/log is at b725fc951a37854fc65945ac5bcab3bc61ccbd94 but expected 0000000000000000000000000000000000000000
error: failed to lock refs/top-bases/bw/log
! [remote rejected] master -> master (failed to lock)
! [remote rejected] master -> master (failed to lock)
! [remote rejected] master -> master (failed to lock)
! [remote rejected] master -> master (failed to lock)
! [remote rejected] master -> master (failed to lock)
! [remote rejected] master -> master (failed to lock)
! [remote rejected] master -> master (failed to lock)
! [remote rejected] master -> master (failed to lock)
! [remote rejected] master -> master (failed to lock)
! [remote rejected] master -> master (failed to lock)
! [remote rejected] bw/log -> bw/log (failed to lock)
! [remote rejected] refs/top-bases/bw/log -> refs/top-bases/bw/log (failed to lock)
Also the result was ok this output is defintive not ok.
To prevent multiple occurences of the same branchname we sort -u these at the
end, as suggested by Uwe.
Regards,
Bert
Signed-off-by: Bert Wesarg <bert.wesarg@googlemail.com>
---
tg-push.sh | 33 +++++++++++++++++++--------------
1 files changed, 19 insertions(+), 14 deletions(-)
diff --git a/tg-push.sh b/tg-push.sh
index 40849ae..8e1b43f 100644
--- a/tg-push.sh
+++ b/tg-push.sh
@@ -45,27 +45,32 @@ for name in $branches; do
ref_exists "$name" || die "detached HEAD? Can't push $name"
done
+_listfile="$(mktemp -t tg-push-listfile.XXXXXX)"
+trap "rm -f \"$_listfile\"" 0
+
push_branch()
{
# if so desired omit non tgish deps
$tgish_deps_only && [ -z "$_dep_is_tgish" ] && return 0
- echo "$_dep"
+ echo "$_dep" >> "$_listfile"
[ -z "$_dep_is_tgish" ] ||
- echo "top-bases/$_dep"
+ echo "top-bases/$_dep" >> "$_listfile"
}
for name in $branches; do
- list="$(
- # deps
- if $recurse_deps; then
- no_remotes=1 recurse_deps push_branch "$name"
- fi
- # current branch
- _dep="$name"
- _dep_is_tgish=1
- push_branch "$name"
- )"
- echo "pushing:"; echo $list
- git push $dry_run "$remote" $list
+ # current branch
+ # re-use push_branch, which expects some pre-defined variables
+ _dep="$name"
+ _dep_is_tgish=1
+ ref_exists "top-bases/$_dep" ||
+ _dep_is_tgish=
+ push_branch "$name"
+
+ # deps
+ $recurse_deps &&
+ no_remotes=1 recurse_deps push_branch "$name"
+
+ # remove multiple occurrences of the same branch
+ sort -u "$_listfile" | xargs git push $dry_run "$remote"
done
--
tg: (8f4fb90..) bw/push-fixes (depends on: bw/push-remove-useless-warning)
^ permalink raw reply related [flat|nested] 5+ messages in thread
* [TopGit PATCH v2 3/3] tg-push: handle non-tgish branches
2009-05-27 8:16 ` [TopGit PATCH v2 2/3] tg-push: prevent multiple occurences of branches Bert Wesarg
@ 2009-05-27 8:17 ` Bert Wesarg
2009-05-28 7:24 ` Uwe Kleine-König
2009-05-28 7:23 ` [TopGit PATCH v2 2/3] tg-push: prevent multiple occurences of branches Uwe Kleine-König
1 sibling, 1 reply; 5+ messages in thread
From: Bert Wesarg @ 2009-05-27 8:17 UTC (permalink / raw)
To: Petr Baudis, Petr Baudis
Cc: Bert Wesarg, git, martin f krafft, Uwe Kleine-Koenig, Marc Weber
tg push dies if you give it a non-tgish branch:
$ tg push -r push-test master
fatal: Not a valid object name refs/top-bases/master
fatal: ambiguous argument '^{tree}': unknown revision or path not in the working tree.
Use '--' to separate paths from revisions
fatal: Not a valid object name master:.topdeps
Fix this.
Signed-off-by: Bert Wesarg <bert.wesarg@googlemail.com>
---
tg-push.sh | 4 ++--
1 files changed, 2 insertions(+), 2 deletions(-)
diff --git a/tg-push.sh b/tg-push.sh
index 8e1b43f..cd208a0 100644
--- a/tg-push.sh
+++ b/tg-push.sh
@@ -67,8 +67,8 @@ for name in $branches; do
_dep_is_tgish=
push_branch "$name"
- # deps
- $recurse_deps &&
+ # deps but only if branch is tgish
+ $recurse_deps && [ -n "$_dep_is_tgish" ] &&
no_remotes=1 recurse_deps push_branch "$name"
# remove multiple occurrences of the same branch
--
tg: (cbca164..) bw/push-fixes-2 (depends on: bw/push-fixes)
^ permalink raw reply related [flat|nested] 5+ messages in thread
* Re: [TopGit PATCH v2 2/3] tg-push: prevent multiple occurences of branches
2009-05-27 8:16 ` [TopGit PATCH v2 2/3] tg-push: prevent multiple occurences of branches Bert Wesarg
2009-05-27 8:17 ` [TopGit PATCH v2 3/3] tg-push: handle non-tgish branches Bert Wesarg
@ 2009-05-28 7:23 ` Uwe Kleine-König
1 sibling, 0 replies; 5+ messages in thread
From: Uwe Kleine-König @ 2009-05-28 7:23 UTC (permalink / raw)
To: Bert Wesarg; +Cc: Petr Baudis, git, martin f krafft, Marc Weber
Hi Bert,
I didn't try, but looks OK. I'd do some commit log massaging, but I can
do that while commiting. I just wait for 1/3.
Thanks
Uwe
--
Pengutronix e.K. | Uwe Kleine-König |
Industrial Linux Solutions | http://www.pengutronix.de/ |
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [TopGit PATCH v2 3/3] tg-push: handle non-tgish branches
2009-05-27 8:17 ` [TopGit PATCH v2 3/3] tg-push: handle non-tgish branches Bert Wesarg
@ 2009-05-28 7:24 ` Uwe Kleine-König
0 siblings, 0 replies; 5+ messages in thread
From: Uwe Kleine-König @ 2009-05-28 7:24 UTC (permalink / raw)
To: Bert Wesarg; +Cc: Petr Baudis, git, martin f krafft, Marc Weber
Hi,
> - # deps
> - $recurse_deps &&
> + # deps but only if branch is tgish
> + $recurse_deps && [ -n "$_dep_is_tgish" ] &&
> no_remotes=1 recurse_deps push_branch "$name"
OK, wait for 1-2/3.
Best regards
Uwe
--
Pengutronix e.K. | Uwe Kleine-König |
Industrial Linux Solutions | http://www.pengutronix.de/ |
^ permalink raw reply [flat|nested] 5+ messages in thread
end of thread, other threads:[~2009-05-28 7:24 UTC | newest]
Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2009-05-27 8:16 [PATCH TopGit 1/3] tg-push: remove useless warning of missing bases for non-tgish branches Bert Wesarg
2009-05-27 8:16 ` [TopGit PATCH v2 2/3] tg-push: prevent multiple occurences of branches Bert Wesarg
2009-05-27 8:17 ` [TopGit PATCH v2 3/3] tg-push: handle non-tgish branches Bert Wesarg
2009-05-28 7:24 ` Uwe Kleine-König
2009-05-28 7:23 ` [TopGit PATCH v2 2/3] tg-push: prevent multiple occurences of branches Uwe Kleine-König
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).