From: Eric Sunshine <sunshine@sunshineco.com>
To: Josip Sokcevic <sokcevic@google.com>
Cc: git@vger.kernel.org
Subject: Re: [PATCH v3] diff-lib: honor override_submodule_config flag bit
Date: Wed, 14 Jun 2023 12:46:06 -0400 [thread overview]
Message-ID: <CAPig+cR9Zv87ZmKaYKX2Acu=0vun+HonyXKOWd8juMPfE7by2Q@mail.gmail.com> (raw)
In-Reply-To: <20230614163127.3182986-2-sokcevic@google.com>
On Wed, Jun 14, 2023 at 12:37 PM Josip Sokcevic <sokcevic@google.com> wrote:
> When `diff.ignoreSubmodules = all` is set and submodule commits are
> manually staged (e.g. via `git-update-index`), `git-commit` should
> record the commit with updated submodules.
>
> `index_differs_from` is called from `prepare_to_commit` with flags set to
> `override_submodule_config = 1`. `index_differs_from` then merges the
> default diff flags and passed flags.
>
> When `diff.ignoreSubmodules` is set to "all", `flags` ends up having
> both `override_submodule_config` and `ignore_submodules` set to 1. This
> results in `git-commit` ignoring staged commits.
>
> This patch restores original `flags.ignore_submodule` if
> `flags.override_submodule_config` is set.
>
> Signed-off-by: Josip Sokcevic <sokcevic@google.com>
Looking much better. Just a minor (nitpicky) style comment...
> diff --git a/t/t7406-submodule-update.sh b/t/t7406-submodule-update.sh
> @@ -1179,4 +1179,27 @@ test_expect_success 'submodule update --recursive skip submodules with strategy=
> +add_submodule_commit_and_validate () {
> + HASH=$(git rev-parse HEAD) &&
> + git update-index --add --cacheinfo 160000,$HASH,sub &&
> + git commit -m "create submodule" &&
> + echo "160000 commit $HASH sub" > expect &&
Drop the space after the redirection operator:
echo "160000 commit $HASH sub" >expect &&
> + git ls-tree HEAD -- sub >actual &&
This one correctly omits whitespace after the redirection operator.
> + test_cmp expect actual
> +}
prev parent reply other threads:[~2023-06-14 16:46 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-06-14 16:31 [PATCH v3] diff-lib: honor override_submodule_config flag bit Josip Sokcevic
2023-06-14 16:46 ` Eric Sunshine [this message]
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='CAPig+cR9Zv87ZmKaYKX2Acu=0vun+HonyXKOWd8juMPfE7by2Q@mail.gmail.com' \
--to=sunshine@sunshineco.com \
--cc=git@vger.kernel.org \
--cc=sokcevic@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 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).