X-Git-Url: https://git.tokkee.org/?a=blobdiff_plain;ds=sidebyside;f=builtin-log.c;h=c8feb0f7953a4d431c180e33f9f71d4434a4e51a;hb=b05b52027c0e43abc9629049944283729a07899f;hp=12a6d19203f054d892c04873fef0f92a5c2ef0c9;hpb=7f2d5cb53185e4734d37a7789f3870bd81963cf3;p=git.git diff --git a/builtin-log.c b/builtin-log.c index 12a6d1920..c8feb0f79 100644 --- a/builtin-log.c +++ b/builtin-log.c @@ -183,7 +183,12 @@ int cmd_format_patch(int argc, const char **argv, char **envp) argv[i + 1]); output_directory = strdup(argv[i + 1]); i++; - } else + } + else if (!strcmp(argv[i], "--attach")) + rev.mime_boundary = git_version_string; + else if (!strncmp(argv[i], "--attach=", 9)) + rev.mime_boundary = argv[i] + 9; + else argv[j++] = argv[i]; } argc = j; @@ -224,8 +229,14 @@ int cmd_format_patch(int argc, const char **argv, char **envp) shown = log_tree_commit(&rev, commit); free(commit->buffer); commit->buffer = NULL; - if (shown) - printf("-- \n%s\n\n", git_version_string); + if (shown) { + if (rev.mime_boundary) + printf("\n--%s%s--\n\n\n", + mime_boundary_leader, + rev.mime_boundary); + else + printf("-- \n%s\n\n", git_version_string); + } if (!use_stdout) fclose(stdout); }