{"thread":{"id":"13517","subject":"[PATCH 0/3] sane rebase/stash support with submodules","startedAt":"2008-05-14T17:03:16Z","lastAt":"2008-05-15T13:58:14Z","messageCount":12,"participants":["Johannes Schindelin","Junio C Hamano"],"isPatch":true,"patchVersion":1,"patchTotal":3},"messages":[{"id":"76953","messageId":"alpine.DEB.1.00.0805141802480.30431@racer","threadId":"13517","inReplyTo":null,"subject":"[PATCH 0/3] sane rebase/stash support with submodules","fromName":"Johannes Schindelin","fromEmail":"johannes.schindelin@gmx.de","sentAt":"2008-05-14T17:03:16Z","receivedAt":"2008-05-14T17:03:16Z","isPatch":true,"sender":{"key":"johannes.schindelin@gmx.de","avatar":"https://avatars.githubusercontent.com/u/127790?v=4"},"body":"\nSubmodules are special in that they cannot be blindly updated with\na checkout.  Indeed, submodules do not even have to be checked out (and\nin that case, must not be updated).  It is the user's responsibility to\ncare about the working tree state of submodules.\n\nTherefore, it does not make sense in stash/rebase to test for dirty\nsubmodules: they would not be updated anyway.\n\nThis patch series does exactly that: working tree states of submodules\nare ignored with stash and rebase, by calling update-index and\nthe diff programs with the freshly introduced --ignore-submodules option.\n\nJohannes Schindelin (3):\n  diff options: Introduce --ignore-submodules\n  Teach update-index about --ignore-submodules\n  Ignore dirty submodule states during rebase and stash\n\n Documentation/diff-options.txt     |    3 +\n Documentation/git-update-index.txt |    5 ++\n builtin-update-index.c             |    4 ++\n cache.h                            |    1 +\n diff.c                             |    9 ++++\n diff.h                             |    1 +\n git-rebase--interactive.sh         |   11 ++--\n git-rebase.sh                      |    8 ++--\n git-stash.sh                       |    6 +-\n read-cache.c                       |    4 ++\n t/t7402-submodule-rebase.sh        |   92 ++++++++++++++++++++++++++++++++++++\n 11 files changed, 132 insertions(+), 12 deletions(-)\n create mode 100755 t/t7402-submodule-rebase.sh\n"},{"id":"76954","messageId":"alpine.DEB.1.00.0805141803240.30431@racer","threadId":"13517","inReplyTo":"alpine.DEB.1.00.0805141802480.30431@racer","subject":"[PATCH 1/3] diff options: Introduce --ignore-submodules","fromName":"Johannes Schindelin","fromEmail":"johannes.schindelin@gmx.de","sentAt":"2008-05-14T17:03:31Z","receivedAt":"2008-05-14T17:03:31Z","isPatch":true,"sender":{"key":"johannes.schindelin@gmx.de","avatar":"https://avatars.githubusercontent.com/u/127790?v=4"},"body":"\nThe new option --ignore-submodules can now be used to ignore changes in\nsubmodules.\n\nWhy?  Sometimes it is not interesting when a submodule changed.\n\nFor example, when reordering some commits in the superproject, a dirty\nsubmodule is usually totally uninteresting.  So we will use this option\nin git-rebase to test for a dirty working tree.\n\nSigned-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>\n---\n Documentation/diff-options.txt |    3 +++\n diff.c                         |    9 +++++++++\n diff.h                         |    1 +\n 3 files changed, 13 insertions(+), 0 deletions(-)\n\ndiff --git a/Documentation/diff-options.txt b/Documentation/diff-options.txt\nindex 13234fa..859d679 100644\n--- a/Documentation/diff-options.txt\n+++ b/Documentation/diff-options.txt\n@@ -228,6 +228,9 @@ endif::git-format-patch[]\n --no-ext-diff::\n \tDisallow external diff drivers.\n \n+--ignore-submodules::\n+\tIgnore changes to submodules in the diff generation.\n+\n --src-prefix=<prefix>::\n \tShow the given source prefix instead of \"a/\".\n \ndiff --git a/diff.c b/diff.c\nindex 439d474..d57bc29 100644\n--- a/diff.c\n+++ b/diff.c\n@@ -2496,6 +2496,8 @@ int diff_opt_parse(struct diff_options *options, const char **av, int ac)\n \t\tDIFF_OPT_SET(options, ALLOW_EXTERNAL);\n \telse if (!strcmp(arg, \"--no-ext-diff\"))\n \t\tDIFF_OPT_CLR(options, ALLOW_EXTERNAL);\n+\telse if (!strcmp(arg, \"--ignore-submodules\"))\n+\t\tDIFF_OPT_SET(options, IGNORE_SUBMODULES);\n \n \t/* misc options */\n \telse if (!strcmp(arg, \"-z\"))\n@@ -3355,6 +3357,9 @@ void diff_addremove(struct diff_options *options,\n \tchar concatpath[PATH_MAX];\n \tstruct diff_filespec *one, *two;\n \n+\tif (DIFF_OPT_TST(options, IGNORE_SUBMODULES) && S_ISGITLINK(mode))\n+\t\treturn;\n+\n \t/* This may look odd, but it is a preparation for\n \t * feeding \"there are unchanged files which should\n \t * not produce diffs, but when you are doing copy\n@@ -3399,6 +3404,10 @@ void diff_change(struct diff_options *options,\n \tchar concatpath[PATH_MAX];\n \tstruct diff_filespec *one, *two;\n \n+\tif (DIFF_OPT_TST(options, IGNORE_SUBMODULES) && S_ISGITLINK(old_mode)\n+\t\t\t&& S_ISGITLINK(new_mode))\n+\t\treturn;\n+\n \tif (DIFF_OPT_TST(options, REVERSE_DIFF)) {\n \t\tunsigned tmp;\n \t\tconst unsigned char *tmp_c;\ndiff --git a/diff.h b/diff.h\nindex 3a02d38..1dfe1f9 100644\n--- a/diff.h\n+++ b/diff.h\n@@ -63,6 +63,7 @@ typedef void (*diff_format_fn_t)(struct diff_queue_struct *q,\n #define DIFF_OPT_REVERSE_DIFF        (1 << 15)\n #define DIFF_OPT_CHECK_FAILED        (1 << 16)\n #define DIFF_OPT_RELATIVE_NAME       (1 << 17)\n+#define DIFF_OPT_IGNORE_SUBMODULES   (1 << 18)\n #define DIFF_OPT_TST(opts, flag)    ((opts)->flags & DIFF_OPT_##flag)\n #define DIFF_OPT_SET(opts, flag)    ((opts)->flags |= DIFF_OPT_##flag)\n #define DIFF_OPT_CLR(opts, flag)    ((opts)->flags &= ~DIFF_OPT_##flag)\n-- \n1.5.5.1.375.g1becb\n"},{"id":"76956","messageId":"alpine.DEB.1.00.0805141803370.30431@racer","threadId":"13517","inReplyTo":"alpine.DEB.1.00.0805141802480.30431@racer","subject":"[PATCH 2/3] Teach update-index about --ignore-submodules","fromName":"Johannes Schindelin","fromEmail":"johannes.schindelin@gmx.de","sentAt":"2008-05-14T17:03:45Z","receivedAt":"2008-05-14T17:03:45Z","isPatch":true,"sender":{"key":"johannes.schindelin@gmx.de","avatar":"https://avatars.githubusercontent.com/u/127790?v=4"},"body":"\nLike with the diff machinery, update-index should sometimes just\nignore submodules (e.g. to determine a clean state before a rebase).\n\nSigned-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>\n---\n Documentation/git-update-index.txt |    5 +++++\n builtin-update-index.c             |    4 ++++\n cache.h                            |    1 +\n read-cache.c                       |    4 ++++\n 4 files changed, 14 insertions(+), 0 deletions(-)\n\ndiff --git a/Documentation/git-update-index.txt b/Documentation/git-update-index.txt\nindex 66be18e..0664060 100644\n--- a/Documentation/git-update-index.txt\n+++ b/Documentation/git-update-index.txt\n@@ -15,6 +15,7 @@ SYNOPSIS\n \t     [--cacheinfo <mode> <object> <file>]\\*\n \t     [--chmod=(+|-)x]\n \t     [--assume-unchanged | --no-assume-unchanged]\n+\t     [--ignore-submodules]\n \t     [--really-refresh] [--unresolve] [--again | -g]\n \t     [--info-only] [--index-info]\n \t     [-z] [--stdin]\n@@ -54,6 +55,10 @@ OPTIONS\n         default behavior is to error out.  This option makes\n         git-update-index continue anyway.\n \n+--ignore-submodules:\n+\tDo not try to update submodules.  This option is only respected\n+\twhen passed before --refresh.\n+\n --unmerged::\n         If --refresh finds unmerged changes in the index, the default\n         behavior is to error out.  This option makes git-update-index\ndiff --git a/builtin-update-index.c b/builtin-update-index.c\nindex a8795d3..d4c85c0 100644\n--- a/builtin-update-index.c\n+++ b/builtin-update-index.c\n@@ -593,6 +593,10 @@ int cmd_update_index(int argc, const char **argv, const char *prefix)\n \t\t\t\trefresh_flags |= REFRESH_QUIET;\n \t\t\t\tcontinue;\n \t\t\t}\n+\t\t\tif (!strcmp(path, \"--ignore-submodules\")) {\n+\t\t\t\trefresh_flags |= REFRESH_IGNORE_SUBMODULES;\n+\t\t\t\tcontinue;\n+\t\t\t}\n \t\t\tif (!strcmp(path, \"--add\")) {\n \t\t\t\tallow_add = 1;\n \t\t\t\tcontinue;\ndiff --git a/cache.h b/cache.h\nindex c761915..3d4e8e7 100644\n--- a/cache.h\n+++ b/cache.h\n@@ -393,6 +393,7 @@ extern void fill_stat_cache_info(struct cache_entry *ce, struct stat *st);\n #define REFRESH_UNMERGED\t0x0002\t/* allow unmerged */\n #define REFRESH_QUIET\t\t0x0004\t/* be quiet about it */\n #define REFRESH_IGNORE_MISSING\t0x0008\t/* ignore non-existent */\n+#define REFRESH_IGNORE_SUBMODULES\t0x0008\t/* ignore submodules */\n extern int refresh_index(struct index_state *, unsigned int flags, const char **pathspec, char *seen);\n \n struct lock_file {\ndiff --git a/read-cache.c b/read-cache.c\nindex 8b467f8..bc03981 100644\n--- a/read-cache.c\n+++ b/read-cache.c\n@@ -942,6 +942,7 @@ int refresh_index(struct index_state *istate, unsigned int flags, const char **p\n \tint allow_unmerged = (flags & REFRESH_UNMERGED) != 0;\n \tint quiet = (flags & REFRESH_QUIET) != 0;\n \tint not_new = (flags & REFRESH_IGNORE_MISSING) != 0;\n+\tint ignore_submodules = (flags & REFRESH_IGNORE_SUBMODULES) != 0;\n \tunsigned int options = really ? CE_MATCH_IGNORE_VALID : 0;\n \n \tfor (i = 0; i < istate->cache_nr; i++) {\n@@ -949,6 +950,9 @@ int refresh_index(struct index_state *istate, unsigned int flags, const char **p\n \t\tint cache_errno = 0;\n \n \t\tce = istate->cache[i];\n+\t\tif (ignore_submodules && S_ISGITLINK(ce->ce_mode))\n+\t\t\tcontinue;\n+\n \t\tif (ce_stage(ce)) {\n \t\t\twhile ((i < istate->cache_nr) &&\n \t\t\t       ! strcmp(istate->cache[i]->name, ce->name))\n-- \n1.5.5.1.375.g1becb\n"},{"id":"76957","messageId":"alpine.DEB.1.00.0805141803510.30431@racer","threadId":"13517","inReplyTo":"alpine.DEB.1.00.0805141802480.30431@racer","subject":"[PATCH 3/3] Ignore dirty submodule states during rebase and stash","fromName":"Johannes Schindelin","fromEmail":"johannes.schindelin@gmx.de","sentAt":"2008-05-14T17:03:59Z","receivedAt":"2008-05-14T17:03:59Z","isPatch":true,"sender":{"key":"johannes.schindelin@gmx.de","avatar":"https://avatars.githubusercontent.com/u/127790?v=4"},"body":"\nWhen rebasing or stashing, chances are that you do not care about\ndirty submodules, since they are not updated by those actions anyway.\nSo ignore the submodules' states.\n\nNote: the submodule states -- as committed in the superproject --\nwill still be stashed and rebased, it is _just_ the state of the\nsubmodule in the working tree which is ignored.\n\nSigned-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>\n---\n git-rebase--interactive.sh  |   11 +++--\n git-rebase.sh               |    8 ++--\n git-stash.sh                |    6 +-\n t/t7402-submodule-rebase.sh |   92 +++++++++++++++++++++++++++++++++++++++++++\n 4 files changed, 105 insertions(+), 12 deletions(-)\n create mode 100755 t/t7402-submodule-rebase.sh\n\ndiff --git a/git-rebase--interactive.sh b/git-rebase--interactive.sh\nindex 2a01182..a9daa1b 100755\n--- a/git-rebase--interactive.sh\n+++ b/git-rebase--interactive.sh\n@@ -56,9 +56,9 @@ output () {\n require_clean_work_tree () {\n \t# test if working tree is dirty\n \tgit rev-parse --verify HEAD > /dev/null &&\n-\tgit update-index --refresh &&\n-\tgit diff-files --quiet &&\n-\tgit diff-index --cached --quiet HEAD -- ||\n+\tgit update-index --ignore-submodules --refresh &&\n+\tgit diff-files --quiet --ignore-submodules &&\n+\tgit diff-index --cached --quiet HEAD --ignore-submodules -- ||\n \tdie \"Working tree is dirty\"\n }\n \n@@ -526,11 +526,12 @@ do\n \t\t# Sanity check\n \t\tgit rev-parse --verify HEAD >/dev/null ||\n \t\t\tdie \"Cannot read HEAD\"\n-\t\tgit update-index --refresh && git diff-files --quiet ||\n+\t\tgit update-index --ignore-submodules --refresh &&\n+\t\t\tgit diff-files --quiet --ignore-submodules ||\n \t\t\tdie \"Working tree is dirty\"\n \n \t\t# do we have anything to commit?\n-\t\tif git diff-index --cached --quiet HEAD --\n+\t\tif git diff-index --cached --quiet --ignore-submodules HEAD --\n \t\tthen\n \t\t\t: Nothing to commit -- skip this\n \t\telse\ndiff --git a/git-rebase.sh b/git-rebase.sh\nindex 68855c1..dd7dfe1 100755\n--- a/git-rebase.sh\n+++ b/git-rebase.sh\n@@ -60,7 +60,7 @@ continue_merge () {\n \tfi\n \n \tcmt=`cat \"$dotest/current\"`\n-\tif ! git diff-index --quiet HEAD --\n+\tif ! git diff-index --quiet --ignore-submodules HEAD --\n \tthen\n \t\tif ! git commit --no-verify -C \"$cmt\"\n \t\tthen\n@@ -150,7 +150,7 @@ while test $# != 0\n do\n \tcase \"$1\" in\n \t--continue)\n-\t\tgit diff-files --quiet || {\n+\t\tgit diff-files --quiet --ignore-submodules || {\n \t\t\techo \"You must edit all merge conflicts and then\"\n \t\t\techo \"mark them as resolved using git add\"\n \t\t\texit 1\n@@ -282,8 +282,8 @@ else\n fi\n \n # The tree must be really really clean.\n-git update-index --refresh || exit\n-diff=$(git diff-index --cached --name-status -r HEAD --)\n+git update-index --ignore-submodules --refresh || exit\n+diff=$(git diff-index --cached --name-status -r --ignore-submodules HEAD --)\n case \"$diff\" in\n ?*)\techo \"cannot rebase: your index is not up-to-date\"\n \techo \"$diff\"\ndiff --git a/git-stash.sh b/git-stash.sh\nindex c2b6820..4938ade 100755\n--- a/git-stash.sh\n+++ b/git-stash.sh\n@@ -15,8 +15,8 @@ trap 'rm -f \"$TMP-*\"' 0\n ref_stash=refs/stash\n \n no_changes () {\n-\tgit diff-index --quiet --cached HEAD -- &&\n-\tgit diff-files --quiet\n+\tgit diff-index --quiet --cached HEAD --ignore-submodules -- &&\n+\tgit diff-files --quiet --ignore-submodules\n }\n \n clear_stash () {\n@@ -130,7 +130,7 @@ show_stash () {\n }\n \n apply_stash () {\n-\tgit diff-files --quiet ||\n+\tgit diff-files --quiet --ignore-submodules ||\n \t\tdie 'Cannot restore on top of a dirty state'\n \n \tunstash_index=\ndiff --git a/t/t7402-submodule-rebase.sh b/t/t7402-submodule-rebase.sh\nnew file mode 100755\nindex 0000000..5becb3e\n--- /dev/null\n+++ b/t/t7402-submodule-rebase.sh\n@@ -0,0 +1,92 @@\n+#!/bin/sh\n+#\n+# Copyright (c) 2008 Johannes Schindelin\n+#\n+\n+test_description='Test rebasing and stashing with dirty submodules'\n+\n+. ./test-lib.sh\n+\n+test_expect_success setup '\n+\n+\techo file > file &&\n+\tgit add file &&\n+\ttest_tick &&\n+\tgit commit -m initial &&\n+\tgit clone . submodule &&\n+\tgit add submodule &&\n+\ttest_tick &&\n+\tgit commit -m submodule &&\n+\techo second line >> file &&\n+\t(cd submodule && git pull) &&\n+\ttest_tick &&\n+\tgit commit -m file-and-submodule -a\n+\n+'\n+\n+test_expect_success 'rebase with a dirty submodule' '\n+\n+\t(cd submodule &&\n+\t echo 3rd line >> file &&\n+\t test_tick &&\n+\t git commit -m fork -a) &&\n+\techo unrelated >> file2 &&\n+\tgit add file2 &&\n+\ttest_tick &&\n+\tgit commit -m unrelated file2 &&\n+\techo other line >> file &&\n+\ttest_tick &&\n+\tgit commit -m update file &&\n+\tCURRENT=$(cd submodule && git rev-parse HEAD) &&\n+\tEXPECTED=$(git rev-parse HEAD~2:submodule) &&\n+\tGIT_TRACE=1 git rebase --onto HEAD~2 HEAD^ &&\n+\tSTORED=$(git rev-parse HEAD:submodule) &&\n+\ttest $EXPECTED = $STORED &&\n+\ttest $CURRENT = $(cd submodule && git rev-parse HEAD)\n+\n+'\n+\n+cat > fake-editor.sh << \\EOF\n+#!/bin/sh\n+echo $EDITOR_TEXT\n+EOF\n+chmod a+x fake-editor.sh\n+\n+test_expect_success 'interactive rebase with a dirty submodule' '\n+\n+\ttest submodule = $(git diff --name-only) &&\n+\tHEAD=$(git rev-parse HEAD) &&\n+\tGIT_EDITOR=\"\\\"$(pwd)/fake-editor.sh\\\"\" EDITOR_TEXT=\"pick $HEAD\" \\\n+\t\tgit rebase -i HEAD^ &&\n+\ttest submodule = $(git diff --name-only)\n+\n+'\n+\n+test_expect_success 'rebase with dirty file and submodule fails' '\n+\n+\techo yet another line >> file &&\n+\ttest_tick &&\n+\tgit commit -m next file &&\n+\techo rewrite > file &&\n+\ttest_tick &&\n+\tgit commit -m rewrite file &&\n+\techo dirty > file &&\n+\t! git rebase --onto HEAD~2 HEAD^\n+\n+'\n+\n+test_expect_success 'stash with a dirty submodule' '\n+\n+\techo new > file &&\n+\tCURRENT=$(cd submodule && git rev-parse HEAD) &&\n+\tgit stash &&\n+\ttest new != $(cat file) &&\n+\ttest submodule = $(git diff --name-only) &&\n+\ttest $CURRENT = $(cd submodule && git rev-parse HEAD) &&\n+\tgit stash apply &&\n+\ttest new = $(cat file) &&\n+\ttest $CURRENT = $(cd submodule && git rev-parse HEAD)\n+\n+'\n+\n+test_done\n-- \n1.5.5.1.375.g1becb\n"},{"id":"76969","messageId":"7vbq38oi3j.fsf@gitster.siamese.dyndns.org","threadId":"13517","inReplyTo":"alpine.DEB.1.00.0805141803240.30431@racer","subject":"Re: [PATCH 1/3] diff options: Introduce --ignore-submodules","fromName":"Junio C Hamano","fromEmail":"gitster@pobox.com","sentAt":"2008-05-14T18:28:48Z","receivedAt":"2008-05-14T18:28:48Z","isPatch":true,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"Johannes Schindelin <Johannes.Schindelin@gmx.de> writes:\n\n> @@ -3355,6 +3357,9 @@ void diff_addremove(struct diff_options *options,\n>  \tchar concatpath[PATH_MAX];\n>  \tstruct diff_filespec *one, *two;\n>  \n> +\tif (DIFF_OPT_TST(options, IGNORE_SUBMODULES) && S_ISGITLINK(mode))\n> +\t\treturn;\n> +\n>  \t/* This may look odd, but it is a preparation for\n>  \t * feeding \"there are unchanged files which should\n>  \t * not produce diffs, but when you are doing copy\n\nSo both removal and addition of a submodule is an uninteresting event.\n\n> @@ -3399,6 +3404,10 @@ void diff_change(struct diff_options *options,\n>  \tchar concatpath[PATH_MAX];\n>  \tstruct diff_filespec *one, *two;\n>  \n> +\tif (DIFF_OPT_TST(options, IGNORE_SUBMODULES) && S_ISGITLINK(old_mode)\n> +\t\t\t&& S_ISGITLINK(new_mode))\n> +\t\treturn;\n\nAnd a submodule changing from revision A to B is uninteresting.\n\nIs it interesting if something that used to be a blob turns into a\nsubmodule, or vice versa?  The code says it is, but I think it would be\nmore convenient to treat it as a removal of blob and addition of a\nsubmodule.\n"},{"id":"76974","messageId":"alpine.DEB.1.00.0805141940460.30431@racer","threadId":"13517","inReplyTo":"7vbq38oi3j.fsf@gitster.siamese.dyndns.org","subject":"Re: [PATCH 1/3] diff options: Introduce --ignore-submodules","fromName":"Johannes Schindelin","fromEmail":"johannes.schindelin@gmx.de","sentAt":"2008-05-14T18:42:55Z","receivedAt":"2008-05-14T18:42:55Z","isPatch":true,"sender":{"key":"johannes.schindelin@gmx.de","avatar":"https://avatars.githubusercontent.com/u/127790?v=4"},"body":"Hi,\n\nOn Wed, 14 May 2008, Junio C Hamano wrote:\n\n> Johannes Schindelin <Johannes.Schindelin@gmx.de> writes:\n> \n> > @@ -3355,6 +3357,9 @@ void diff_addremove(struct diff_options *options,\n> >  \tchar concatpath[PATH_MAX];\n> >  \tstruct diff_filespec *one, *two;\n> >  \n> > +\tif (DIFF_OPT_TST(options, IGNORE_SUBMODULES) && S_ISGITLINK(mode))\n> > +\t\treturn;\n> > +\n> >  \t/* This may look odd, but it is a preparation for\n> >  \t * feeding \"there are unchanged files which should\n> >  \t * not produce diffs, but when you are doing copy\n> \n> So both removal and addition of a submodule is an uninteresting event.\n\nYes.\n\n> > @@ -3399,6 +3404,10 @@ void diff_change(struct diff_options *options,\n> >  \tchar concatpath[PATH_MAX];\n> >  \tstruct diff_filespec *one, *two;\n> >  \n> > +\tif (DIFF_OPT_TST(options, IGNORE_SUBMODULES) && S_ISGITLINK(old_mode)\n> > +\t\t\t&& S_ISGITLINK(new_mode))\n> > +\t\treturn;\n> \n> And a submodule changing from revision A to B is uninteresting.\n> \n> Is it interesting if something that used to be a blob turns into a\n> submodule, or vice versa?  The code says it is, but I think it would be\n> more convenient to treat it as a removal of blob and addition of a\n> submodule.\n\nThe point is: for the sake of a script (which wants to ignore \nsubmodules) asking if there is a diff, I think it makes sense to not \nignore those changes.  IOW I think my patch is enough for the purpose of \ngetting stash/rebase to behave.\n\nCiao,\nDscho\n"},{"id":"76977","messageId":"7vy76cn1aq.fsf@gitster.siamese.dyndns.org","threadId":"13517","inReplyTo":"alpine.DEB.1.00.0805141940460.30431@racer","subject":"Re: [PATCH 1/3] diff options: Introduce --ignore-submodules","fromName":"Junio C Hamano","fromEmail":"gitster@pobox.com","sentAt":"2008-05-14T19:17:01Z","receivedAt":"2008-05-14T19:17:01Z","isPatch":true,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"Johannes Schindelin <Johannes.Schindelin@gmx.de> writes:\n\n> The point is: for the sake of a script (which wants to ignore \n> submodules) asking if there is a diff, I think it makes sense to not \n> ignore those changes.  IOW I think my patch is enough for the purpose of \n> getting stash/rebase to behave.\n\nBut the patch is not about stash/rebase but affects all diff users,\ndoesn't it?\n"},{"id":"76993","messageId":"alpine.DEB.1.00.0805142308400.30431@racer","threadId":"13517","inReplyTo":"7vy76cn1aq.fsf@gitster.siamese.dyndns.org","subject":"Re: [PATCH 1/3] diff options: Introduce --ignore-submodules","fromName":"Johannes Schindelin","fromEmail":"johannes.schindelin@gmx.de","sentAt":"2008-05-14T22:09:07Z","receivedAt":"2008-05-14T22:09:07Z","isPatch":true,"sender":{"key":"johannes.schindelin@gmx.de","avatar":"https://avatars.githubusercontent.com/u/127790?v=4"},"body":"Hi,\n\nOn Wed, 14 May 2008, Junio C Hamano wrote:\n\n> Johannes Schindelin <Johannes.Schindelin@gmx.de> writes:\n> \n> > The point is: for the sake of a script (which wants to ignore \n> > submodules) asking if there is a diff, I think it makes sense to not \n> > ignore those changes.  IOW I think my patch is enough for the purpose \n> > of getting stash/rebase to behave.\n> \n> But the patch is not about stash/rebase but affects all diff users, \n> doesn't it?\n\nDoes it?  I thought I hid all that special handling behind the \n--ignore-submodules options.\n\nCiao,\nDscho\n"},{"id":"76994","messageId":"7vod78k022.fsf@gitster.siamese.dyndns.org","threadId":"13517","inReplyTo":"alpine.DEB.1.00.0805142308400.30431@racer","subject":"Re: [PATCH 1/3] diff options: Introduce --ignore-submodules","fromName":"Junio C Hamano","fromEmail":"gitster@pobox.com","sentAt":"2008-05-14T22:12:05Z","receivedAt":"2008-05-14T22:12:05Z","isPatch":true,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"Johannes Schindelin <Johannes.Schindelin@gmx.de> writes:\n\n> Hi,\n>\n> On Wed, 14 May 2008, Junio C Hamano wrote:\n>\n>> Johannes Schindelin <Johannes.Schindelin@gmx.de> writes:\n>> \n>> > The point is: for the sake of a script (which wants to ignore \n>> > submodules) asking if there is a diff, I think it makes sense to not \n>> > ignore those changes.  IOW I think my patch is enough for the purpose \n>> > of getting stash/rebase to behave.\n>> \n>> But the patch is not about stash/rebase but affects all diff users, \n>> doesn't it?\n>\n> Does it?  I thought I hid all that special handling behind the \n> --ignore-submodules options.\n\nThat's exactly the point.  The option reads \"ignore submodules\", not\n\"special option for use only by stash and rebase\".\n"},{"id":"77005","messageId":"alpine.DEB.1.00.0805150204440.30431@racer","threadId":"13517","inReplyTo":"7vod78k022.fsf@gitster.siamese.dyndns.org","subject":"Re: [PATCH 1/3] diff options: Introduce --ignore-submodules","fromName":"Johannes Schindelin","fromEmail":"johannes.schindelin@gmx.de","sentAt":"2008-05-15T01:09:22Z","receivedAt":"2008-05-15T01:09:22Z","isPatch":true,"sender":{"key":"johannes.schindelin@gmx.de","avatar":"https://avatars.githubusercontent.com/u/127790?v=4"},"body":"Hi,\n\nOn Wed, 14 May 2008, Junio C Hamano wrote:\n\n> Johannes Schindelin <Johannes.Schindelin@gmx.de> writes:\n> \n> > On Wed, 14 May 2008, Junio C Hamano wrote:\n> >\n> >> Johannes Schindelin <Johannes.Schindelin@gmx.de> writes:\n> >> \n> >> > The point is: for the sake of a script (which wants to ignore \n> >> > submodules) asking if there is a diff, I think it makes sense to \n> >> > not ignore those changes.  IOW I think my patch is enough for the \n> >> > purpose of getting stash/rebase to behave.\n> >> \n> >> But the patch is not about stash/rebase but affects all diff users, \n> >> doesn't it?\n> >\n> > Does it?  I thought I hid all that special handling behind the \n> > --ignore-submodules options.\n> \n> That's exactly the point.  The option reads \"ignore submodules\", not \n> \"special option for use only by stash and rebase\".\n\nBut it also does not read \"ignore submodules and those blobs/trees that \nhappen to replace (or be replaced by) submodules\".\n\nI think it is not a bad thing to call it \"ignore submodules\", but show the \nsubmodules when something else than a submodule is involved, too.\n\nI see where you are heading with the \"split diff into removal of submodule \n/ addition of a blob\", but I think that would be overly clever, and not \nhelpful.  I know that I would want to have that marked as a problem when \nrebasing.\n\nCiao,\nDscho\n"},{"id":"77008","messageId":"7v3aokjpxv.fsf@gitster.siamese.dyndns.org","threadId":"13517","inReplyTo":"alpine.DEB.1.00.0805150204440.30431@racer","subject":"Re: [PATCH 1/3] diff options: Introduce --ignore-submodules","fromName":"Junio C Hamano","fromEmail":"gitster@pobox.com","sentAt":"2008-05-15T01:50:36Z","receivedAt":"2008-05-15T01:50:36Z","isPatch":true,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"Johannes Schindelin <Johannes.Schindelin@gmx.de> writes:\n\n>> That's exactly the point.  The option reads \"ignore submodules\", not \n>> \"special option for use only by stash and rebase\".\n>\n> But it also does not read \"ignore submodules and those blobs/trees that \n> happen to replace (or be replaced by) submodules\".\n\nI think \"ignore submodules\" option, if exists, would mean \"ignore changes\nthat involve submodules\", and I think everybody would agree with that.\n\nBecause we are talking about an option to \"diff\", changes involve two\nsides (preimage and postimage).  Logically, you can define the class of\nchanges that involve submodules in two ways:\n\n * both sides of the change must be a submodule; otherwise the change does\n   not involve a submodule.\n\n * either side of the change is a submodule; such a change involve a\n   submodule.\n\nI am saying that the latter makes much more sense (worse yet, what you did\nfor creation and deletion is inconsistent --- they are void vs submodule\nand you treat them as \"change that involve submodule\").\n\nDidn't you make the option introduction to read \"sometimes you are not\ninterested in submodules...\" or something?\n"},{"id":"77048","messageId":"alpine.DEB.1.00.0805151439190.30431@racer","threadId":"13517","inReplyTo":"7v3aokjpxv.fsf@gitster.siamese.dyndns.org","subject":"Re: [PATCH 1/3] diff options: Introduce --ignore-submodules","fromName":"Johannes Schindelin","fromEmail":"johannes.schindelin@gmx.de","sentAt":"2008-05-15T13:58:14Z","receivedAt":"2008-05-15T13:58:14Z","isPatch":true,"sender":{"key":"johannes.schindelin@gmx.de","avatar":"https://avatars.githubusercontent.com/u/127790?v=4"},"body":"Hi,\n\nOn Wed, 14 May 2008, Junio C Hamano wrote:\n\n> Johannes Schindelin <Johannes.Schindelin@gmx.de> writes:\n> \n> >> That's exactly the point.  The option reads \"ignore submodules\", not \n> >> \"special option for use only by stash and rebase\".\n> >\n> > But it also does not read \"ignore submodules and those blobs/trees \n> > that happen to replace (or be replaced by) submodules\".\n> \n> I think \"ignore submodules\" option, if exists, would mean \"ignore \n> changes that involve submodules\", and I think everybody would agree with \n> that.\n> \n> Because we are talking about an option to \"diff\", changes involve two\n> sides (preimage and postimage).  Logically, you can define the class of\n> changes that involve submodules in two ways:\n> \n>  * both sides of the change must be a submodule; otherwise the change does\n>    not involve a submodule.\n> \n>  * either side of the change is a submodule; such a change involve a\n>    submodule.\n> \n> I am saying that the latter makes much more sense (worse yet, what you \n> did for creation and deletion is inconsistent --- they are void vs \n> submodule and you treat them as \"change that involve submodule\").\n\nOkay, maybe the introduction, and the intuitive understanding of \"ignore \nsubmodules\" is the latter.\n\nBut I maintain that there is no sensible operation you would need it \nfor.\n\nSo, how about --only-non-submodules?\n\nCiao,\nDscho\n"}]}