docs: clarify "branch -l"
[gitweb.git] / builtin-log.c
index 41b6df490f7c52edbee880afa9070c1511cdf442..76962e1b08ec6a7e52320c97cc3b54887cc67ef9 100644 (file)
@@ -58,6 +58,9 @@ static void cmd_log_init(int argc, const char **argv, const char *prefix,
                usage(builtin_log_usage);
        argc = setup_revisions(argc, argv, rev, "HEAD");
 
+       if (!rev->show_notes_given && !rev->pretty_given)
+               rev->show_notes = 1;
+
        if (rev->diffopt.pickaxe || rev->diffopt.filter)
                rev->always_show_header = 0;
        if (DIFF_OPT_TST(&rev->diffopt, FOLLOW_RENAMES)) {
@@ -1086,7 +1089,7 @@ int cmd_format_patch(int argc, const char **argv, const char *prefix)
 
        /*
         * We cannot move this anywhere earlier because we do want to
-        * know if --root was given explicitly from the comand line.
+        * know if --root was given explicitly from the command line.
         */
        rev.show_root_diff = 1;
 
@@ -1103,8 +1106,15 @@ int cmd_format_patch(int argc, const char **argv, const char *prefix)
                        return 0;
        }
 
-       if (ignore_if_in_upstream)
+       if (ignore_if_in_upstream) {
+               /* Don't say anything if head and upstream are the same. */
+               if (rev.pending.nr == 2) {
+                       struct object_array_entry *o = rev.pending.objects;
+                       if (hashcmp(o[0].item->sha1, o[1].item->sha1) == 0)
+                               return 0;
+               }
                get_patch_ids(&rev, &ids, prefix);
+       }
 
        if (!use_stdout)
                realstdout = xfdopen(xdup(1), "w");