All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] [TOPGIT] make tg remote idempotent
@ 2009-01-14 21:27 Uwe Kleine-König
  2009-01-14 21:27 ` [PATCH] [TOPGIT] make creating a commit from a topgit branch a function Uwe Kleine-König
  2009-01-21 11:06 ` [PATCH] [TOPGIT] make tg remote idempotent Uwe Kleine-König
  0 siblings, 2 replies; 8+ messages in thread
From: Uwe Kleine-König @ 2009-01-14 21:27 UTC (permalink / raw)
  To: git; +Cc: martin f. krafft, Petr Baudis

Before this patch each call to tg remote added three config entries
no matter if they already existed.  After some time my .git/config was
crowded.

Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de>
---
 tg-remote.sh |    6 +++---
 1 files changed, 3 insertions(+), 3 deletions(-)

diff --git a/tg-remote.sh b/tg-remote.sh
index c3e8bd3..7f7a1b0 100644
--- a/tg-remote.sh
+++ b/tg-remote.sh
@@ -27,9 +27,9 @@ git config "remote.$name.url" >/dev/null || die "unknown remote '$name'"
 
 ## Configure the remote
 
-git config --add "remote.$name.fetch" "+refs/top-bases/*:refs/remotes/$name/top-bases/*"
-git config --add "remote.$name.push" "+refs/top-bases/*:refs/top-bases/*"
-git config --add "remote.$name.push" "+refs/heads/*:refs/heads/*"
+git config --replace-all "remote.$name.fetch" "+refs/top-bases/*:refs/remotes/$name/top-bases/*" "+refs/top-bases/*:refs/remotes/$name/top-bases/*"
+git config --replace-all "remote.$name.push" "+refs/top-bases/*:refs/top-bases/*" "+refs/top-bases/*:refs/top-bases/*"
+git config --replace-all "remote.$name.push" "+refs/heads/*:refs/heads/*" "+refs/heads/*:refs/heads/*"
 
 info "Remote $name can now follow TopGit topic branches."
 if [ -z "$populate" ]; then
-- 
1.5.6.5

^ permalink raw reply related	[flat|nested] 8+ messages in thread

* [PATCH] [TOPGIT] make creating a commit from a topgit branch a function
  2009-01-14 21:27 [PATCH] [TOPGIT] make tg remote idempotent Uwe Kleine-König
@ 2009-01-14 21:27 ` Uwe Kleine-König
  2009-01-21  3:19   ` martin f krafft
  2009-01-21 11:06 ` [PATCH] [TOPGIT] make tg remote idempotent Uwe Kleine-König
  1 sibling, 1 reply; 8+ messages in thread
From: Uwe Kleine-König @ 2009-01-14 21:27 UTC (permalink / raw)
  To: git; +Cc: martin f. krafft, Petr Baudis

This helps avoiding code duplication for the next commit.

Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de>
---
 tg-export.sh |   27 ++++++++++++++++++---------
 1 files changed, 18 insertions(+), 9 deletions(-)

diff --git a/tg-export.sh b/tg-export.sh
index 9e6940f..dea24d9 100644
--- a/tg-export.sh
+++ b/tg-export.sh
@@ -71,14 +71,11 @@ pretty_tree()
 	 git write-tree)
 }
 
-# collapsed_commit NAME
-# Produce a collapsed commit of branch NAME.
-collapsed_commit()
+create_tg_commit()
 {
 	name="$1"
-
-	rm -f "$playground/^pre" "$playground/^post"
-	>"$playground/^body"
+	tree="$2"
+	parent="$3"
 
 	# Get commit message and authorship information
 	git cat-file blob "$name:.topmsg" | git mailinfo "$playground/^msg" /dev/null > "$playground/^info"
@@ -92,6 +89,20 @@ collapsed_commit()
 	test -n "$GIT_AUTHOR_EMAIL" && export GIT_AUTHOR_EMAIL
 	test -n "$GIT_AUTHOR_DATE" && export GIT_AUTHOR_DATE
 
+	(printf '%s\n\n' "$SUBJECT"; cat "$playground/^msg") |
+	git stripspace |
+	git commit-tree "$tree" -p "$parent"
+}
+
+# collapsed_commit NAME
+# Produce a collapsed commit of branch NAME.
+collapsed_commit()
+{
+	name="$1"
+
+	rm -f "$playground/^pre" "$playground/^post"
+	>"$playground/^body"
+
 	# Determine parent
 	parent="$(cut -f 1 "$playground/$name^parents")"
 	if [ "$(cat "$playground/$name^parents" | wc -l)" -gt 1 ]; then
@@ -107,9 +118,7 @@ collapsed_commit()
 	if branch_empty "$name"; then
 		echo "$parent";
 	else
-		(printf '%s\n\n' "$SUBJECT"; cat "$playground/^msg") |
-		git stripspace |
-		git commit-tree "$(pretty_tree "$name")" -p "$parent"
+		create_tg_commit "$name" "$(pretty_tree $name)" "$parent"
 	fi;
 
 	echo "$name" >>"$playground/^ticker"
-- 
1.5.6.5

^ permalink raw reply related	[flat|nested] 8+ messages in thread

* Re: [PATCH] [TOPGIT] make creating a commit from a topgit branch a function
  2009-01-14 21:27 ` [PATCH] [TOPGIT] make creating a commit from a topgit branch a function Uwe Kleine-König
@ 2009-01-21  3:19   ` martin f krafft
  2009-01-21 10:16     ` Uwe Kleine-König
  0 siblings, 1 reply; 8+ messages in thread
From: martin f krafft @ 2009-01-21  3:19 UTC (permalink / raw)
  To: Uwe Kleine-König, git, Petr Baudis

[-- Attachment #1: Type: text/plain, Size: 564 bytes --]

also sprach Uwe Kleine-König <u.kleine-koenig@pengutronix.de> [2009.01.15.0827 +1100]:
> This helps avoiding code duplication for the next commit.

What's the "next commit"?

-- 
 .''`.   martin f. krafft <madduck@d.o>      Related projects:
: :'  :  proud Debian developer               http://debiansystem.info
`. `'`   http://people.debian.org/~madduck    http://vcs-pkg.org
  `-  Debian - when you have better things to do than fixing systems
 
i'd rather be riding a high speed tractor
with a beer on my lap,
and a six pack of girls next to me.

[-- Attachment #2: Digital signature (see http://martin-krafft.net/gpg/) --]
[-- Type: application/pgp-signature, Size: 197 bytes --]

^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: [PATCH] [TOPGIT] make creating a commit from a topgit branch a function
  2009-01-21  3:19   ` martin f krafft
@ 2009-01-21 10:16     ` Uwe Kleine-König
  2009-01-22  0:13       ` martin f krafft
  0 siblings, 1 reply; 8+ messages in thread
From: Uwe Kleine-König @ 2009-01-21 10:16 UTC (permalink / raw)
  To: martin f krafft; +Cc: git, Petr Baudis

On Wed, Jan 21, 2009 at 02:19:13PM +1100, martin f krafft wrote:
> also sprach Uwe Kleine-König <u.kleine-koenig@pengutronix.de> [2009.01.15.0827 +1100]:
> > This helps avoiding code duplication for the next commit.
> 
> What's the "next commit"?
oh, sorry.  I intended to post my patch that implements `tg export
--linearize`, but then found a bug and so didn't send it.

You can find it in my pu branch at

	git://git.pengutronix.de/git/ukl/topgit.git pu

.  It's not yet ready for general use, but I look forward to any
constructive feedback.

Best regards and thanks for the reminder,
Uwe

-- 
Pengutronix e.K.                              | Uwe Kleine-König            |
Industrial Linux Solutions                    | http://www.pengutronix.de/  |
Peiner Strasse 6-8, 31137 Hildesheim, Germany | Phone: +49-5121-206917-0    |
Amtsgericht Hildesheim, HRA 2686              | Fax:   +49-5121-206917-5555 |

^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: [PATCH] [TOPGIT] make tg remote idempotent
  2009-01-14 21:27 [PATCH] [TOPGIT] make tg remote idempotent Uwe Kleine-König
  2009-01-14 21:27 ` [PATCH] [TOPGIT] make creating a commit from a topgit branch a function Uwe Kleine-König
@ 2009-01-21 11:06 ` Uwe Kleine-König
  2009-01-21 14:31   ` martin f krafft
  1 sibling, 1 reply; 8+ messages in thread
From: Uwe Kleine-König @ 2009-01-21 11:06 UTC (permalink / raw)
  To: git; +Cc: martin f. krafft, Petr Baudis

Hello,

On Wed, Jan 14, 2009 at 10:27:22PM +0100, Uwe Kleine-König wrote:
> -git config --add "remote.$name.fetch" "+refs/top-bases/*:refs/remotes/$name/top-bases/*"
> -git config --add "remote.$name.push" "+refs/top-bases/*:refs/top-bases/*"
> -git config --add "remote.$name.push" "+refs/heads/*:refs/heads/*"
> +git config --replace-all "remote.$name.fetch" "+refs/top-bases/*:refs/remotes/$name/top-bases/*" "+refs/top-bases/*:refs/remotes/$name/top-bases/*"
> +git config --replace-all "remote.$name.push" "+refs/top-bases/*:refs/top-bases/*" "+refs/top-bases/*:refs/top-bases/*"
> +git config --replace-all "remote.$name.push" "+refs/heads/*:refs/heads/*" "+refs/heads/*:refs/heads/*"
It seems I sent an old version of this patch.  Actually in the last
argument '+' and '*' have to be quoted to work.

I fixed this in my repo.  Should I resend the fixed patch?

Best regards
Uwe

^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: [PATCH] [TOPGIT] make tg remote idempotent
  2009-01-21 11:06 ` [PATCH] [TOPGIT] make tg remote idempotent Uwe Kleine-König
@ 2009-01-21 14:31   ` martin f krafft
  0 siblings, 0 replies; 8+ messages in thread
From: martin f krafft @ 2009-01-21 14:31 UTC (permalink / raw)
  To: Uwe Kleine-König, git, Petr Baudis

[-- Attachment #1: Type: text/plain, Size: 634 bytes --]

also sprach Uwe Kleine-König <ukleinek@strlen.de> [2009.01.21.2206 +1100]:
> I fixed this in my repo.  Should I resend the fixed patch?

No, I will pull. Cheers,

-- 
 .''`.   martin f. krafft <madduck@d.o>      Related projects:
: :'  :  proud Debian developer               http://debiansystem.info
`. `'`   http://people.debian.org/~madduck    http://vcs-pkg.org
  `-  Debian - when you have better things to do than fixing systems
 
"arthur slapped his arms about himself to try and get his
 circulation a little more enthusiastic about its job."
                                 -- hitchhiker's guide to the galaxy

[-- Attachment #2: Digital signature (see http://martin-krafft.net/gpg/) --]
[-- Type: application/pgp-signature, Size: 197 bytes --]

^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: [PATCH] [TOPGIT] make creating a commit from a topgit branch a function
  2009-01-21 10:16     ` Uwe Kleine-König
@ 2009-01-22  0:13       ` martin f krafft
  0 siblings, 0 replies; 8+ messages in thread
From: martin f krafft @ 2009-01-22  0:13 UTC (permalink / raw)
  To: Uwe Kleine-König; +Cc: git, Petr Baudis

[-- Attachment #1: Type: text/plain, Size: 1027 bytes --]

also sprach Uwe Kleine-König <u.kleine-koenig@pengutronix.de> [2009.01.21.2116 +1100]:
> > What's the "next commit"?
> oh, sorry.  I intended to post my patch that implements `tg export
> --linearize`, but then found a bug and so didn't send it.
> 
> You can find it in my pu branch at
> 
> 	git://git.pengutronix.de/git/ukl/topgit.git pu
> 
> .  It's not yet ready for general use, but I look forward to any
> constructive feedback.

It'll be a while until I can look into this. Until I do, I will only
pull in f4fa614, and we'll pull ae3fe45 when your linearizing patch
is ready.

-- 
 .''`.   martin f. krafft <madduck@d.o>      Related projects:
: :'  :  proud Debian developer               http://debiansystem.info
`. `'`   http://people.debian.org/~madduck    http://vcs-pkg.org
  `-  Debian - when you have better things to do than fixing systems
 
"you grabbed my hand and we fell into it,
 like a daydream - or a fever."
                                        -- godspeed you black emperor!

[-- Attachment #2: Digital signature (see http://martin-krafft.net/gpg/) --]
[-- Type: application/pgp-signature, Size: 197 bytes --]

^ permalink raw reply	[flat|nested] 8+ messages in thread

* [PATCH] [TOPGIT] make tg remote idempotent
  2009-02-25 20:03   ` [PATCH] [TOPGIT] allow working with annihilated branches Uwe Kleine-König
@ 2009-02-25 20:03     ` Uwe Kleine-König
  0 siblings, 0 replies; 8+ messages in thread
From: Uwe Kleine-König @ 2009-02-25 20:03 UTC (permalink / raw)
  To: git

Before this patch each call to tg remote added three config entries
no matter if they already existed.  After some time my .git/config was
crowded.

Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de>
---
 tg-remote.sh |    6 +++---
 1 files changed, 3 insertions(+), 3 deletions(-)

diff --git a/tg-remote.sh b/tg-remote.sh
index c3e8bd3..3a40081 100644
--- a/tg-remote.sh
+++ b/tg-remote.sh
@@ -27,9 +27,9 @@ git config "remote.$name.url" >/dev/null || die "unknown remote '$name'"
 
 ## Configure the remote
 
-git config --add "remote.$name.fetch" "+refs/top-bases/*:refs/remotes/$name/top-bases/*"
-git config --add "remote.$name.push" "+refs/top-bases/*:refs/top-bases/*"
-git config --add "remote.$name.push" "+refs/heads/*:refs/heads/*"
+git config --replace-all "remote.$name.fetch" "+refs/top-bases/*:refs/remotes/$name/top-bases/*" "\\+refs/top-bases/\\*:refs/remotes/$name/top-bases/\\*"
+git config --replace-all "remote.$name.push" "+refs/top-bases/*:refs/top-bases/*" "\\+refs/top-bases/\\*:refs/top-bases/\\*"
+git config --replace-all "remote.$name.push" "+refs/heads/*:refs/heads/*" "\\+refs/heads/\\*:refs/heads/\\*"
 
 info "Remote $name can now follow TopGit topic branches."
 if [ -z "$populate" ]; then
-- 
1.5.6.5

^ permalink raw reply related	[flat|nested] 8+ messages in thread

end of thread, other threads:[~2009-02-25 20:05 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2009-01-14 21:27 [PATCH] [TOPGIT] make tg remote idempotent Uwe Kleine-König
2009-01-14 21:27 ` [PATCH] [TOPGIT] make creating a commit from a topgit branch a function Uwe Kleine-König
2009-01-21  3:19   ` martin f krafft
2009-01-21 10:16     ` Uwe Kleine-König
2009-01-22  0:13       ` martin f krafft
2009-01-21 11:06 ` [PATCH] [TOPGIT] make tg remote idempotent Uwe Kleine-König
2009-01-21 14:31   ` martin f krafft
2009-02-25 19:58 topgit patches Uwe Kleine-König
2009-02-25 20:03 ` [PATCH] [TOPGIT] limit rev-list in branch_contains to a single rev Uwe Kleine-König
2009-02-25 20:03   ` [PATCH] [TOPGIT] allow working with annihilated branches Uwe Kleine-König
2009-02-25 20:03     ` [PATCH] [TOPGIT] make tg remote idempotent Uwe Kleine-König

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.