i18n: clean.c: match string with git-add--interactive.perl
[gitweb.git] / builtin / log.c
index 0b427b675f55fd2ec21f5460cf4363874fb0a68f..b8cdf2b9d9cbd30950810eaa5dd5091dc23eb3c6 100644 (file)
@@ -1042,7 +1042,6 @@ static void make_cover_letter(struct rev_info *rev, int use_stdout,
        diff_flush(&opts);
 
        fprintf(rev->diffopt.file, "\n");
-       print_signature(rev->diffopt.file);
 }
 
 static const char *clean_message_id(const char *msg_id)
@@ -1361,7 +1360,7 @@ static void print_bases(struct base_tree_info *bases, FILE *file)
                return;
 
        /* Show the base commit */
-       fprintf(file, "base-commit: %s\n", oid_to_hex(&bases->base_commit));
+       fprintf(file, "\nbase-commit: %s\n", oid_to_hex(&bases->base_commit));
 
        /* Show the prerequisite patches */
        for (i = bases->nr_patch_id - 1; i >= 0; i--)
@@ -1676,16 +1675,16 @@ int cmd_format_patch(int argc, const char **argv, const char *prefix)
                /* nothing to do */
                return 0;
        total = nr;
-       if (!keep_subject && auto_number && total > 1)
-               numbered = 1;
-       if (numbered)
-               rev.total = total + start_number - 1;
        if (cover_letter == -1) {
                if (config_cover_letter == COVER_AUTO)
                        cover_letter = (total > 1);
                else
                        cover_letter = (config_cover_letter == COVER_ON);
        }
+       if (!keep_subject && auto_number && (total > 1 || cover_letter))
+               numbered = 1;
+       if (numbered)
+               rev.total = total + start_number - 1;
 
        if (!signature) {
                ; /* --no-signature inhibits all signatures */
@@ -1720,6 +1719,7 @@ int cmd_format_patch(int argc, const char **argv, const char *prefix)
                make_cover_letter(&rev, use_stdout,
                                  origin, nr, list, branch_name, quiet);
                print_bases(&bases, rev.diffopt.file);
+               print_signature(rev.diffopt.file);
                total++;
                start_number--;
        }
@@ -1779,13 +1779,13 @@ int cmd_format_patch(int argc, const char **argv, const char *prefix)
                if (!use_stdout)
                        rev.shown_one = 0;
                if (shown) {
+                       print_bases(&bases, rev.diffopt.file);
                        if (rev.mime_boundary)
                                fprintf(rev.diffopt.file, "\n--%s%s--\n\n\n",
                                       mime_boundary_leader,
                                       rev.mime_boundary);
                        else
                                print_signature(rev.diffopt.file);
-                       print_bases(&bases, rev.diffopt.file);
                }
                if (!use_stdout)
                        fclose(rev.diffopt.file);