sha1-file.c: mark more strings for translation
[gitweb.git] / builtin / log.c
index 4686f68594829a85e9d73bcf0b6298c1e61b6852..99d4c6996e027f824c632898266a29731c2ab383 100644 (file)
@@ -28,6 +28,7 @@
 #include "mailmap.h"
 #include "gpg-interface.h"
 #include "progress.h"
+#include "commit-slab.h"
 
 #define MAIL_DEFAULT_WRAP 72
 
@@ -148,6 +149,7 @@ static void cmd_log_init_finish(int argc, const char **argv, const char *prefix,
        static struct string_list decorate_refs_include = STRING_LIST_INIT_NODUP;
        struct decoration_filter decoration_filter = {&decorate_refs_include,
                                                      &decorate_refs_exclude};
+       static struct revision_sources revision_sources;
 
        const struct option builtin_log_options[] = {
                OPT__QUIET(&quiet, N_("suppress diff output")),
@@ -194,8 +196,10 @@ static void cmd_log_init_finish(int argc, const char **argv, const char *prefix,
            rev->diffopt.filter || rev->diffopt.flags.follow_renames)
                rev->always_show_header = 0;
 
-       if (source)
-               rev->show_source = 1;
+       if (source) {
+               init_revision_sources(&revision_sources);
+               rev->sources = &revision_sources;
+       }
 
        if (mailmap) {
                rev->mailmap = xcalloc(1, sizeof(struct string_list));
@@ -1337,6 +1341,8 @@ static struct commit *get_base_commit(const char *base_commit,
        return base;
 }
 
+define_commit_slab(commit_base, int);
+
 static void prepare_bases(struct base_tree_info *bases,
                          struct commit *base,
                          struct commit **list,
@@ -1345,11 +1351,13 @@ static void prepare_bases(struct base_tree_info *bases,
        struct commit *commit;
        struct rev_info revs;
        struct diff_options diffopt;
+       struct commit_base commit_base;
        int i;
 
        if (!base)
                return;
 
+       init_commit_base(&commit_base);
        diff_setup(&diffopt);
        diffopt.flags.recursive = 1;
        diff_setup_done(&diffopt);
@@ -1362,7 +1370,7 @@ static void prepare_bases(struct base_tree_info *bases,
        for (i = 0; i < total; i++) {
                list[i]->object.flags &= ~UNINTERESTING;
                add_pending_object(&revs, &list[i]->object, "rev_list");
-               list[i]->util = (void *)1;
+               *commit_base_at(&commit_base, list[i]) = 1;
        }
        base->object.flags |= UNINTERESTING;
        add_pending_object(&revs, &base->object, "base");
@@ -1376,7 +1384,7 @@ static void prepare_bases(struct base_tree_info *bases,
        while ((commit = get_revision(&revs)) != NULL) {
                struct object_id oid;
                struct object_id *patch_id;
-               if (commit->util)
+               if (*commit_base_at(&commit_base, commit))
                        continue;
                if (commit_patch_id(commit, &diffopt, &oid, 0))
                        die(_("cannot get patch id"));
@@ -1385,6 +1393,7 @@ static void prepare_bases(struct base_tree_info *bases,
                oidcpy(patch_id, &oid);
                bases->nr_patch_id++;
        }
+       clear_commit_base(&commit_base);
 }
 
 static void print_bases(struct base_tree_info *bases, FILE *file)
@@ -1597,14 +1606,14 @@ int cmd_format_patch(int argc, const char **argv, const char *prefix)
                numbered = 0;
 
        if (numbered && keep_subject)
-               die (_("-n and -k are mutually exclusive."));
+               die(_("-n and -k are mutually exclusive"));
        if (keep_subject && subject_prefix)
-               die (_("--subject-prefix/--rfc and -k are mutually exclusive."));
+               die(_("--subject-prefix/--rfc and -k are mutually exclusive"));
        rev.preserve_subject = keep_subject;
 
        argc = setup_revisions(argc, argv, &rev, &s_r_opt);
        if (argc > 1)
-               die (_("unrecognized argument: %s"), argv[1]);
+               die(_("unrecognized argument: %s"), argv[1]);
 
        if (rev.diffopt.output_format & DIFF_FORMAT_NAME)
                die(_("--name-only does not make sense"));