Re: [PATCH 076/194] push: add test showing bad interaction of replace refs and submodules

2018-02-06 Thread Stefan Beller
On Mon, Feb 5, 2018 at 6:20 PM, brian m. carlson
 wrote:
> On Mon, Feb 05, 2018 at 03:55:37PM -0800, Stefan Beller wrote:
>> The ref subsystem has not been migrated yet to access the object store
>> via passed in repository objects. As a result replace when the object store
>> tries to access replace refs in a repository other than the_repository
>> it produces errors:
>>
>>   error: refs/replace/3afabef75c627b8943bcae86837abc7c32fe does not 
>> point to a valid object!
>>
>> Add a test demonstrating this failure.
>>
>> Signed-off-by: Jonathan Nieder 
>> Signed-off-by: Stefan Beller 
>>
>> squash! push: add test showing bad interaction of replace refs and submodules
>>
>> replace-objects: evaluate replacement refs without using the object store
>>
>> Pass DO_FOR_EACH_INCLUDE_BROKEN when iterating over replacement refs
>> so that the iteration does not require opening the named objects from
>> the object store. This avoids a dependency cycle between object access
>> and replace ref iteration.
>>
>> Moreover the ref subsystem has not been migrated yet to access the object
>> store via passed in repository objects.  As a result, without this patch
>> when the object store tries to access replace refs in a repository other
>> than the_repository it produces errors:
>>
>>error: refs/replace/3afabef75c627b8943bcae86837abc7c32fe does not 
>> point to a valid object!
>>
>> Signed-off-by: Jonathan Nieder 
>> Signed-off-by: Stefan Beller 
>
> It appears you have multiple independent commit messages here.

I will drop this patch; it appears as if it was targeted to be part of
006f3f28af (replace-objects: evaluate replacement refs without
using the object store, 2017-09-12), which landed.

We can revive this test outside of this long series if we feel inclined.

Thanks for spotting!
Stefan


Re: [PATCH 076/194] push: add test showing bad interaction of replace refs and submodules

2018-02-05 Thread brian m. carlson
On Mon, Feb 05, 2018 at 03:55:37PM -0800, Stefan Beller wrote:
> The ref subsystem has not been migrated yet to access the object store
> via passed in repository objects. As a result replace when the object store
> tries to access replace refs in a repository other than the_repository
> it produces errors:
> 
>   error: refs/replace/3afabef75c627b8943bcae86837abc7c32fe does not point 
> to a valid object!
> 
> Add a test demonstrating this failure.
> 
> Signed-off-by: Jonathan Nieder 
> Signed-off-by: Stefan Beller 
> 
> squash! push: add test showing bad interaction of replace refs and submodules
> 
> replace-objects: evaluate replacement refs without using the object store
> 
> Pass DO_FOR_EACH_INCLUDE_BROKEN when iterating over replacement refs
> so that the iteration does not require opening the named objects from
> the object store. This avoids a dependency cycle between object access
> and replace ref iteration.
> 
> Moreover the ref subsystem has not been migrated yet to access the object
> store via passed in repository objects.  As a result, without this patch
> when the object store tries to access replace refs in a repository other
> than the_repository it produces errors:
> 
>error: refs/replace/3afabef75c627b8943bcae86837abc7c32fe does not 
> point to a valid object!
> 
> Signed-off-by: Jonathan Nieder 
> Signed-off-by: Stefan Beller 

It appears you have multiple independent commit messages here.
-- 
brian m. carlson / brian with sandals: Houston, Texas, US
https://www.crustytoothpaste.net/~bmc | My opinion only
OpenPGP: https://keybase.io/bk2204


signature.asc
Description: PGP signature


[PATCH 076/194] push: add test showing bad interaction of replace refs and submodules

2018-02-05 Thread Stefan Beller
The ref subsystem has not been migrated yet to access the object store
via passed in repository objects. As a result replace when the object store
tries to access replace refs in a repository other than the_repository
it produces errors:

  error: refs/replace/3afabef75c627b8943bcae86837abc7c32fe does not point 
to a valid object!

Add a test demonstrating this failure.

Signed-off-by: Jonathan Nieder 
Signed-off-by: Stefan Beller 

squash! push: add test showing bad interaction of replace refs and submodules

replace-objects: evaluate replacement refs without using the object store

Pass DO_FOR_EACH_INCLUDE_BROKEN when iterating over replacement refs
so that the iteration does not require opening the named objects from
the object store. This avoids a dependency cycle between object access
and replace ref iteration.

Moreover the ref subsystem has not been migrated yet to access the object
store via passed in repository objects.  As a result, without this patch
when the object store tries to access replace refs in a repository other
than the_repository it produces errors:

   error: refs/replace/3afabef75c627b8943bcae86837abc7c32fe does not point 
to a valid object!

Signed-off-by: Jonathan Nieder 
Signed-off-by: Stefan Beller 
---
 t/t5531-deep-submodule-push.sh | 16 
 1 file changed, 16 insertions(+)

diff --git a/t/t5531-deep-submodule-push.sh b/t/t5531-deep-submodule-push.sh
index 39cb2c1c34..8b2aa5a0f4 100755
--- a/t/t5531-deep-submodule-push.sh
+++ b/t/t5531-deep-submodule-push.sh
@@ -308,6 +308,22 @@ test_expect_success 'submodule entry pointing at a tag is 
error' '
test_i18ngrep "is a tag, not a commit" err
 '
 
+test_expect_success 'replace ref does not interfere with submodule access' '
+   test_commit -C work/gar/bage one &&
+   test_commit -C work/gar/bage two &&
+   git -C work/gar/bage reset HEAD^^ &&
+   git -C work/gar/bage replace two one &&
+   test_when_finished "git -C work/gar/bage replace -d two" &&
+
+   test_commit -C work/gar/bage three &&
+   git -C work add gar/bage &&
+   git -C work commit -m "advance submodule" &&
+
+   git -C work push --recurse-submodules=on-demand ../pub.git master 2>err 
&&
+   ! grep error err &&
+   ! grep fatal err
+'
+
 test_expect_success 'push fails if recurse submodules option passed as yes' '
(
cd work/gar/bage &&
-- 
2.15.1.433.g936d1b9894.dirty