Git development
 help / color / mirror / Atom feed
* [TopGit PATCH] Use the topological order when exporting explicitly listed branches.
@ 2008-11-20  9:38 martin f. krafft
  2008-11-20 10:20 ` Petr Baudis
  0 siblings, 1 reply; 3+ messages in thread
From: martin f. krafft @ 2008-11-20  9:38 UTC (permalink / raw)
  To: git, pasky; +Cc: Niko Tyni, martin f. krafft

From: Niko Tyni <ntyni@debian.org>

When exporting explicitly listed branches (tg export -b), the branch
dependencies were not taken into account.

Signed-off-by: martin f. krafft <madduck@debian.org>
Tested-by: martin f. krafft <madduck@debian.org>
---
Arguably, lines 178:189 need to be refactored due to the code duplication, but
the patch does what it should for now.

 tg-export.sh |    6 +++---
 1 files changed, 3 insertions(+), 3 deletions(-)

diff --git a/tg-export.sh b/tg-export.sh
index 52af88d..037b991 100644
--- a/tg-export.sh
+++ b/tg-export.sh
@@ -181,9 +181,9 @@ if [ -z "$branches" ]; then
 	recurse_deps driver "$name"
 	(_ret=0; _dep="$name"; _name=""; _dep_is_tgish=1; driver)
 else
-	echo "$branches" | tr ',' '\n' | while read _dep; do
-		_dep_is_tgish=1
-		$driver
+	echo "$branches" | tr ',' '\n' | while read name; do
+		recurse_deps driver "$name"
+		(_ret=0; _dep="$name"; _name=""; _dep_is_tgish=1; driver)
 	done
 	name="$(echo "$branches" | sed 's/.*,//')"
 fi
-- 
1.5.6.5

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

* Re: [TopGit PATCH] Use the topological order when exporting explicitly listed branches.
  2008-11-20  9:38 [TopGit PATCH] Use the topological order when exporting explicitly listed branches martin f. krafft
@ 2008-11-20 10:20 ` Petr Baudis
  2008-11-20 10:54   ` martin f krafft
  0 siblings, 1 reply; 3+ messages in thread
From: Petr Baudis @ 2008-11-20 10:20 UTC (permalink / raw)
  To: martin f. krafft; +Cc: git, Niko Tyni

On Thu, Nov 20, 2008 at 10:38:22AM +0100, martin f. krafft wrote:
> From: Niko Tyni <ntyni@debian.org>
> 
> When exporting explicitly listed branches (tg export -b), the branch
> dependencies were not taken into account.
> 
> Signed-off-by: martin f. krafft <madduck@debian.org>
> Tested-by: martin f. krafft <madduck@debian.org>
> ---
> Arguably, lines 178:189 need to be refactored due to the code duplication, but
> the patch does what it should for now.

The point of -b is to export only the specified branches, assuming you
already exported the dependencies before. If you just want to export a
branch with all its dependencies, why not just switch to it and call
plain tg export?

-- 
				Petr "Pasky" Baudis
People who take cold baths never have rheumatism, but they have
cold baths.

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

* Re: [TopGit PATCH] Use the topological order when exporting explicitly listed branches.
  2008-11-20 10:20 ` Petr Baudis
@ 2008-11-20 10:54   ` martin f krafft
  0 siblings, 0 replies; 3+ messages in thread
From: martin f krafft @ 2008-11-20 10:54 UTC (permalink / raw)
  To: Petr Baudis; +Cc: git, Niko Tyni

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

also sprach Petr Baudis <pasky@suse.cz> [2008.11.20.1120 +0100]:
> The point of -b is to export only the specified branches, assuming you
> already exported the dependencies before. If you just want to export a
> branch with all its dependencies, why not just switch to it and call
> plain tg export?

Ah, I see. I think then I probably failed to communicate what I had
in mind with -b, which was mainly to avoid use of a temporary
branch where to collapse all commits before creating a series.

I don't see the point of being able to export patches into a quilt
series without their dependencies. If needed, one could use tg-patch
for that. The only difference between tg-export -b and tg-patch is
that the former can do multiple patches in one go, and it writes
a series file. Since that series is not guaranteed to be applicable,
I think one could just not bother.

Thinking about it a bit more, I think tg-export should be modified
such that it can always take -b/--branches, which defaults to the
current branch. No matter what the driver, it always prepends the
dependencies to the list. Then, the list is passed to the export
driver. 'collapse' creates a branch as it does right now, and
'quilt' creates a series as it does right now.

I have most of this implemented in a branch which I'll gladly
publish as soon as I figured out some remaining corner cases.

-- 
 .''`.   martin f. krafft <madduck@debian.org>
: :'  :  proud Debian developer, author, administrator, and user
`. `'`   http://people.debian.org/~madduck - http://debiansystem.info
  `-  Debian - when you have better things to do than fixing systems
 
"zum christentum wird man nicht geboren,
 man muß dazu nur krank genug sein."
                                                 - friedrich nietzsche

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

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

end of thread, other threads:[~2008-11-20 10:56 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2008-11-20  9:38 [TopGit PATCH] Use the topological order when exporting explicitly listed branches martin f. krafft
2008-11-20 10:20 ` Petr Baudis
2008-11-20 10:54   ` martin f krafft

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox