git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Heiko Voigt <hvoigt@hvoigt.net>
To: Junio C Hamano <gitster@pobox.com>
Cc: Fredrik Gustafsson <iveqy@iveqy.com>,
	git@vger.kernel.org, jens.lehmann@web.de
Subject: Re: Re: [PATCH v4 1/2] push: Don't push a repository with unpushed submodules
Date: Mon, 22 Aug 2011 21:47:29 +0200	[thread overview]
Message-ID: <20110822194728.GA11745@sandbox-rc> (raw)
In-Reply-To: <7vmxf3xnsf.fsf@alter.siamese.dyndns.org>

Hi,

On Sat, Aug 20, 2011 at 11:48:48PM -0700, Junio C Hamano wrote:
> After removing the change to combine-diff.c from your two-patch series, I
> applied them on top of this one, and queued the result in 'pu'.
> 
> While I tried to be careful while doing this callback-for-combine-diff
> patch so that a callback function written for two-way diff can be used
> without any change as long as it does not care about the LHS (i.e. "one")
> of the filepair, please double check. I didn't read your change to
> submodule.c very carefully (and I didn't have to change it).
> 
> The result seems to pass your new tests ;-).

Very nice. Today I had a deeper look into the current tests for
on-demand and found a bug in them. Cleaning them up also revealed a bug
in the current code. Junio could you please squash this[1] in the last
patch (on-demand option).

I analysed the cause of this bug and it seems that we are not allowed to
iterate revisions using init_revisions() and setup_revisions() more
than once. I tracked this down to the SEEN flag in the struct object.
Junio since you are one person listed in the api docs could you maybe
quickly explain to me what this flag is used for?

I quickly tried to implement a reset_revision_walk function which will
reset this flag but it seems that this breaks some expectations in the
code since I got a segfault.

Cheers Heiko

[1]

diff --git a/t/t5531-deep-submodule-push.sh b/t/t5531-deep-submodule-push.sh
index 35820ec..b0e94f7 100755
--- a/t/t5531-deep-submodule-push.sh
+++ b/t/t5531-deep-submodule-push.sh
@@ -124,6 +124,10 @@ test_expect_success 'push unpushed submodules' '
 		cd work &&
 		git checkout master &&
 		git push --recurse-submodules=on-demand ../pub.git master
+		cd gar/bage &&
+		git rev-parse master >expected &&
+		git rev-parse origin/master >actual &&
+		test_cmp expected actual
 	)
 '
 
@@ -132,10 +136,14 @@ test_expect_success 'push unpushed submodules when not needed' '
 		cd work &&
 		(
 			cd gar/bage &&
-			>junk4 &&
-			git add junk4 &&
-			git commit -m "junk4" &&
-			git push
+			git checkout master &&
+			>junk5 &&
+			git add junk5 &&
+			git commit -m "junk5" &&
+			git push &&
+			git rev-parse master >expected &&
+			git rev-parse origin/master >actual &&
+			test_cmp expected actual
 		) &&
 		git add gar/bage &&
 		git commit -m "updated submodule" &&
@@ -143,4 +151,20 @@ test_expect_success 'push unpushed submodules when not needed' '
 	)
 '
 
+test_expect_failure 'push unpushed submodules on-demand fails when submodule not pushable' '
+	(
+		cd work &&
+		(
+			cd gar/bage &&
+			git checkout HEAD~0 &&
+			>junk6 &&
+			git add junk6 &&
+			git commit -m "junk6"
+		) &&
+		git add gar/bage &&
+		git commit -m "updated submodule" &&
+		test_must_fail git push --recurse-submodules=on-demand ../pub.git master
+	)
+'
+
 test_done
-- 
1.7.6.46.g0f058

  reply	other threads:[~2011-08-22 19:47 UTC|newest]

Thread overview: 20+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-08-19 22:08 [PATCH v4 0/2] push: submodule support Fredrik Gustafsson
2011-08-19 22:08 ` [PATCH v4 1/2] push: Don't push a repository with unpushed submodules Fredrik Gustafsson
2011-08-19 23:26   ` Junio C Hamano
2011-08-20  6:32     ` Junio C Hamano
2011-08-21  6:48       ` Junio C Hamano
2011-08-22 19:47         ` Heiko Voigt [this message]
2011-08-22 22:22           ` Junio C Hamano
2011-08-23 19:45             ` Heiko Voigt
2011-08-24 21:14             ` [WIP PATCH] revision-walking: allow iterating revisions multiple times Heiko Voigt
2011-08-24 21:44               ` Junio C Hamano
2011-08-20  6:34     ` [PATCH 2/2] demonstrate format-callback used in combined diff Junio C Hamano
2011-08-21 21:55       ` Fredrik Gustafsson
2011-08-19 22:08 ` [PATCH v4 2/2] push: teach --recurse-submodules the on-demand option Fredrik Gustafsson
2011-09-02 18:21   ` Junio C Hamano
     [not found]     ` <20111017190749.GA3126@sandbox-rc>
2011-10-17 22:33       ` Junio C Hamano
2011-10-18 20:58         ` Jens Lehmann
2011-12-12 21:16           ` Phil Hord
2011-12-12 22:29             ` Jens Lehmann
2011-12-12 23:50               ` Phil Hord
2011-12-13  8:48                 ` Jens Lehmann

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20110822194728.GA11745@sandbox-rc \
    --to=hvoigt@hvoigt.net \
    --cc=git@vger.kernel.org \
    --cc=gitster@pobox.com \
    --cc=iveqy@iveqy.com \
    --cc=jens.lehmann@web.de \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).