All of lore.kernel.org
 help / color / mirror / Atom feed
From: Junio C Hamano <gitster@pobox.com>
To: Calvin Wan <calvinwan@google.com>
Cc: git@vger.kernel.org, Josh Steadmon <steadmon@google.com>
Subject: Re: [RFC PATCH 4/6] tests: use `git submodule add` and fix expected diffs
Date: Mon, 13 Feb 2023 15:19:14 -0800	[thread overview]
Message-ID: <xmqqttzp887h.fsf@gitster.g> (raw)
In-Reply-To: <xmqqy1p188rj.fsf@gitster.g> (Junio C. Hamano's message of "Mon, 13 Feb 2023 15:07:12 -0800")

Junio C Hamano <gitster@pobox.com> writes:

> Calvin Wan <calvinwan@google.com> writes:
>
>> From: Josh Steadmon <steadmon@google.com>
>>
>> This commit continues the previous work of updating the test suite to
>> use `git submodule add` to create submodules instead of using `git add`
>> to include embedded repositories. Specifically, in this commit we update
>> test cases where expected diffs must change due to the presence of a
>> .gitmodules file.
>
> Good that these "same" tasks are split into two steps, ones that
> don't notice the additional presence of .gitmodules (i.e. the
> previous step) and the result that do.
>
> Strictly speaking, gitlink support in the index and trees does not
> have to be used to record submodules, and changing all "git add" to
> "git submodule add" is somewhat a sad change that closes the door to
> those folks who want to use the mechanism for implementing "better
> submodules" that do not depend on a separate .gitmodules files, for
> example.  To leave the door open, "git add" may need to learn an
> overriding mechanism allow adding a gitlink to the index without
> anything else.  And then this step could use "git add -f" (or
> whategver the overriding mechanism) instead of "git submodule add",
> without changing the expected diff output.
>
> Would such a tweak make this step better?  I dunno.

The other side of the coin is that the tests that were touched by
the previous step were not testing half of what "submodule add" is
doing.  Not all the "let's add submodule here" test may not have to
verify the resulting .gitmodules file (e.g. ones that want to see
the low-level diff machinery works correctly by taking output from
"git diff --cached --raw" would be primarily interested in what
happens to the index and not to .gitmodules at all), but some of
them should.  A rough rule of thumb might be that the tests that are
about "submodules" should care what ".gitmodules" has, while the
tests tare are about "gitlink" should not.  It might even make sense
to use "add -f" (or whatever override to allow adding a gitlink only
to the index without touching .gitmodules and other things), not
"submodule add", for the latter class of tests.

Thanks.



  reply	other threads:[~2023-02-13 23:19 UTC|newest]

Thread overview: 40+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-02-13 18:21 [RFC PATCH 0/6] add: block invalid submodules Calvin Wan
2023-02-13 18:21 ` [RFC PATCH 1/6] leak fix: cache_put_path Calvin Wan
2023-02-13 19:23   ` Junio C Hamano
2023-02-14 19:56     ` Calvin Wan
2023-02-14 21:08       ` Junio C Hamano
2023-02-14 21:39         ` Calvin Wan
2023-02-14 21:59           ` Junio C Hamano
2023-02-13 18:21 ` [RFC PATCH 2/6] t4041, t4060: modernize test style Calvin Wan
2023-02-13 19:41   ` Junio C Hamano
2023-02-14 20:22     ` Calvin Wan
2023-02-13 18:21 ` [RFC PATCH 3/6] tests: Use `git submodule add` instead of `git add` Calvin Wan
2023-02-13 18:21 ` [RFC PATCH 4/6] tests: use `git submodule add` and fix expected diffs Calvin Wan
2023-02-13 23:07   ` Junio C Hamano
2023-02-13 23:19     ` Junio C Hamano [this message]
2023-02-13 18:21 ` [RFC PATCH 5/6] tests: use `git submodule add` and fix expected status Calvin Wan
2023-02-13 18:21 ` [RFC PATCH 6/6] add: reject nested repositories Calvin Wan
2023-02-13 20:42   ` Jeff King
2023-02-14  2:17     ` Junio C Hamano
2023-02-14 16:07       ` Jeff King
2023-02-14 16:32         ` Junio C Hamano
2023-02-14 21:45           ` Calvin Wan
2023-02-28 18:52 ` [PATCH v2 0/6] add: block invalid submodules Calvin Wan
2023-02-28 18:56   ` [PATCH v2 1/6] t4041, t4060: modernize test style Calvin Wan
2023-03-06 19:32     ` Glen Choo
2023-03-06 20:40       ` Calvin Wan
2023-02-28 18:56   ` [PATCH v2 2/6] tests: Use `git submodule add` instead of `git add` Calvin Wan
2023-02-28 23:30     ` Junio C Hamano
2023-03-03  0:16       ` Calvin Wan
2023-03-06 21:26     ` Glen Choo
2023-02-28 18:56   ` [PATCH v2 3/6] tests: use `git submodule add` and fix expected diffs Calvin Wan
2023-03-06 23:34     ` Glen Choo
2023-03-06 23:57       ` Junio C Hamano
2023-02-28 18:56   ` [PATCH v2 4/6] tests: use `git submodule add` and fix expected status Calvin Wan
2023-03-07  0:15     ` Glen Choo
2023-02-28 18:56   ` [PATCH v2 5/6] tests: remove duplicate .gitmodules path Calvin Wan
2023-02-28 23:35     ` Junio C Hamano
2023-03-02 23:09       ` Calvin Wan
2023-03-07  0:51     ` Glen Choo
2023-02-28 18:56   ` [PATCH v2 6/6] add: reject nested repositories Calvin Wan
2023-03-07  2:04     ` Glen Choo

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=xmqqttzp887h.fsf@gitster.g \
    --to=gitster@pobox.com \
    --cc=calvinwan@google.com \
    --cc=git@vger.kernel.org \
    --cc=steadmon@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
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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.