git@vger.kernel.org mailing list mirror (one of many)
 help / Atom feed
From: Eddy Petrișor <eddy.petrisor@gmail.com>
To: Stefan Beller <sbeller@google.com>
Cc: Eddy Petrișor <eddy.petrisor@codeaurora.org>,
	Jonathan Nieder <jrnieder@gmail.com>,
	Git List <git@vger.kernel.org>
Subject: Re: [RFC PATCH v3 2/2] t7406: add test for non-default branch in submodule
Date: Thu, 19 Apr 2018 09:07:51 +0300
Message-ID: <CAK0XTWecZASWULXYXGauV5WKhYinD7HXyXSTJntocQt3vzr4AA@mail.gmail.com> (raw)
In-Reply-To: <CAGZ79kbT+AnVu-AJ9=OSt=Z2ErM5ocfoLfgx=qmHFfbnkqJqwg@mail.gmail.com>

2018-04-05 0:41 GMT+03:00 Stefan Beller <sbeller@google.com>:
> On Wed, Apr 4, 2018 at 1:37 PM, Eddy Petrișor <eddy.petrisor@gmail.com> wrote:
>
>>> you plan to later submit as one patch including both the change as well as
>>> the test.
>>
>> Yes,

I did not forget about having a single patch. Will do it once the
details are ironed out.

>>>>> +       cd ../super5 &&
>>>>> +       echo super_with_2_chained_modules > super5 &&
>>>>> +       git add super5 &&
>>>>> +       test_tick &&
>>>>> +       git commit -m "commit on default branch in super5" &&
>>>>> +       git submodule add ../submodl1b1 submodl1b1 &&
>>>>> +       git config -f .gitmodules submodule."submodl1b1".branch b1 &&
>>>>> +       git add .gitmodules &&
>>>>> +       test_tick &&
>>>>> +       git commit -m "add l1 module with branch b1 in super5" &&
>>>
>>> now we do this again without the nested submodule, just one repo
>>> as a submodule?
>>
>> My intention was to have super5 -> submodl1b1@b1 -> submodl2b2@b2 on
>> the "server" side.
>> But are you saying I just implemented super5 -> sbmodl1b1@master due
>> to the previous master checkout in submodl1b1?
>
> No. I was a little confused about the code.

Actually you were 100% correct. In order to link to submodl1b1@b1 I
had to move the master branch checkout after the submobl2@b2 is added.

Otherwise the submodule is added with the last commit on master, not
the last one on b1 an b2, respectively.

I suspect that in the tests, because the "server side" repos are
local, the git fetch-by-sha1/cloning by hash will be done correctly,
without the need of a branch hint, but the problem will still exist
for servers such as github which do not support fetch-by-sha1.
In case I realize that a server-side repo that doesn't support
fetch-by-sha1 is needed, is there a mechanism to set that up in the
test case, or do I have to rethink my approach?

>>>>> +       git submodule init submodl1b1 &&
>>>>> +       git clone super5 super &&
>>>
>>> does super exist here already? (I did not check, but IIRC
>>> super and super{1-4} are there as we count upwards to
>>> find a name that is ok.
>>
>> I created it in the first step of the test with the intention to have
>> super5 as the "server" and "super" as the client clone.
>
> oh, ok.

After using test_pause I realized 'super' is left over by some other
test cases, so in my v4 (unjustifibly) long series I switch to using
super_w because I was getting all sorts of issues and wanted to not
interfere with the other tests.

>> As a general idea for a test, does it look sane?
>
> Yes, I think it is a sane approach. Thanks for writing such a test!

OK, thanks for the feedback.

>> Do you think I should I start with a just one level of submodule with
>> a non-default branch (super -> l1@b1), or it this OK?
>> In my view, having 2 levels makes sure the recursive part is also
>> addressed and verified.
>
> I totally agree.


-- 
Eddy Petrișor

  parent reply index

Thread overview: 29+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <1520366804-28233-1-git-send-email-eddy.petrisor@gmail.com>
2018-03-06 20:21 ` [RFC PATCH] git-submodule.sh:cmd_update: if submodule branch exists, fetch that instead of default Jonathan Nieder
2018-03-08 19:29   ` Eddy Petrișor
2018-03-08 19:41     ` Eddy Petrișor
2018-03-16 21:33     ` Thomas Gummerer
2018-03-16 21:44       ` Eric Sunshine
     [not found]         ` <CAK0XTWcNySGgwgFgCPDnZ+m=2hfEgswHbJKYeu+LQfuQ9_=shQ@mail.gmail.com>
2018-03-17 19:11           ` Thomas Gummerer
2018-03-18  1:43             ` Eric Sunshine
2018-03-26 23:06 ` Stefan Beller
     [not found]   ` <CAK0XTWd7QGtVDwm8FDXejZfbgVH6-1NprGY0xxAnC33QH8aCCQ@mail.gmail.com>
2018-03-29 20:54     ` Fwd: " Eddy Petrișor
     [not found] ` <20180329225502.20112-1-eddy.petrisor@gmail.com>
2018-03-29 22:59   ` [RFC PATCH v2] " Eddy Petrișor
2018-04-03 22:20     ` [RFC PATCH v3 1/2] " Eddy Petrișor
2018-04-03 22:20     ` [RFC PATCH v3 2/2] t7406: add test for non-default branch in submodule Eddy Petrișor
2018-04-03 22:26       ` Eddy Petrișor
2018-04-04 18:36         ` Stefan Beller
2018-04-04 20:37           ` Eddy Petrișor
2018-04-04 21:41             ` Stefan Beller
2018-04-18 22:35               ` [RFC PATCH v4 1/9] git-submodule.sh:cmd_update: if submodule branch exists, fetch that instead of default Eddy Petrișor
2018-04-18 23:53                 ` Stefan Beller
2018-04-19  5:43                   ` Eddy Petrișor
2018-04-18 22:35               ` [RFC PATCH v4 2/9] t7406: add test for non-default branch in submodule Eddy Petrișor
2018-04-18 22:35               ` [RFC PATCH v4 3/9] fixup:t7406: use test_commit instead of echo/add/commit as suggested by Stefan Beller Eddy Petrișor
2018-04-18 22:35               ` [RFC PATCH v4 4/9] fixup:t7404:use 'git -C' instead of cd .. && git Eddy Petrișor
2018-04-18 22:35               ` [RFC PATCH v4 5/9] fixup:t7406:cleanup chained submodules after test is done Eddy Petrișor
2018-04-18 22:35               ` [RFC PATCH v4 6/9] fixup:t7406:don't call init after add, is redundant Eddy Petrișor
2018-04-18 22:35               ` [RFC PATCH v4 7/9] fixup:t7406:supr5 commit is done before submodules chaining Eddy Petrișor
2018-04-18 22:35               ` [RFC PATCH v4 8/9] fixup:t7406:use super_w instead of the existing super Eddy Petrișor
2018-04-18 22:35               ` [RFC PATCH v4 9/9] fixup:t7406:change branches in submodules after the link is done Eddy Petrișor
2018-04-19  6:07               ` Eddy Petrișor [this message]
2018-04-19 17:52                 ` [RFC PATCH v3 2/2] t7406: add test for non-default branch in submodule Stefan Beller

Reply instructions:

You may reply publically 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

  List information: http://vger.kernel.org/majordomo-info.html

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

  git send-email \
    --in-reply-to=CAK0XTWecZASWULXYXGauV5WKhYinD7HXyXSTJntocQt3vzr4AA@mail.gmail.com \
    --to=eddy.petrisor@gmail.com \
    --cc=eddy.petrisor@codeaurora.org \
    --cc=git@vger.kernel.org \
    --cc=jrnieder@gmail.com \
    --cc=sbeller@google.com \
    /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

git@vger.kernel.org mailing list mirror (one of many)

Archives are clonable:
	git clone --mirror https://public-inbox.org/git
	git clone --mirror http://ou63pmih66umazou.onion/git
	git clone --mirror http://czquwvybam4bgbro.onion/git
	git clone --mirror http://hjrcffqmbrq6wope.onion/git

Newsgroups are available over NNTP:
	nntp://news.public-inbox.org/inbox.comp.version-control.git
	nntp://ou63pmih66umazou.onion/inbox.comp.version-control.git
	nntp://czquwvybam4bgbro.onion/inbox.comp.version-control.git
	nntp://hjrcffqmbrq6wope.onion/inbox.comp.version-control.git
	nntp://news.gmane.org/gmane.comp.version-control.git

 note: .onion URLs require Tor: https://www.torproject.org/
       or Tor2web: https://www.tor2web.org/

AGPL code for this site: git clone https://public-inbox.org/ public-inbox