From patchwork Fri Oct 29 21:15:24 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: John Cai X-Patchwork-Id: 12593833 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 98E00C433EF for ; Fri, 29 Oct 2021 21:15:34 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 7CE5960524 for ; Fri, 29 Oct 2021 21:15:34 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231626AbhJ2VSB (ORCPT ); Fri, 29 Oct 2021 17:18:01 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:53450 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231495AbhJ2VSA (ORCPT ); Fri, 29 Oct 2021 17:18:00 -0400 Received: from mail-wr1-x433.google.com (mail-wr1-x433.google.com [IPv6:2a00:1450:4864:20::433]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 245E3C061570 for ; Fri, 29 Oct 2021 14:15:31 -0700 (PDT) Received: by mail-wr1-x433.google.com with SMTP id o14so18538690wra.12 for ; Fri, 29 Oct 2021 14:15:31 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=message-id:in-reply-to:references:from:date:subject:fcc :content-transfer-encoding:mime-version:to:cc; bh=VLJYlvMMxJOwoBX6X+QhjOoCyRxaoUfcnxLfooxmZsc=; b=JUqn0Jai9KLnkI7OREB5hyL100N0a5X8aufq82oRhNmOYrzJwMjAFoePc+Eb8U/Nqd cW0UfddRILnBKxXCdRATCdAP8TaXOuuB9Y24krxTvq/8uq+K79iKey/NhQ4cp2AC9nTV 64XRexG+i+PoI+vczF0Kgpc5wmiG2Z8Zgn4TY2aAxQ1HRnVrR/y44z4BgAxxoMKCTK3J OpJDSsKI69Ec6NVbMDDIcPPxHYi3VKErocxRK5druP3FIO7U90Seh0gh2RuUgjx/p/xI xxwOwQbhhEMgOuKxHr0HF3XXmK/8qKV4sYEEshdDPiJYBkwGkTpkECSau7djwQpqts3b 0BWA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:message-id:in-reply-to:references:from:date :subject:fcc:content-transfer-encoding:mime-version:to:cc; bh=VLJYlvMMxJOwoBX6X+QhjOoCyRxaoUfcnxLfooxmZsc=; b=FjgJ4zKEcJpGfBWRV/IyGere6mX2DhNavcLDjSTjeaVrn8PWErSmTQ9RLK5JAZsc1n sSygpYYas1iAMApwo4KBVErUrfIk9cKodocxaMbUSmS/h2DFgjJ7Maa65LmX+FefK/YS 6BF8uqpGGXXhIlTxNBBGX5CePS0bUiywLMtOmgdgD+IccWar15UgAA7hIUgMiAhpvjWm LDyGoEHZ6ZtiQTj6ZPa6Zh8wUhnG247ANhHzTKI+dPHKfZQnLrC7NzDF9PDqdHHXqiGe i/mugj+a1veXSk37nvTb03XPQnfmU95TV5LU6jo1d46iJW9JebgthWLH/vxyHS3lObRw yC/w== X-Gm-Message-State: AOAM533qqJjJayoMvfDgR2pWL5H7d93glGU/Wnrs3Fct5oLsmcQcX8Im LXUNIVjo4r5oh2UFld2Du29+tkKURQY1Vg== X-Google-Smtp-Source: ABdhPJxS1hFJr9FwsrjdmQHz96CmS+dyOM4ngRwV5CCCZdCWvnqLhFydCf2O38PFeycQ9kyNlgZ4WA== X-Received: by 2002:a05:600c:378f:: with SMTP id o15mr14339073wmr.63.1635542129609; Fri, 29 Oct 2021 14:15:29 -0700 (PDT) Received: from [127.0.0.1] ([13.74.141.28]) by smtp.gmail.com with ESMTPSA id r1sm10870029wmr.36.2021.10.29.14.15.29 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 29 Oct 2021 14:15:29 -0700 (PDT) Message-Id: In-Reply-To: References: Date: Fri, 29 Oct 2021 21:15:24 +0000 Subject: [PATCH 1/4] oneline: parse --newlineafter flag Fcc: Sent MIME-Version: 1.0 To: git@vger.kernel.org Cc: John Cai , John Cai Precedence: bulk List-ID: X-Mailing-List: git@vger.kernel.org From: John Cai From: John Cai * revision.h: add newlineafter flag type * builtin/log.c: parse newlineafter flag with callback Signed-off-by: John Cai --- builtin/log.c | 25 +++++++++++++++++++++++++ revision.h | 4 ++++ 2 files changed, 29 insertions(+) diff --git a/builtin/log.c b/builtin/log.c index f75d87e8d7f..3758c73760c 100644 --- a/builtin/log.c +++ b/builtin/log.c @@ -53,6 +53,7 @@ static int decoration_given; static int use_mailmap_config = 1; static const char *fmt_patch_subject_prefix = "PATCH"; static int fmt_patch_name_max = FORMAT_PATCH_NAME_MAX_DEFAULT; +static int newlineafter = NEWLINEAFTER_NONE; static const char *fmt_pretty; static const char * const builtin_log_usage[] = { @@ -132,6 +133,27 @@ static int log_line_range_callback(const struct option *option, const char *arg, return 0; } +static int parse_newlineafter(const char *value) +{ + if (!strcmp(value, "decorations")) + return NEWLINEAFTER_DECORATIONS; + + return NEWLINEAFTER_NONE; +} + +static int option_parse_newlineafter(const struct option *opt, + const char *arg, int unset) +{ + int *newlineafter = opt->value; + + if (unset) + *newlineafter = NEWLINEAFTER_NONE; + else + *newlineafter = parse_newlineafter(arg); + + return 0; +} + static void init_log_defaults(void) { init_diff_ui_defaults(); @@ -156,6 +178,7 @@ static void cmd_log_init_defaults(struct rev_info *rev) rev->show_signature = default_show_signature; rev->encode_email_headers = default_encode_email_headers; rev->diffopt.flags.allow_textconv = 1; + rev->newlineafter = NEWLINEAFTER_NONE; if (default_date_mode) parse_date_format(default_date_mode, &rev->date_mode); @@ -189,6 +212,7 @@ static void cmd_log_init_finish(int argc, const char **argv, const char *prefix, OPT_CALLBACK('L', NULL, &line_cb, "range:file", N_("trace the evolution of line range , or function : in "), log_line_range_callback), + OPT_CALLBACK(0, "newlineafter", &newlineafter, N_("field"), N_("new line after "), option_parse_newlineafter), OPT_END() }; @@ -265,6 +289,7 @@ static void cmd_log_init_finish(int argc, const char **argv, const char *prefix, load_ref_decorations(&decoration_filter, decoration_style); } + rev->newlineafter = newlineafter; if (rev->line_level_traverse) line_log_init(rev, line_cb.prefix, &line_cb.args); diff --git a/revision.h b/revision.h index 5578bb4720a..ff0b89c1f40 100644 --- a/revision.h +++ b/revision.h @@ -243,6 +243,10 @@ struct rev_info { int no_inline; int show_log_size; struct string_list *mailmap; + enum { + NEWLINEAFTER_NONE, + NEWLINEAFTER_DECORATIONS + } newlineafter; /* Filter by commit log message */ struct grep_opt grep_filter; From patchwork Fri Oct 29 21:15:25 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: John Cai X-Patchwork-Id: 12593835 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 452B6C433EF for ; Fri, 29 Oct 2021 21:15:36 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 2AAC260524 for ; Fri, 29 Oct 2021 21:15:36 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231635AbhJ2VSD (ORCPT ); Fri, 29 Oct 2021 17:18:03 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:53452 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231616AbhJ2VSB (ORCPT ); Fri, 29 Oct 2021 17:18:01 -0400 Received: from mail-wr1-x435.google.com (mail-wr1-x435.google.com [IPv6:2a00:1450:4864:20::435]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 057B6C061570 for ; Fri, 29 Oct 2021 14:15:32 -0700 (PDT) Received: by mail-wr1-x435.google.com with SMTP id d3so18590292wrh.8 for ; Fri, 29 Oct 2021 14:15:31 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=message-id:in-reply-to:references:from:date:subject:fcc :content-transfer-encoding:mime-version:to:cc; bh=e9Ii73Ow9usTCyIKzcIqCTN0ARWdmnCruxStEs2he/c=; b=jkXcfGu1fsi9cMJ8FkzRIuFWLcqxZouYtlKKYlb9apZu436/L/Y2DZjyCiYYcvI+9B RFTShbec659+IzO2UiGVavVMrdSVV2jCyMdT+C5o3X7UbuNzqnUNAGsYSAlD3R1ARQHg G9MPuJr3PFQuPNdc+tV3iVzi1nXaAa+YyNzoPLqhNn2NE+1R5NPSsW9ubGO6jWGDTlyU buBH6T+Cw/Ygd1wO/36uEy7YJsusQbOzNBvgNdxdWa5gRUFLh+xRLapokaX+DuOt2EHC REk1bLzJZ5FzHjnKasBDXd5FrLUPm5/t3T6a7qYrfPu9Be0r6vA685WYKaDF0HksG56y Xvzg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:message-id:in-reply-to:references:from:date :subject:fcc:content-transfer-encoding:mime-version:to:cc; bh=e9Ii73Ow9usTCyIKzcIqCTN0ARWdmnCruxStEs2he/c=; b=Sx+6JMZB6Gk12cuh/hHAt1XAzpVFNCRJNjx4aaV7YM6V2fJ0gVb+02ArwUc/3gi0/L ddKB5EoThZdqiL3QwIdVIWOISGplIljjOp1arTEZQXUK2yIs22MGqEnMOZiFHvEEa5Rl AImvusznTTdrbFx635BObexeenSHefKAAbT6eB9eo+XzazRAXEoRn4LyJJ2P6QTNkoaw vxwhuBBK87Fl6uPSCll9NxhPtYDrahv0r9ZEy9vvLr7Pv5TBgxKva044tWkWBSH9JAsS VQZ7NGC2/Ip6GYwts6yhhG87OkZ/WE3zK4VYIC0kgsvWhTQEJq/pOASLcFMdybluWwpP RAqQ== X-Gm-Message-State: AOAM531y70noQQwCeqKF09RQOGYggqLg6yfOQMzWf7ygNzkV3XXor25n IH5P0+ZysBBFsd3EZ+WO4GNd3a19YG198w== X-Google-Smtp-Source: ABdhPJxhu/QJmGCwuteLE493XC+jfsI18a/J1jEAeljVds3EUr0KVwz35mB2IHA+6lMlR6n6iVSeTg== X-Received: by 2002:adf:9c11:: with SMTP id f17mr17642154wrc.147.1635542130394; Fri, 29 Oct 2021 14:15:30 -0700 (PDT) Received: from [127.0.0.1] ([13.74.141.28]) by smtp.gmail.com with ESMTPSA id m16sm735168wmc.46.2021.10.29.14.15.29 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 29 Oct 2021 14:15:30 -0700 (PDT) Message-Id: <54530e1e009f7bbebb3be1c7710f766112a492fb.1635542128.git.gitgitgadget@gmail.com> In-Reply-To: References: Date: Fri, 29 Oct 2021 21:15:25 +0000 Subject: [PATCH 2/4] oneline: print newline after decorations if flag provided Fcc: Sent MIME-Version: 1.0 To: git@vger.kernel.org Cc: John Cai , John Cai Precedence: bulk List-ID: X-Mailing-List: git@vger.kernel.org From: John Cai From: John Cai * log-tree.c: pass in format, oneline, abbrev so format_decorations can print a newline with an indentation. * log-tree.h: adding parameters in header file * pretty.c: pass in arguments format, oneline to format_decorations call but these don't get used in this context Signed-off-by: John Cai --- log-tree.c | 20 ++++++++++++++++---- log-tree.h | 7 +++++-- pretty.c | 4 ++-- 3 files changed, 23 insertions(+), 8 deletions(-) diff --git a/log-tree.c b/log-tree.c index 644893fd8cf..d2f1eeeebf5 100644 --- a/log-tree.c +++ b/log-tree.c @@ -285,6 +285,9 @@ static void show_name(struct strbuf *sb, const struct name_decoration *decoratio void format_decorations_extended(struct strbuf *sb, const struct commit *commit, int use_color, + int format, + int abbrev_len, + int newline, const char *prefix, const char *separator, const char *suffix) @@ -333,11 +336,16 @@ void format_decorations_extended(struct strbuf *sb, strbuf_addstr(sb, color_commit); strbuf_addstr(sb, suffix); strbuf_addstr(sb, color_reset); + if ((format == CMIT_FMT_ONELINE) && newline == 1) { + strbuf_addstr(sb, "\n"); + strbuf_addchars(sb, ' ', abbrev_len); + } } void show_decorations(struct rev_info *opt, struct commit *commit) { struct strbuf sb = STRBUF_INIT; + int newline = 0; if (opt->sources) { char **slot = revision_sources_peek(opt->sources, commit); @@ -347,7 +355,11 @@ void show_decorations(struct rev_info *opt, struct commit *commit) } if (!opt->show_decorations) return; - format_decorations(&sb, commit, opt->diffopt.use_color); + + if (opt->newlineafter == NEWLINEAFTER_DECORATIONS) + newline = 1; + + format_decorations(&sb, commit, opt->diffopt.use_color, opt->commit_format, opt->abbrev, newline); fputs(sb.buf, opt->diffopt.file); strbuf_release(&sb); } @@ -623,6 +635,7 @@ void show_log(struct rev_info *opt) int abbrev_commit = opt->abbrev_commit ? opt->abbrev : the_hash_algo->hexsz; const char *extra_headers = opt->extra_headers; struct pretty_print_context ctx = {0}; + char hex[GIT_MAX_HEXSZ + 1]; opt->loginfo = NULL; if (!opt->verbose_header) { @@ -692,9 +705,8 @@ void show_log(struct rev_info *opt) if (!opt->graph) put_revision_mark(opt, commit); - fputs(find_unique_abbrev(&commit->object.oid, - abbrev_commit), - opt->diffopt.file); + opt->abbrev = find_unique_abbrev_r(hex, &commit->object.oid, abbrev_commit); + fputs(hex, opt->diffopt.file); if (opt->print_parents) show_parents(commit, abbrev_commit, opt->diffopt.file); if (opt->children.name) diff --git a/log-tree.h b/log-tree.h index e7e4641cf83..a401e659d4c 100644 --- a/log-tree.h +++ b/log-tree.h @@ -19,11 +19,14 @@ int log_tree_commit(struct rev_info *, struct commit *); void show_log(struct rev_info *opt); void format_decorations_extended(struct strbuf *sb, const struct commit *commit, int use_color, + int format, + int abbrev_len, + int newline, const char *prefix, const char *separator, const char *suffix); -#define format_decorations(strbuf, commit, color) \ - format_decorations_extended((strbuf), (commit), (color), " (", ", ", ")") +#define format_decorations(strbuf, commit, color, format, abbrev_len, newline) \ + format_decorations_extended((strbuf), (commit), (color), (format), (abbrev_len), (newline), " (", ", ", ")") void show_decorations(struct rev_info *opt, struct commit *commit); void log_write_email_headers(struct rev_info *opt, struct commit *commit, const char **extra_headers_p, diff --git a/pretty.c b/pretty.c index fe95107ae5a..98144deac5c 100644 --- a/pretty.c +++ b/pretty.c @@ -1385,10 +1385,10 @@ static size_t format_commit_one(struct strbuf *sb, /* in UTF-8 */ strbuf_addstr(sb, get_revision_mark(NULL, commit)); return 1; case 'd': - format_decorations(sb, commit, c->auto_color); + format_decorations(sb, commit, c->auto_color, c->pretty_ctx->fmt, 0, 0); return 1; case 'D': - format_decorations_extended(sb, commit, c->auto_color, "", ", ", ""); + format_decorations_extended(sb, commit, c->auto_color, c->pretty_ctx->fmt, 0, 0, "", ", ", ""); return 1; case 'S': /* tag/branch like --source */ if (!(c->pretty_ctx->rev && c->pretty_ctx->rev->sources)) From patchwork Fri Oct 29 21:15:26 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: John Cai X-Patchwork-Id: 12593837 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 9A000C433FE for ; Fri, 29 Oct 2021 21:15:38 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 83E9860524 for ; Fri, 29 Oct 2021 21:15:38 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231700AbhJ2VSG (ORCPT ); Fri, 29 Oct 2021 17:18:06 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:53466 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231654AbhJ2VSC (ORCPT ); Fri, 29 Oct 2021 17:18:02 -0400 Received: from mail-wr1-x42c.google.com (mail-wr1-x42c.google.com [IPv6:2a00:1450:4864:20::42c]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id A150DC0613F5 for ; Fri, 29 Oct 2021 14:15:32 -0700 (PDT) Received: by mail-wr1-x42c.google.com with SMTP id o14so18538815wra.12 for ; Fri, 29 Oct 2021 14:15:32 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=message-id:in-reply-to:references:from:date:subject:fcc :content-transfer-encoding:mime-version:to:cc; bh=JK/p/K1jhs9XlO6KJsRjjD9f+ZsiTBmMm/Hvj1ieh+U=; b=YY+R0w3ow3HGY8t9rcaww3tkDG6PnHTBBo+8kw+ggnMOciLtAaCa2IbmhIoo8Io8DQ Fm4CxLIARPLlmw4lnd47iZS9mgR1Lvl+MRbO16WaYlF3wpogjKHrCn4/kO1t/UYtDImH yhP22VbM8LnXw9U1w81GoOqk7Js48FoWKKJLGgcsmvWBjmcZEZB749hBpPpiYJtzSQVC gJP4/SxCsjrEvlLU2Y6nWQQXDVQtZJSOPw8O0XPAnK6heUJfiKsMMoAZPjRX9CJez0wX ZPmSGjoJ3lJNt7UTrEUyx787PySuERY5OgwL5mVAEgL2Jle2myShqOSdyvA5qIrLxE7r xrZw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:message-id:in-reply-to:references:from:date :subject:fcc:content-transfer-encoding:mime-version:to:cc; bh=JK/p/K1jhs9XlO6KJsRjjD9f+ZsiTBmMm/Hvj1ieh+U=; b=4t5YiZNUvfq8B+/oAWCtWmPile025FzW8qYc0SvwPEVOWuFhRrkRa5caAjuwGUi125 yOPMTWtLvHaxA3k2mcrHrE6pwihUaVf241GPf4xloZO/my8e9XE1MDqsCQYmmTQQ6VFU qjdo7ttAQLQd2AOn9l9hShWZadefz3onC81J1bvPyEyx2dgWHE0At35ND2xzwHb3WWBz WcZIapHbqqj3qh588NiFLhIUyQfMCIMCA0uJ8t1CvJYvkP+viFgu8oFCqFdHKSboyCGd Pfwf3/98pZ1QLlk6oqYKZRRNQRWMZET/OXm30zG9iibqOE3LfhdYtJfigKSht7veTWfE qTGQ== X-Gm-Message-State: AOAM533pjm3kB9PbUT0fHFI3AmIaxnF65eeM+S26Kc0Qj3fEVOkUXMAL C5amV/GuuenOZbkMzuSGDmAbtwUZmHaQ9g== X-Google-Smtp-Source: ABdhPJxj3ntQ0W+sesPn2UzDIeklUiMl8Cjm5lGbN43oHmIw8Z6ZTpvZ7GU+QtCI+Th63xbtBFMzfA== X-Received: by 2002:a05:600c:da:: with SMTP id u26mr21429434wmm.161.1635542131158; Fri, 29 Oct 2021 14:15:31 -0700 (PDT) Received: from [127.0.0.1] ([13.74.141.28]) by smtp.gmail.com with ESMTPSA id r1sm6641302wmq.15.2021.10.29.14.15.30 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 29 Oct 2021 14:15:30 -0700 (PDT) Message-Id: In-Reply-To: References: Date: Fri, 29 Oct 2021 21:15:26 +0000 Subject: [PATCH 3/4] oneline: test for --newlineafter feature Fcc: Sent MIME-Version: 1.0 To: git@vger.kernel.org Cc: John Cai , John Cai Precedence: bulk List-ID: X-Mailing-List: git@vger.kernel.org From: John Cai From: John Cai Signed-off-by: John Cai --- t/t4205-log-pretty-formats.sh | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/t/t4205-log-pretty-formats.sh b/t/t4205-log-pretty-formats.sh index 5865daa8f8d..847426f8af0 100755 --- a/t/t4205-log-pretty-formats.sh +++ b/t/t4205-log-pretty-formats.sh @@ -576,6 +576,16 @@ test_expect_success 'clean log decoration' ' test_cmp expected actual1 ' +test_expect_success 'oneline with --newlineafter=decorations' ' + git checkout -b newlineafter && + >baz && + git add baz && + git commit -m "decorations" && + git log --pretty=format:"%h%d%n%>(18) %s%n" --max-count=1 >expect && + git log --oneline --decorate --max-count=1 --newlineafter=decorations >actual && + test_cmp expect actual +' + cat >trailers < Acked-by: A U Thor From patchwork Fri Oct 29 21:15:27 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: John Cai X-Patchwork-Id: 12593839 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 413A2C433F5 for ; Fri, 29 Oct 2021 21:15:40 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 2B8C660FC3 for ; Fri, 29 Oct 2021 21:15:40 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231722AbhJ2VSH (ORCPT ); Fri, 29 Oct 2021 17:18:07 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:53468 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231495AbhJ2VSD (ORCPT ); Fri, 29 Oct 2021 17:18:03 -0400 Received: from mail-wr1-x42b.google.com (mail-wr1-x42b.google.com [IPv6:2a00:1450:4864:20::42b]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 6DA72C0613B9 for ; Fri, 29 Oct 2021 14:15:33 -0700 (PDT) Received: by mail-wr1-x42b.google.com with SMTP id k7so18538149wrd.13 for ; Fri, 29 Oct 2021 14:15:33 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=message-id:in-reply-to:references:from:date:subject:fcc :content-transfer-encoding:mime-version:to:cc; bh=lkFiB/b95qi8AtHUtHivDCzc+U5s9+av6l7/Pw0pRgU=; b=eIXpRJNg4nz4qsbCZZwALZ6Aa8vQNr81vPRC/5zi+IER6CEmZ2qGyEpu45AoExCwku bW9sBqkPLwFpdK9YsXLiFmRDod4ZQirFYMRwgm/49XDvTMuTBge+XHI0Yy1fy5c5g5Ed 5V5pp+G43YlOY0G0m6SOdMIVidxYvAYFWP1ZkYhr7utCDgCrLSsh9skJGaZv4l+4/MRq Z9WvF//uySCGP69Q4iBBzyhfx4swHMfDYbg7yiqfrxMKYWBrO4mkpdF4vxgfc9Qm2a45 FdH/s7t4qix8v4aoavqd7vXX768OwuQRT532FE37uDCBBhSotXDOn6+JmE8J98QXLoL+ 6hNw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:message-id:in-reply-to:references:from:date :subject:fcc:content-transfer-encoding:mime-version:to:cc; bh=lkFiB/b95qi8AtHUtHivDCzc+U5s9+av6l7/Pw0pRgU=; b=YGC0Yp/Tr7BDx9WNFjqSZrgePqDeqsOHDr2ZdQ5pUyHNzJMysNNKl52DvbrnLMqTDw M5CIjz/rPMGV69CvGCsX69mTHF7buXPNrAXnyWZX4SS47mDv5RD2/rB2jxI+6FX5vyy+ 42fE+a71GoNiG3cwpePlf2VUWWDms8z44LJ0//IIz8tt9eYkQ3RG43J9oDmhhR4hKwEO EX7XMUlrtMGiOQvyYI/r2wKE/x2TKQDWxUWBnWFgm+dgUtjmec3JKz5DJWFgZ8tNyP1R m2YAZL6rNdsN8SWQoGt+k87pcg5ug2zMVsRgl3aISBWMDODTguzjPNQeC9PcGkXv7fHc IJbA== X-Gm-Message-State: AOAM530AoorlQ5cbhVJHE9mrIAteo0duRaBIeQlsf1szFFjMtHZjIkRU Ne4SLM4+yyRMWxOM65s+xeCWwZVMFqM0iA== X-Google-Smtp-Source: ABdhPJz7ySYzo2/Fo0j3qxnribi7DjpSLSDiYt9NnHEt8mG9anhqAzPMURDTyNj5RpaB1X8kelPq1g== X-Received: by 2002:adf:f0c8:: with SMTP id x8mr654321wro.290.1635542131751; Fri, 29 Oct 2021 14:15:31 -0700 (PDT) Received: from [127.0.0.1] ([13.74.141.28]) by smtp.gmail.com with ESMTPSA id s3sm6641629wrm.40.2021.10.29.14.15.31 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 29 Oct 2021 14:15:31 -0700 (PDT) Message-Id: <57b2079f30a3b8cbaf83c93510abd5b1ad7fff61.1635542128.git.gitgitgadget@gmail.com> In-Reply-To: References: Date: Fri, 29 Oct 2021 21:15:27 +0000 Subject: [PATCH 4/4] doc: add docs for newlineafter flag Fcc: Sent MIME-Version: 1.0 To: git@vger.kernel.org Cc: John Cai , John Cai Precedence: bulk List-ID: X-Mailing-List: git@vger.kernel.org From: John Cai From: John Cai Provide documentation for --newlineafter flag Signed-off-by: John Cai --- Documentation/pretty-options.txt | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/Documentation/pretty-options.txt b/Documentation/pretty-options.txt index b3af8506086..7de51c660fe 100644 --- a/Documentation/pretty-options.txt +++ b/Documentation/pretty-options.txt @@ -32,6 +32,10 @@ people using 80-column terminals. This is a shorthand for "--pretty=oneline --abbrev-commit" used together. +--newlineafter[=(decorations)] + Used in conjunction with --pretty=oneline to add a line break after + decorations + --encoding=:: Commit objects record the character encoding used for the log message in their encoding header; this option can be used to tell the