From: Jens Lehmann <Jens.Lehmann@web.de>
To: Heiko Voigt <hvoigt@hvoigt.net>, Junio C Hamano <gitster@pobox.com>
Cc: Sergey Sharybin <sergey.vfx@gmail.com>,
Jonathan Nieder <jrnieder@gmail.com>,
Ramkumar Ramachandra <artagnon@gmail.com>,
Jeff King <peff@peff.net>, Git List <git@vger.kernel.org>
Subject: Re: [RFC/WIP PATCH 0/4] less ignorance of submodules for ignore=all
Date: Thu, 05 Dec 2013 21:51:31 +0100 [thread overview]
Message-ID: <52A0E753.5090908@web.de> (raw)
In-Reply-To: <20131204231932.GG7326@sandbox-ub>
Am 05.12.2013 00:19, schrieb Heiko Voigt:
> On Wed, Dec 04, 2013 at 02:32:46PM -0800, Junio C Hamano wrote:
> This series tries to achieve the following goals for the
> submodule.<name>.ignore=all configuration or the --ignore-submodules=all
> command line switch.
Thanks for the summary.
> * Make git status never ignore submodule changes that got somehow in the
> index. Currently when ignore=all is specified they are and thus
> secretly committed. Basically always show exactly what will be
> committed.
Yes, what's in the index should always be shown as such even when the
user chose to ignore the work tree differences of the submodule.
> * Make add ignore submodules that have the ignore=all configuration when
> not explicitly naming a certain submodule (i.e. using git add .).
> That way ignore=all submodules are not added to the index by default.
> That can be overridden by using the -f switch so it behaves the same
> as with untracked files specified in one of the ignore files except
> that submodules are actually tracked.
I think we should do this part in a different series, as everybody
seems to agree that this should be fixed that way and it has nothing
to do with what is ignored in submodule history.
> * Let diff always show submodule changes between revisions or
> between a revision and the index. Only worktree changes should be
> ignored with ignore=all.
>
> * Generally speaking: Make everything that displays diffs in history,
> diffs between revisions or between a revision and the index always
> show submodules changes (only the commit ids) even if a submodule is
> specified as ignore=all.
I'm not so sure about that. Some scripts really want to ignore the
history of submodules when comparing a rev to the index:
git-filter-branch.sh: git diff-index -r --name-only --ignore-submodules $commit &&
git-pull.sh: git diff-index --cached --name-status -r --ignore-submodules HEAD --
git-rebase--merge.sh: if ! git diff-index --quiet --ignore-submodules HEAD --
git-sh-setup.sh: if ! git diff-index --cached --quiet --ignore-submodules HEAD --
git-stash.sh: git diff-index --quiet --cached HEAD --ignore-submodules -- &&
I didn't check each site in detail, but I suspect each ignore option
was added on purpose to fix a problem. That means we still need "all"
(at least when diffing rev<->index). Unfortunately that area is not
covered well in our tests, I only got breakage from the filter-branch
tests when teaching "all" to only ignore work tree changes (see at the
end on how I did that).
So I'm currently in favor of adding a new "worktree"-value which will
only ignore the work tree changes of submodules, which seems just what
the floating submodule use case needs. But it looks like we need to
keep "all".
> * If ignore=all for a submodule and a diff would usually involve the
> worktree we will show the diff of the commit ids between the current
> index and the requested revision.
I agree if we make that "ignore=worktree".
>> I do think that it is a good thing to make what "git add ." does and
>> what "git status ." reports consistent, and "git add ." that does
>> not add everything may be a good step in that direction
Yup, as written above I'd propose to start with that too.
>> (another
>> possible solution may be to admit that ignore=all was a mistake and
>> remove that special case altogether, so that "git status" will
>> always report a submodule that does not match what is in the HEAD
>> and/or index).
No, looking at the git-scripts that use it together with diff-index it
wasn't a mistake. But we might be missing a less drastic option ;-)
> I think it was too early to add ignore=all back then when the ignoring
> was implemented. We did not think through all implications. Since people
> have always been requesting the floating model and as it seems started
> using it I am not so sure whether there is not a valid use case. Maybe
> Sergey can shed some light on their actual use case and why they do not
> care about the precise revision most of the time.
You maybe right about not thinking things thoroughly through, but we
helped people that rightfully complained when the (then new) submodule
awareness broke their scripts.
> For example the case that all developers always want to work with some
> HEAD revision of all submodules and the build system then integrates
> their changes on a regular basis. When all went well it creates commits
> with the precise revisions. This way they have some stable points as
> fallback or for releases. Thats at least the use case I can think of but
> maybe there are others.
And that could be the "worktree" value.
Below is a hack that disables the diffing of rev and index, but not
that against the work tree. It breaks t4027-diff-submodule.sh,
t7003-filter-branch.sh and t7508-status.sh as expected:
---------------------->8--------------------
diff --git a/diff.c b/diff.c
index e34bf97..ed66a01 100644
--- a/diff.c
+++ b/diff.c
@@ -4813,7 +4813,7 @@ static int is_submodule_ignored(const char *path, struct d
if (DIFF_OPT_TST(options, IGNORE_SUBMODULES))
ignored = 1;
options->flags = orig_flags;
- return ignored;
+ return 0;
}
void diff_addremove(struct diff_options *options,
next prev parent reply other threads:[~2013-12-05 20:51 UTC|newest]
Thread overview: 51+ messages / expand[flat|nested] mbox.gz Atom feed top
2013-11-22 7:53 Git issues with submodules Sergey Sharybin
2013-11-22 11:16 ` Ramkumar Ramachandra
2013-11-22 11:35 ` Sergey Sharybin
2013-11-22 13:08 ` Ramkumar Ramachandra
2013-11-22 15:11 ` Jeff King
2013-11-22 15:42 ` Sergey Sharybin
2013-11-22 16:35 ` Ramkumar Ramachandra
2013-11-22 17:01 ` Sergey Sharybin
2013-11-22 17:40 ` Sergey Sharybin
2013-11-22 18:11 ` Ramkumar Ramachandra
2013-11-22 21:01 ` Jens Lehmann
2013-11-22 21:46 ` Sergey Sharybin
2013-11-22 21:54 ` Heiko Voigt
2013-11-22 22:09 ` Jonathan Nieder
2013-11-23 20:10 ` Jens Lehmann
2013-11-24 0:52 ` Heiko Voigt
2013-11-24 16:29 ` Jens Lehmann
2013-11-25 9:02 ` Sergey Sharybin
2013-11-25 17:49 ` Heiko Voigt
2013-11-25 17:57 ` Sergey Sharybin
2013-11-25 18:15 ` Heiko Voigt
2013-12-04 22:16 ` [RFC/WIP PATCH 0/4] less ignorance of submodules for ignore=all Heiko Voigt
2013-12-04 22:19 ` [RFC/WIP PATCH 1/4] disable complete ignorance of submodules for index <-> HEAD diff Heiko Voigt
2013-12-04 22:21 ` [RFC/WIP PATCH 2/4] fix 'git add' to skip submodules configured as ignored Heiko Voigt
2013-12-04 22:21 ` [RFC/WIP PATCH 3/4] teach add -f option for ignored submodules Heiko Voigt
2013-12-06 23:10 ` Junio C Hamano
2013-12-09 21:51 ` Heiko Voigt
2013-12-04 22:23 ` [RFC/WIP PATCH 4/4] always show committed submodules in summary after commit Heiko Voigt
2013-12-04 22:26 ` [RFC/WIP PATCH 0/4] less ignorance of submodules for ignore=all Heiko Voigt
2013-12-04 22:32 ` Junio C Hamano
2013-12-04 23:19 ` Heiko Voigt
2013-12-05 20:51 ` Jens Lehmann [this message]
2013-12-09 21:41 ` Heiko Voigt
2013-12-09 22:25 ` Junio C Hamano
2013-11-25 21:01 ` Git issues with submodules Junio C Hamano
2013-11-26 18:44 ` Jens Lehmann
2013-11-26 19:33 ` Junio C Hamano
2013-11-26 19:51 ` Jonathan Nieder
2013-11-26 22:19 ` Junio C Hamano
2013-11-23 1:11 ` [RFC PATCH] disable complete ignorance of submodules for index <-> HEAD diff Heiko Voigt
2013-11-25 9:01 ` Sergey Sharybin
2013-11-28 7:10 ` Heiko Voigt
2013-11-29 23:11 ` [RFC/WIP PATCH v2] " Heiko Voigt
2013-11-23 7:04 ` Re: Git issues with submodules Ramkumar Ramachandra
2013-11-23 20:32 ` Jens Lehmann
2013-11-24 1:06 ` Heiko Voigt
2013-11-25 20:53 ` Junio C Hamano
2013-11-29 22:50 ` Heiko Voigt
2013-11-23 6:53 ` Ramkumar Ramachandra
2013-11-22 16:12 ` Ramkumar Ramachandra
2013-11-22 20:20 ` 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=52A0E753.5090908@web.de \
--to=jens.lehmann@web.de \
--cc=artagnon@gmail.com \
--cc=git@vger.kernel.org \
--cc=gitster@pobox.com \
--cc=hvoigt@hvoigt.net \
--cc=jrnieder@gmail.com \
--cc=peff@peff.net \
--cc=sergey.vfx@gmail.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.