* [PATCH] completion: Add PS1 configuration for submodules @ 2010-12-06 23:22 Scott Kyle 2010-12-07 9:40 ` SZEDER Gábor 2010-12-07 12:15 ` Ævar Arnfjörð Bjarmason 0 siblings, 2 replies; 15+ messages in thread From: Scott Kyle @ 2010-12-06 23:22 UTC (permalink / raw) To: git; +Cc: Scott Kyle For those who often work on repositories with submodules, the dirty indicator for unstaged changes will almost always show because development is simultaneously happening on those submodules. The config option diff.ignoreSubmodules is not appropriate for this use because it has larger implications. Signed-off-by: Scott Kyle <scott@appden.com> --- contrib/completion/git-completion.bash | 7 +++++-- 1 files changed, 5 insertions(+), 2 deletions(-) diff --git a/contrib/completion/git-completion.bash b/contrib/completion/git-completion.bash index 604fa79..539bcb1 100755 --- a/contrib/completion/git-completion.bash +++ b/contrib/completion/git-completion.bash @@ -37,7 +37,9 @@ # value, unstaged (*) and staged (+) changes will be shown next # to the branch name. You can configure this per-repository # with the bash.showDirtyState variable, which defaults to true -# once GIT_PS1_SHOWDIRTYSTATE is enabled. +# once GIT_PS1_SHOWDIRTYSTATE is enabled. You can also set +# GIT_PS1_IGNORESUBMODULES to a value that git diff understands +# to adjust the behavior of the dirty state indicator. # # You can also see if currently something is stashed, by setting # GIT_PS1_SHOWSTASHSTATE to a nonempty value. If something is stashed, @@ -286,7 +288,8 @@ __git_ps1 () elif [ "true" = "$(git rev-parse --is-inside-work-tree 2>/dev/null)" ]; then if [ -n "${GIT_PS1_SHOWDIRTYSTATE-}" ]; then if [ "$(git config --bool bash.showDirtyState)" != "false" ]; then - git diff --no-ext-diff --quiet --exit-code || w="*" + local ignore_submodules=${GIT_PS1_IGNORESUBMODULES+"--ignore-submodules=$GIT_PS1_IGNORESUBMODULES"} + git diff $ignore_submodules --no-ext-diff --quiet --exit-code || w="*" if git rev-parse --quiet --verify HEAD >/dev/null; then git diff-index --cached --quiet HEAD -- || i="+" else -- 1.7.3.3.574.g98527 ^ permalink raw reply related [flat|nested] 15+ messages in thread
* Re: [PATCH] completion: Add PS1 configuration for submodules 2010-12-06 23:22 [PATCH] completion: Add PS1 configuration for submodules Scott Kyle @ 2010-12-07 9:40 ` SZEDER Gábor 2010-12-07 12:15 ` Ævar Arnfjörð Bjarmason 1 sibling, 0 replies; 15+ messages in thread From: SZEDER Gábor @ 2010-12-07 9:40 UTC (permalink / raw) To: Scott Kyle; +Cc: git Hi Scott, On Mon, Dec 06, 2010 at 03:22:43PM -0800, Scott Kyle wrote: > For those who often work on repositories with submodules, the dirty > indicator for unstaged changes will almost always show because development > is simultaneously happening on those submodules. The config option > diff.ignoreSubmodules is not appropriate for this use because it has larger > implications. > > Signed-off-by: Scott Kyle <scott@appden.com> > --- > contrib/completion/git-completion.bash | 7 +++++-- > 1 files changed, 5 insertions(+), 2 deletions(-) > > diff --git a/contrib/completion/git-completion.bash b/contrib/completion/git-completion.bash > index 604fa79..539bcb1 100755 > --- a/contrib/completion/git-completion.bash > +++ b/contrib/completion/git-completion.bash > @@ -37,7 +37,9 @@ > # value, unstaged (*) and staged (+) changes will be shown next > # to the branch name. You can configure this per-repository > # with the bash.showDirtyState variable, which defaults to true > -# once GIT_PS1_SHOWDIRTYSTATE is enabled. > +# once GIT_PS1_SHOWDIRTYSTATE is enabled. You can also set > +# GIT_PS1_IGNORESUBMODULES to a value that git diff understands > +# to adjust the behavior of the dirty state indicator. git diff "understands" a lot of things, therefore I'd like to be a bit more specific here by mentioning the --ignore-submodules= option: +# once GIT_PS1_SHOWDIRTYSTATE is enabled. You can also set +# GIT_PS1_IGNORESUBMODULES to a value that git diff +# --ignore-submodules= understands to adjust the behavior of the +# dirty state indicator. But it might be just me being unfamiliar with submodules. Otherwise it looks good and reasonable to me. > # > # You can also see if currently something is stashed, by setting > # GIT_PS1_SHOWSTASHSTATE to a nonempty value. If something is stashed, > @@ -286,7 +288,8 @@ __git_ps1 () > elif [ "true" = "$(git rev-parse --is-inside-work-tree 2>/dev/null)" ]; then > if [ -n "${GIT_PS1_SHOWDIRTYSTATE-}" ]; then > if [ "$(git config --bool bash.showDirtyState)" != "false" ]; then > - git diff --no-ext-diff --quiet --exit-code || w="*" > + local ignore_submodules=${GIT_PS1_IGNORESUBMODULES+"--ignore-submodules=$GIT_PS1_IGNORESUBMODULES"} > + git diff $ignore_submodules --no-ext-diff --quiet --exit-code || w="*" > if git rev-parse --quiet --verify HEAD >/dev/null; then > git diff-index --cached --quiet HEAD -- || i="+" > else > -- > 1.7.3.3.574.g98527 > > ^ permalink raw reply [flat|nested] 15+ messages in thread
* Re: [PATCH] completion: Add PS1 configuration for submodules 2010-12-06 23:22 [PATCH] completion: Add PS1 configuration for submodules Scott Kyle 2010-12-07 9:40 ` SZEDER Gábor @ 2010-12-07 12:15 ` Ævar Arnfjörð Bjarmason 2010-12-07 20:31 ` Kevin Ballard 2010-12-07 20:37 ` Scott Kyle 1 sibling, 2 replies; 15+ messages in thread From: Ævar Arnfjörð Bjarmason @ 2010-12-07 12:15 UTC (permalink / raw) To: Scott Kyle; +Cc: git On Tue, Dec 7, 2010 at 00:22, Scott Kyle <scott@appden.com> wrote: > For those who often work on repositories with submodules, the dirty > indicator for unstaged changes will almost always show because development > is simultaneously happening on those submodules. The config option > diff.ignoreSubmodules is not appropriate for this use because it has larger > implications. Wouldn't it be a lot better to instead add support for showing submodule dirtyness as distinct from the main tree's dirtyness? Then you could easily spot if you had either your tree / submodule tree changes, without just ignoring them. ^ permalink raw reply [flat|nested] 15+ messages in thread
* Re: [PATCH] completion: Add PS1 configuration for submodules 2010-12-07 12:15 ` Ævar Arnfjörð Bjarmason @ 2010-12-07 20:31 ` Kevin Ballard 2010-12-07 21:08 ` Jens Lehmann 2010-12-07 20:37 ` Scott Kyle 1 sibling, 1 reply; 15+ messages in thread From: Kevin Ballard @ 2010-12-07 20:31 UTC (permalink / raw) To: Ævar Arnfjörð Bjarmason; +Cc: Scott Kyle, git On Dec 7, 2010, at 4:15 AM, Ævar Arnfjörð Bjarmason wrote: > On Tue, Dec 7, 2010 at 00:22, Scott Kyle <scott@appden.com> wrote: >> For those who often work on repositories with submodules, the dirty >> indicator for unstaged changes will almost always show because development >> is simultaneously happening on those submodules. The config option >> diff.ignoreSubmodules is not appropriate for this use because it has larger >> implications. > > Wouldn't it be a lot better to instead add support for showing > submodule dirtyness as distinct from the main tree's dirtyness? Then > you could easily spot if you had either your tree / submodule tree > changes, without just ignoring them. That sounds like a good idea, but it doesn't necessarily have to come with this patch. Scott's use case here is he has a submodule that is _always_ dirty, and he simply doesn't want to see that stuff in the PS1. Having an option to show it separately would be very useful for me, but should perhaps be written as a separate patch. -Kevin Ballard ^ permalink raw reply [flat|nested] 15+ messages in thread
* Re: [PATCH] completion: Add PS1 configuration for submodules 2010-12-07 20:31 ` Kevin Ballard @ 2010-12-07 21:08 ` Jens Lehmann 2010-12-07 21:17 ` Scott Kyle 0 siblings, 1 reply; 15+ messages in thread From: Jens Lehmann @ 2010-12-07 21:08 UTC (permalink / raw) To: Kevin Ballard; +Cc: Ævar Arnfjörð Bjarmason, Scott Kyle, git Am 07.12.2010 21:31, schrieb Kevin Ballard: > On Dec 7, 2010, at 4:15 AM, Ævar Arnfjörð Bjarmason wrote: > >> On Tue, Dec 7, 2010 at 00:22, Scott Kyle <scott@appden.com> wrote: >>> For those who often work on repositories with submodules, the dirty >>> indicator for unstaged changes will almost always show because development >>> is simultaneously happening on those submodules. The config option >>> diff.ignoreSubmodules is not appropriate for this use because it has larger >>> implications. >> >> Wouldn't it be a lot better to instead add support for showing >> submodule dirtyness as distinct from the main tree's dirtyness? Then >> you could easily spot if you had either your tree / submodule tree >> changes, without just ignoring them. > > That sounds like a good idea, but it doesn't necessarily have to come with > this patch. Scott's use case here is he has a submodule that is _always_ dirty, > and he simply doesn't want to see that stuff in the PS1. Having an option to > show it separately would be very useful for me, but should perhaps be written > as a separate patch. I'm not sure if I understand your case correctly, but if there is only one submodule that is always dirty and everybody knows that but nobody cares, won't it make sense to change the "submodule.<name>.ignore" config option for that peculiar submodule via .git/config or .gitmodules? ^ permalink raw reply [flat|nested] 15+ messages in thread
* Re: [PATCH] completion: Add PS1 configuration for submodules 2010-12-07 21:08 ` Jens Lehmann @ 2010-12-07 21:17 ` Scott Kyle 2010-12-07 21:28 ` Jens Lehmann 2010-12-07 21:29 ` Jonathan Nieder 0 siblings, 2 replies; 15+ messages in thread From: Scott Kyle @ 2010-12-07 21:17 UTC (permalink / raw) To: Jens Lehmann; +Cc: Kevin Ballard, Ævar Arnfjörð Bjarmason, git On Tue, Dec 7, 2010 at 1:08 PM, Jens Lehmann <Jens.Lehmann@web.de> wrote: > Am 07.12.2010 21:31, schrieb Kevin Ballard: >> On Dec 7, 2010, at 4:15 AM, Ęvar Arnfjörš Bjarmason wrote: >> >>> On Tue, Dec 7, 2010 at 00:22, Scott Kyle <scott@appden.com> wrote: >>>> For those who often work on repositories with submodules, the dirty >>>> indicator for unstaged changes will almost always show because development >>>> is simultaneously happening on those submodules. The config option >>>> diff.ignoreSubmodules is not appropriate for this use because it has larger >>>> implications. >>> >>> Wouldn't it be a lot better to instead add support for showing >>> submodule dirtyness as distinct from the main tree's dirtyness? Then >>> you could easily spot if you had either your tree / submodule tree >>> changes, without just ignoring them. >> >> That sounds like a good idea, but it doesn't necessarily have to come with >> this patch. Scott's use case here is he has a submodule that is _always_ dirty, >> and he simply doesn't want to see that stuff in the PS1. Having an option to >> show it separately would be very useful for me, but should perhaps be written >> as a separate patch. > > I'm not sure if I understand your case correctly, but if there is only one > submodule that is always dirty and everybody knows that but nobody cares, > won't it make sense to change the "submodule.<name>.ignore" config option > for that peculiar submodule via .git/config or .gitmodules? > If I set the "submodule.<name>.ignore" then diffing around inside my history will not show the changes to that particular submodule. That is what I meant by diff.ignoreSubmodules having larger implications. ^ permalink raw reply [flat|nested] 15+ messages in thread
* Re: [PATCH] completion: Add PS1 configuration for submodules 2010-12-07 21:17 ` Scott Kyle @ 2010-12-07 21:28 ` Jens Lehmann 2010-12-07 21:29 ` Jonathan Nieder 1 sibling, 0 replies; 15+ messages in thread From: Jens Lehmann @ 2010-12-07 21:28 UTC (permalink / raw) To: Scott Kyle; +Cc: Kevin Ballard, Ævar Arnfjörð Bjarmason, git Am 07.12.2010 22:17, schrieb Scott Kyle: > On Tue, Dec 7, 2010 at 1:08 PM, Jens Lehmann <Jens.Lehmann@web.de> wrote: >> Am 07.12.2010 21:31, schrieb Kevin Ballard: >>> On Dec 7, 2010, at 4:15 AM, Ęvar Arnfjörš Bjarmason wrote: >>> >>>> On Tue, Dec 7, 2010 at 00:22, Scott Kyle <scott@appden.com> wrote: >>>>> For those who often work on repositories with submodules, the dirty >>>>> indicator for unstaged changes will almost always show because development >>>>> is simultaneously happening on those submodules. The config option >>>>> diff.ignoreSubmodules is not appropriate for this use because it has larger >>>>> implications. >>>> >>>> Wouldn't it be a lot better to instead add support for showing >>>> submodule dirtyness as distinct from the main tree's dirtyness? Then >>>> you could easily spot if you had either your tree / submodule tree >>>> changes, without just ignoring them. >>> >>> That sounds like a good idea, but it doesn't necessarily have to come with >>> this patch. Scott's use case here is he has a submodule that is _always_ dirty, >>> and he simply doesn't want to see that stuff in the PS1. Having an option to >>> show it separately would be very useful for me, but should perhaps be written >>> as a separate patch. >> >> I'm not sure if I understand your case correctly, but if there is only one >> submodule that is always dirty and everybody knows that but nobody cares, >> won't it make sense to change the "submodule.<name>.ignore" config option >> for that peculiar submodule via .git/config or .gitmodules? >> > > If I set the "submodule.<name>.ignore" then diffing around inside my > history will not show the changes to that particular submodule. That > is what I meant by diff.ignoreSubmodules having larger implications. Ah, seems I misunderstood your submodule being dirty as modified or untracked files being present in it's work tree. But your submodules HEAD seems to differ from the commit recorded in the superproject, and then of course "submodule.<name>.ignore=dirty" won't help you. ^ permalink raw reply [flat|nested] 15+ messages in thread
* Re: [PATCH] completion: Add PS1 configuration for submodules 2010-12-07 21:17 ` Scott Kyle 2010-12-07 21:28 ` Jens Lehmann @ 2010-12-07 21:29 ` Jonathan Nieder 2010-12-07 22:59 ` Scott Kyle 1 sibling, 1 reply; 15+ messages in thread From: Jonathan Nieder @ 2010-12-07 21:29 UTC (permalink / raw) To: Scott Kyle Cc: Jens Lehmann, Kevin Ballard, Ævar Arnfjörð Bjarmason, git Scott Kyle wrote: > If I set the "submodule.<name>.ignore" then diffing around inside my > history will not show the changes to that particular submodule. Even if you set it to "dirty"? ^ permalink raw reply [flat|nested] 15+ messages in thread
* Re: [PATCH] completion: Add PS1 configuration for submodules 2010-12-07 21:29 ` Jonathan Nieder @ 2010-12-07 22:59 ` Scott Kyle 2010-12-12 6:38 ` Jonathan Nieder 0 siblings, 1 reply; 15+ messages in thread From: Scott Kyle @ 2010-12-07 22:59 UTC (permalink / raw) To: Jonathan Nieder Cc: Jens Lehmann, Kevin Ballard, Ævar Arnfjörð, git On Tue, Dec 7, 2010 at 1:29 PM, Jonathan Nieder <jrnieder@gmail.com> wrote: > Scott Kyle wrote: > >> If I set the "submodule.<name>.ignore" then diffing around inside my >> history will not show the changes to that particular submodule. > > Even if you set it to "dirty"? > Setting it to "dirty" is far less disruptive, you're right, but that wouldn't do me much good since my submodules are often on different branches while developing. ^ permalink raw reply [flat|nested] 15+ messages in thread
* Re: [PATCH] completion: Add PS1 configuration for submodules 2010-12-07 22:59 ` Scott Kyle @ 2010-12-12 6:38 ` Jonathan Nieder 2010-12-13 18:12 ` Jens Lehmann 0 siblings, 1 reply; 15+ messages in thread From: Jonathan Nieder @ 2010-12-12 6:38 UTC (permalink / raw) To: Scott Kyle; +Cc: Jens Lehmann, Kevin Ballard, Ævar Arnfjörð, git Scott Kyle wrote: > On Tue, Dec 7, 2010 at 1:29 PM, Jonathan Nieder <jrnieder@gmail.com> wrote: >> Scott Kyle wrote: >>> If I set the "submodule.<name>.ignore" then diffing around inside my >>> history will not show the changes to that particular submodule. >> >> Even if you set it to "dirty"? > > Setting it to "dirty" is far less disruptive, you're right, but that > wouldn't do me much good since my submodules are often on different > branches while developing. Ah, I see now. How about something like this? Untested, just a vague sketch to show the idea. Signed-off-by: Jonathan Nieder <jrnieder@gmail.com> --- Documentation/config.txt | 4 +++- Documentation/diff-options.txt | 7 +++++-- Documentation/git-status.txt | 14 ++------------ Documentation/gitmodules.txt | 4 +++- diff-lib.c | 3 ++- diff.h | 3 ++- submodule.c | 4 ++++ 7 files changed, 21 insertions(+), 18 deletions(-) diff --git a/Documentation/config.txt b/Documentation/config.txt index 0f85793..b93e92b 100644 --- a/Documentation/config.txt +++ b/Documentation/config.txt @@ -1810,7 +1810,9 @@ submodule.<name>.update:: submodule.<name>.ignore:: Defines under what circumstances "git status" and the diff family show a submodule as modified. When set to "all", it will never be considered - modified, "dirty" will ignore all changes to the submodules work tree and + modified, "worktree" will ignore all changes in the work tree not + registered in the superproject index, "dirty" will ignore all changes + to the submodules work tree and takes only differences between the HEAD of the submodule and the commit recorded in the superproject into account. "untracked" will additionally let submodules with modified tracked files in their work tree show up. diff --git a/Documentation/diff-options.txt b/Documentation/diff-options.txt index f3e9538..93fe084 100644 --- a/Documentation/diff-options.txt +++ b/Documentation/diff-options.txt @@ -360,7 +360,8 @@ endif::git-format-patch[] --ignore-submodules[=<when>]:: Ignore changes to submodules in the diff generation. <when> can be - either "none", "untracked", "dirty" or "all", which is the default + either "none", "untracked", "dirty", "worktree", or "all", which is + the default. Using "none" will consider the submodule modified when it either contains untracked or modified files or its HEAD differs from the commit recorded in the superproject and can be used to override any settings of the @@ -369,7 +370,9 @@ endif::git-format-patch[] contain untracked content (but they are still scanned for modified content). Using "dirty" ignores all changes to the work tree of submodules, only changes to the commits stored in the superproject are shown (this was - the behavior until 1.7.0). Using "all" hides all changes to submodules. + the behavior until 1.7.0). Using "worktree" submodules in the worktree are + never considered dirty but diffs between old commits do not ignore + submodules. Using "all" hides all changes to submodules. --src-prefix=<prefix>:: Show the given source prefix instead of "a/". diff --git a/Documentation/git-status.txt b/Documentation/git-status.txt index dae190a..8c3b0ac 100644 --- a/Documentation/git-status.txt +++ b/Documentation/git-status.txt @@ -55,18 +55,8 @@ specified. --ignore-submodules[=<when>]:: Ignore changes to submodules when looking for changes. <when> can be - either "none", "untracked", "dirty" or "all", which is the default. - Using "none" will consider the submodule modified when it either contains - untracked or modified files or its HEAD differs from the commit recorded - in the superproject and can be used to override any settings of the - 'ignore' option in linkgit:git-config[1] or linkgit:gitmodules[5]. When - "untracked" is used submodules are not considered dirty when they only - contain untracked content (but they are still scanned for modified - content). Using "dirty" ignores all changes to the work tree of submodules, - only changes to the commits stored in the superproject are shown (this was - the behavior before 1.7.0). Using "all" hides all changes to submodules - (and suppresses the output of submodule summaries when the config option - `status.submodulesummary` is set). + either "none", "untracked", "dirty", "worktree", or "all", + which is the default. See linkgit:git-diff[1] for details. -z:: Terminate entries with NUL, instead of LF. This implies diff --git a/Documentation/gitmodules.txt b/Documentation/gitmodules.txt index bcffd95..02185c4 100644 --- a/Documentation/gitmodules.txt +++ b/Documentation/gitmodules.txt @@ -47,7 +47,9 @@ submodule.<name>.update:: submodule.<name>.ignore:: Defines under what circumstances "git status" and the diff family show a submodule as modified. When set to "all", it will never be considered - modified, "dirty" will ignore all changes to the submodules work tree and + modified; with "worktree", changes in the superproject index are + significant but in the subprojects are not; + "dirty" will ignore all changes to the submodules work tree and takes only differences between the HEAD of the submodule and the commit recorded in the superproject into account. "untracked" will additionally let submodules with modified tracked files in their work tree show up. diff --git a/diff-lib.c b/diff-lib.c index 392ce2b..39fa605 100644 --- a/diff-lib.c +++ b/diff-lib.c @@ -72,7 +72,8 @@ static int match_stat_with_submodule(struct diff_options *diffopt, unsigned orig_flags = diffopt->flags; if (!DIFF_OPT_TST(diffopt, OVERRIDE_SUBMODULE_CONFIG)) set_diffopt_flags_from_submodule_config(diffopt, ce->name); - if (DIFF_OPT_TST(diffopt, IGNORE_SUBMODULES)) + if (DIFF_OPT_TST(diffopt, IGNORE_SUBMODULES) || + DIFF_OPT_TST(diffopt, IGNORE_WT_SUBMODULES)) changed = 0; else if (!DIFF_OPT_TST(diffopt, IGNORE_DIRTY_SUBMODULES) && (!changed || DIFF_OPT_TST(diffopt, DIRTY_SUBMODULES))) diff --git a/diff.h b/diff.h index 0083d92..3b835ce 100644 --- a/diff.h +++ b/diff.h @@ -77,7 +77,8 @@ typedef struct strbuf *(*diff_prefix_fn_t)(struct diff_options *opt, void *data) #define DIFF_OPT_DIRTY_SUBMODULES (1 << 24) #define DIFF_OPT_IGNORE_UNTRACKED_IN_SUBMODULES (1 << 25) #define DIFF_OPT_IGNORE_DIRTY_SUBMODULES (1 << 26) -#define DIFF_OPT_OVERRIDE_SUBMODULE_CONFIG (1 << 27) +#define DIFF_OPT_IGNORE_WT_SUBMODULES (1 << 27) +#define DIFF_OPT_OVERRIDE_SUBMODULE_CONFIG (1 << 28) #define DIFF_OPT_TST(opts, flag) ((opts)->flags & DIFF_OPT_##flag) #define DIFF_OPT_SET(opts, flag) ((opts)->flags |= DIFF_OPT_##flag) diff --git a/submodule.c b/submodule.c index 91a4758..81a99bd 100644 --- a/submodule.c +++ b/submodule.c @@ -102,6 +102,7 @@ int parse_submodule_config_option(const char *var, const char *value) strbuf_release(&submodname); } else if ((len > 7) && !strcmp(var + len - 7, ".ignore")) { if (strcmp(value, "untracked") && strcmp(value, "dirty") && + strcmp(value, "worktree") && strcmp(value, "all") && strcmp(value, "none")) { warning("Invalid parameter \"%s\" for config option \"submodule.%s.ignore\"", value, var); return 0; @@ -127,6 +128,7 @@ void handle_ignore_submodules_arg(struct diff_options *diffopt, DIFF_OPT_CLR(diffopt, IGNORE_SUBMODULES); DIFF_OPT_CLR(diffopt, IGNORE_UNTRACKED_IN_SUBMODULES); DIFF_OPT_CLR(diffopt, IGNORE_DIRTY_SUBMODULES); + DIFF_OPT_CLR(diffopt, IGNORE_WT_SUBMODULES); if (!strcmp(arg, "all")) DIFF_OPT_SET(diffopt, IGNORE_SUBMODULES); @@ -134,6 +136,8 @@ void handle_ignore_submodules_arg(struct diff_options *diffopt, DIFF_OPT_SET(diffopt, IGNORE_UNTRACKED_IN_SUBMODULES); else if (!strcmp(arg, "dirty")) DIFF_OPT_SET(diffopt, IGNORE_DIRTY_SUBMODULES); + else if (!strcmp(arg, "worktree")) + DIFF_OPT_SET(diffopt, IGNORE_WT_SUBMODULES); else if (strcmp(arg, "none")) die("bad --ignore-submodules argument: %s", arg); } -- 1.7.2.4 ^ permalink raw reply related [flat|nested] 15+ messages in thread
* Re: [PATCH] completion: Add PS1 configuration for submodules 2010-12-12 6:38 ` Jonathan Nieder @ 2010-12-13 18:12 ` Jens Lehmann 2010-12-21 22:56 ` Scott Kyle 0 siblings, 1 reply; 15+ messages in thread From: Jens Lehmann @ 2010-12-13 18:12 UTC (permalink / raw) To: Jonathan Nieder Cc: Scott Kyle, Kevin Ballard, Ævar Arnfjörð, git Am 12.12.2010 07:38, schrieb Jonathan Nieder: > Scott Kyle wrote: >> On Tue, Dec 7, 2010 at 1:29 PM, Jonathan Nieder <jrnieder@gmail.com> wrote: >>> Scott Kyle wrote: > >>>> If I set the "submodule.<name>.ignore" then diffing around inside my >>>> history will not show the changes to that particular submodule. >>> >>> Even if you set it to "dirty"? >> >> Setting it to "dirty" is far less disruptive, you're right, but that >> wouldn't do me much good since my submodules are often on different >> branches while developing. > > Ah, I see now. How about something like this? Untested, just a > vague sketch to show the idea. Me thinks your proposal of a new "worktree" option makes sense. Let's hear what Scott says ... ^ permalink raw reply [flat|nested] 15+ messages in thread
* Re: [PATCH] completion: Add PS1 configuration for submodules 2010-12-13 18:12 ` Jens Lehmann @ 2010-12-21 22:56 ` Scott Kyle 0 siblings, 0 replies; 15+ messages in thread From: Scott Kyle @ 2010-12-21 22:56 UTC (permalink / raw) To: Jens Lehmann Cc: Jonathan Nieder, Kevin Ballard, Ævar Arnfjörð, git On Mon, Dec 13, 2010 at 10:12 AM, Jens Lehmann <Jens.Lehmann@web.de> wrote: > Am 12.12.2010 07:38, schrieb Jonathan Nieder: >> Scott Kyle wrote: >>> On Tue, Dec 7, 2010 at 1:29 PM, Jonathan Nieder <jrnieder@gmail.com> wrote: >>>> Scott Kyle wrote: >> >>>>> If I set the "submodule.<name>.ignore" then diffing around inside my >>>>> history will not show the changes to that particular submodule. >>>> >>>> Even if you set it to "dirty"? >>> >>> Setting it to "dirty" is far less disruptive, you're right, but that >>> wouldn't do me much good since my submodules are often on different >>> branches while developing. >> >> Ah, I see now. How about something like this? Untested, just a >> vague sketch to show the idea. > > Me thinks your proposal of a new "worktree" option makes sense. Let's > hear what Scott says ... > I mostly really like how 'worktree' can let me focus in on only the submodules I care about. The drawback is that git status would no longer list my true status. I know that may sound hypocritical, but I intended for this patch to only affect my PS1. At the same time, I would like to see the 'worktree' patch taken, regardless of whether you guys find mine useful. ^ permalink raw reply [flat|nested] 15+ messages in thread
* Re: [PATCH] completion: Add PS1 configuration for submodules 2010-12-07 12:15 ` Ævar Arnfjörð Bjarmason 2010-12-07 20:31 ` Kevin Ballard @ 2010-12-07 20:37 ` Scott Kyle 2010-12-07 20:41 ` Kevin Ballard 1 sibling, 1 reply; 15+ messages in thread From: Scott Kyle @ 2010-12-07 20:37 UTC (permalink / raw) To: Ævar Arnfjörð Bjarmason; +Cc: git [sorry for the duplicate email, my original was rejected from the list] On Tue, Dec 7, 2010 at 4:15 AM, Ævar Arnfjörð Bjarmason <avarab@gmail.com> wrote: > > On Tue, Dec 7, 2010 at 00:22, Scott Kyle <scott@appden.com> wrote: > > For those who often work on repositories with submodules, the dirty > > indicator for unstaged changes will almost always show because development > > is simultaneously happening on those submodules. The config option > > diff.ignoreSubmodules is not appropriate for this use because it has larger > > implications. > > Wouldn't it be a lot better to instead add support for showing > submodule dirtyness as distinct from the main tree's dirtyness? Then > you could easily spot if you had either your tree / submodule tree > changes, without just ignoring them. I considered that, but thought it to be a rather disruptive change, and one that conceptually didn't work. The way I see it, either somebody thinks of their repo as dirty when the submodules are dirty, or not. And I think since this behavior has perpetuated for so long, most users are content with how it currently works. I, however, was not, and so that is why I added an option for people like me. Scott Kyle http://appden.com http://github.com/appden http://twitter.com/appden ^ permalink raw reply [flat|nested] 15+ messages in thread
* Re: [PATCH] completion: Add PS1 configuration for submodules 2010-12-07 20:37 ` Scott Kyle @ 2010-12-07 20:41 ` Kevin Ballard 2010-12-08 0:27 ` Ævar Arnfjörð Bjarmason 0 siblings, 1 reply; 15+ messages in thread From: Kevin Ballard @ 2010-12-07 20:41 UTC (permalink / raw) To: Scott Kyle; +Cc: Ævar Arnfjörð Bjarmason, git On Dec 7, 2010, at 12:37 PM, Scott Kyle wrote: > On Tue, Dec 7, 2010 at 4:15 AM, Ævar Arnfjörð Bjarmason > <avarab@gmail.com> wrote: >> >> On Tue, Dec 7, 2010 at 00:22, Scott Kyle <scott@appden.com> wrote: >>> For those who often work on repositories with submodules, the dirty >>> indicator for unstaged changes will almost always show because development >>> is simultaneously happening on those submodules. The config option >>> diff.ignoreSubmodules is not appropriate for this use because it has larger >>> implications. >> >> Wouldn't it be a lot better to instead add support for showing >> submodule dirtyness as distinct from the main tree's dirtyness? Then >> you could easily spot if you had either your tree / submodule tree >> changes, without just ignoring them. > > I considered that, but thought it to be a rather disruptive change, > and one that conceptually didn't work. The way I see it, either > somebody thinks of their repo as dirty when the submodules are dirty, > or not. And I think since this behavior has perpetuated for so long, > most users are content with how it currently works. I, however, was > not, and so that is why I added an option for people like me. The big win for such a change, from my perspective, is it tells me if I need to do a `git submodule update --recursive`, or if I actually have dirty changes. Because of that, if nobody else picks this up, I'll probably write a patch to introduce such a config at some point in the future. But as I said before, that's something that can be done later and doesn't need to affect this patch. -Kevin Ballard ^ permalink raw reply [flat|nested] 15+ messages in thread
* Re: [PATCH] completion: Add PS1 configuration for submodules 2010-12-07 20:41 ` Kevin Ballard @ 2010-12-08 0:27 ` Ævar Arnfjörð Bjarmason 0 siblings, 0 replies; 15+ messages in thread From: Ævar Arnfjörð Bjarmason @ 2010-12-08 0:27 UTC (permalink / raw) To: Kevin Ballard; +Cc: Scott Kyle, git On Tue, Dec 7, 2010 at 21:41, Kevin Ballard <kevin@sb.org> wrote: > On Dec 7, 2010, at 12:37 PM, Scott Kyle wrote: > >> On Tue, Dec 7, 2010 at 4:15 AM, Ævar Arnfjörð Bjarmason >> <avarab@gmail.com> wrote: >>> >>> On Tue, Dec 7, 2010 at 00:22, Scott Kyle <scott@appden.com> wrote: >>>> For those who often work on repositories with submodules, the dirty >>>> indicator for unstaged changes will almost always show because development >>>> is simultaneously happening on those submodules. The config option >>>> diff.ignoreSubmodules is not appropriate for this use because it has larger >>>> implications. >>> >>> Wouldn't it be a lot better to instead add support for showing >>> submodule dirtyness as distinct from the main tree's dirtyness? Then >>> you could easily spot if you had either your tree / submodule tree >>> changes, without just ignoring them. >> >> I considered that, but thought it to be a rather disruptive change, >> and one that conceptually didn't work. The way I see it, either >> somebody thinks of their repo as dirty when the submodules are dirty, >> or not. And I think since this behavior has perpetuated for so long, >> most users are content with how it currently works. I, however, was >> not, and so that is why I added an option for people like me. > > The big win for such a change, from my perspective, is it tells me if I need > to do a `git submodule update --recursive`, or if I actually have dirty changes. > Because of that, if nobody else picks this up, I'll probably write a patch > to introduce such a config at some point in the future. But as I said before, > that's something that can be done later and doesn't need to affect this patch. Yeah. I didn't mean to imply that the current patch wasn't useful. It also is for people like Scott that just want to ignore submodules, but most of us care about them being dirty. So having support for both (ignoring and tracking) in __git_ps1 would be great. It would be very useful if you or someone else could pick this up. ^ permalink raw reply [flat|nested] 15+ messages in thread
end of thread, other threads:[~2010-12-21 22:56 UTC | newest] Thread overview: 15+ messages (download: mbox.gz follow: Atom feed -- links below jump to the message on this page -- 2010-12-06 23:22 [PATCH] completion: Add PS1 configuration for submodules Scott Kyle 2010-12-07 9:40 ` SZEDER Gábor 2010-12-07 12:15 ` Ævar Arnfjörð Bjarmason 2010-12-07 20:31 ` Kevin Ballard 2010-12-07 21:08 ` Jens Lehmann 2010-12-07 21:17 ` Scott Kyle 2010-12-07 21:28 ` Jens Lehmann 2010-12-07 21:29 ` Jonathan Nieder 2010-12-07 22:59 ` Scott Kyle 2010-12-12 6:38 ` Jonathan Nieder 2010-12-13 18:12 ` Jens Lehmann 2010-12-21 22:56 ` Scott Kyle 2010-12-07 20:37 ` Scott Kyle 2010-12-07 20:41 ` Kevin Ballard 2010-12-08 0:27 ` Ævar Arnfjörð Bjarmason
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).