Merge branch 'dj/fetch-all-tags'
authorJunio C Hamano <gitster@pobox.com>
Fri, 14 Sep 2012 18:54:19 +0000 (11:54 -0700)
committerJunio C Hamano <gitster@pobox.com>
Fri, 14 Sep 2012 18:54:19 +0000 (11:54 -0700)
"git fetch --all", when passed "--no-tags", did not honor the
"--no-tags" option while fetching from individual remotes (the same
issue existed with "--tags", but combination "--all --tags" makes
much less sense than "--all --no-tags").

* dj/fetch-all-tags:
fetch --all: pass --tags/--no-tags through to each remote

1  2 
builtin/fetch.c
diff --combined builtin/fetch.c
index 24be754e1b4444ea46752016ba77bdef1c892712,4494aed0c757085f5728afa82ebfa3a0fb66876d..d0dcc8888f14e8305250afcab7eb4ca7a3f6648c
  #include "argv-array.h"
  
  static const char * const builtin_fetch_usage[] = {
 -      "git fetch [<options>] [<repository> [<refspec>...]]",
 -      "git fetch [<options>] <group>",
 -      "git fetch --multiple [<options>] [(<repository> | <group>)...]",
 -      "git fetch --all [<options>]",
 +      N_("git fetch [<options>] [<repository> [<refspec>...]]"),
 +      N_("git fetch [<options>] <group>"),
 +      N_("git fetch --multiple [<options>] [(<repository> | <group>)...]"),
 +      N_("git fetch --all [<options>]"),
        NULL
  };
  
@@@ -57,36 -57,36 +57,36 @@@ static int option_parse_recurse_submodu
  static struct option builtin_fetch_options[] = {
        OPT__VERBOSITY(&verbosity),
        OPT_BOOLEAN(0, "all", &all,
 -                  "fetch from all remotes"),
 +                  N_("fetch from all remotes")),
        OPT_BOOLEAN('a', "append", &append,
 -                  "append to .git/FETCH_HEAD instead of overwriting"),
 -      OPT_STRING(0, "upload-pack", &upload_pack, "path",
 -                 "path to upload pack on remote end"),
 -      OPT__FORCE(&force, "force overwrite of local branch"),
 +                  N_("append to .git/FETCH_HEAD instead of overwriting")),
 +      OPT_STRING(0, "upload-pack", &upload_pack, N_("path"),
 +                 N_("path to upload pack on remote end")),
 +      OPT__FORCE(&force, N_("force overwrite of local branch")),
        OPT_BOOLEAN('m', "multiple", &multiple,
 -                  "fetch from multiple remotes"),
 +                  N_("fetch from multiple remotes")),
        OPT_SET_INT('t', "tags", &tags,
 -                  "fetch all tags and associated objects", TAGS_SET),
 +                  N_("fetch all tags and associated objects"), TAGS_SET),
        OPT_SET_INT('n', NULL, &tags,
 -                  "do not fetch all tags (--no-tags)", TAGS_UNSET),
 +                  N_("do not fetch all tags (--no-tags)"), TAGS_UNSET),
        OPT_BOOLEAN('p', "prune", &prune,
 -                  "prune remote-tracking branches no longer on remote"),
 -      { OPTION_CALLBACK, 0, "recurse-submodules", NULL, "on-demand",
 -                  "control recursive fetching of submodules",
 +                  N_("prune remote-tracking branches no longer on remote")),
 +      { OPTION_CALLBACK, 0, "recurse-submodules", NULL, N_("on-demand"),
 +                  N_("control recursive fetching of submodules"),
                    PARSE_OPT_OPTARG, option_parse_recurse_submodules },
        OPT_BOOLEAN(0, "dry-run", &dry_run,
 -                  "dry run"),
 -      OPT_BOOLEAN('k', "keep", &keep, "keep downloaded pack"),
 +                  N_("dry run")),
 +      OPT_BOOLEAN('k', "keep", &keep, N_("keep downloaded pack")),
        OPT_BOOLEAN('u', "update-head-ok", &update_head_ok,
 -                  "allow updating of HEAD ref"),
 -      OPT_BOOL(0, "progress", &progress, "force progress reporting"),
 -      OPT_STRING(0, "depth", &depth, "depth",
 -                 "deepen history of shallow clone"),
 -      { OPTION_STRING, 0, "submodule-prefix", &submodule_prefix, "dir",
 -                 "prepend this to submodule path output", PARSE_OPT_HIDDEN },
 +                  N_("allow updating of HEAD ref")),
 +      OPT_BOOL(0, "progress", &progress, N_("force progress reporting")),
 +      OPT_STRING(0, "depth", &depth, N_("depth"),
 +                 N_("deepen history of shallow clone")),
 +      { OPTION_STRING, 0, "submodule-prefix", &submodule_prefix, N_("dir"),
 +                 N_("prepend this to submodule path output"), PARSE_OPT_HIDDEN },
        { OPTION_STRING, 0, "recurse-submodules-default",
                   &recurse_submodules_default, NULL,
 -                 "default mode for recursion", PARSE_OPT_HIDDEN },
 +                 N_("default mode for recursion"), PARSE_OPT_HIDDEN },
        OPT_END()
  };
  
@@@ -324,7 -324,7 +324,7 @@@ static int update_local_ref(struct ref 
                return r;
        }
  
 -      if (in_merge_bases(current, &updated, 1)) {
 +      if (in_merge_bases(current, updated)) {
                char quickref[83];
                int r;
                strcpy(quickref, find_unique_abbrev(current->object.sha1, DEFAULT_ABBREV));
@@@ -547,8 -547,8 +547,8 @@@ static int prune_refs(struct refspec *r
        int result = 0;
        struct ref *ref, *stale_refs = get_stale_heads(refs, ref_count, ref_map);
        const char *dangling_msg = dry_run
 -              ? _("   (%s will become dangling)\n")
 -              : _("   (%s has become dangling)\n");
 +              ? _("   (%s will become dangling)")
 +              : _("   (%s has become dangling)");
  
        for (ref = stale_refs; ref; ref = ref->next) {
                if (!dry_run)
@@@ -858,6 -858,10 +858,10 @@@ static void add_options_to_argv(struct 
                argv_array_push(argv, "--recurse-submodules");
        else if (recurse_submodules == RECURSE_SUBMODULES_ON_DEMAND)
                argv_array_push(argv, "--recurse-submodules=on-demand");
+       if (tags == TAGS_SET)
+               argv_array_push(argv, "--tags");
+       else if (tags == TAGS_UNSET)
+               argv_array_push(argv, "--no-tags");
        if (verbosity >= 2)
                argv_array_push(argv, "-v");
        if (verbosity >= 1)