filter-branch: eliminate duplicate mapped parents
[gitweb.git] / wt-status.c
index e1827faf073ce384bea6a697dd903ffc643bdfdc..86fec8986f3c22911a85a042704d4150ccb6a134 100644 (file)
@@ -519,9 +519,19 @@ static void wt_status_collect_changes_index(struct wt_status *s)
        opt.def = s->is_initial ? EMPTY_TREE_SHA1_HEX : s->reference;
        setup_revisions(0, NULL, &rev, &opt);
 
+       DIFF_OPT_SET(&rev.diffopt, OVERRIDE_SUBMODULE_CONFIG);
        if (s->ignore_submodule_arg) {
-               DIFF_OPT_SET(&rev.diffopt, OVERRIDE_SUBMODULE_CONFIG);
                handle_ignore_submodules_arg(&rev.diffopt, s->ignore_submodule_arg);
+       } else {
+               /*
+                * Unless the user did explicitly request a submodule ignore
+                * mode by passing a command line option we do not ignore any
+                * changed submodule SHA-1s when comparing index and HEAD, no
+                * matter what is configured. Otherwise the user won't be
+                * shown any submodules she manually added (and which are
+                * staged to be committed), which would be really confusing.
+                */
+               handle_ignore_submodules_arg(&rev.diffopt, "dirty");
        }
 
        rev.diffopt.output_format |= DIFF_FORMAT_CALLBACK;
@@ -1547,19 +1557,21 @@ static void wt_shortstatus_print_tracking(struct wt_status *s)
                return;
        }
 
+#define LABEL(string) (s->no_gettext ? (string) : _(string))
+
        color_fprintf(s->fp, header_color, " [");
        if (upstream_is_gone) {
-               color_fprintf(s->fp, header_color, _("gone"));
+               color_fprintf(s->fp, header_color, LABEL(N_("gone")));
        } else if (!num_ours) {
-               color_fprintf(s->fp, header_color, _("behind "));
+               color_fprintf(s->fp, header_color, LABEL(N_("behind ")));
                color_fprintf(s->fp, branch_color_remote, "%d", num_theirs);
        } else if (!num_theirs) {
-               color_fprintf(s->fp, header_color, _("ahead "));
+               color_fprintf(s->fp, header_color, LABEL(N_(("ahead "))));
                color_fprintf(s->fp, branch_color_local, "%d", num_ours);
        } else {
-               color_fprintf(s->fp, header_color, _("ahead "));
+               color_fprintf(s->fp, header_color, LABEL(N_(("ahead "))));
                color_fprintf(s->fp, branch_color_local, "%d", num_ours);
-               color_fprintf(s->fp, header_color, _(", behind "));
+               color_fprintf(s->fp, header_color, ", %s", LABEL(N_("behind ")));
                color_fprintf(s->fp, branch_color_remote, "%d", num_theirs);
        }
 
@@ -1604,5 +1616,6 @@ void wt_porcelain_print(struct wt_status *s)
        s->use_color = 0;
        s->relative_paths = 0;
        s->prefix = NULL;
+       s->no_gettext = 1;
        wt_shortstatus_print(s);
 }