From: Junio C Hamano <gitster@pobox•com>
To: Harry Jeffery <harry@exec64•co.uk>
Cc: git@vger•kernel.org
Subject: Re: [PATCH v2] pretty: add %D format specifier
Date: Mon, 15 Sep 2014 15:44:25 -0700 [thread overview]
Message-ID: <xmqq7g144i7q.fsf@gitster.dls.corp.google.com> (raw)
In-Reply-To: <54175F2D.3070209@exec64.co.uk> (Harry Jeffery's message of "Mon, 15 Sep 2014 22:50:37 +0100")
Harry Jeffery <harry@exec64•co.uk> writes:
> Add a new format specifier, '%D' that is identical in behaviour to '%d',
> except that it does not include the ' (' prefix or ')' suffix provided
> by '%d'.
>
> Signed-off-by: Harry Jeffery <harry@exec64•co.uk>
> ---
The patch is broken and does not apply with "git am" here. Please
first try sending a patch to yourself and make sure it comes through
OK.
Thanks.
> diff --git a/log-tree.h b/log-tree.h
> index d6ecd4d..b26160c 100644
> --- a/log-tree.h
> +++ b/log-tree.h
> @@ -13,7 +13,13 @@ int log_tree_diff_flush(struct rev_info *);
> int log_tree_commit(struct rev_info *, struct commit *);
> int log_tree_opt_parse(struct rev_info *, const char **, int);
> void show_log(struct rev_info *opt);
> -void format_decorations(struct strbuf *sb, const struct commit
> *commit, int use_color);
> +void format_decorations_extended(struct strbuf *sb, const struct
> commit *commit,
Broken lines...
> + int use_color,
> + const char *prefix,
> + const char *separator,
> + const char *suffix);
> +#define format_decorations(strbuf, commit, color) \
> + format_decorations_extended((strbuf),
> (commit), (color), " (", ", ", ")")
Broken line here, too.
> void show_decorations(struct rev_info *opt, struct commit *commit);
> void log_write_email_headers(struct rev_info *opt, struct commit *commit,
> const char **subject_p,
> diff --git a/pretty.c b/pretty.c
> index 44b9f64..46d65b9 100644
> --- a/pretty.c
> +++ b/pretty.c
> @@ -1197,6 +1197,10 @@ static size_t format_commit_one(struct strbuf
> *sb, /* in UTF-8 */
> load_ref_decorations(DECORATE_SHORT_REFS);
> format_decorations(sb, commit, c->auto_color);
> return 1;
> + case 'D':
> + load_ref_decorations(DECORATE_SHORT_REFS);
> + format_decorations_extended(sb, commit, c->auto_color, "", ", ", "");
> + return 1;
> case 'g': /* reflog info */
> switch(placeholder[1]) {
> case 'd': /* reflog selector */
> diff --git a/t/t4205-log-pretty-formats.sh b/t/t4205-log-pretty-formats.sh
> index de0cc4a..38148c1 100755
> --- a/t/t4205-log-pretty-formats.sh
> +++ b/t/t4205-log-pretty-formats.sh
> @@ -457,4 +457,15 @@ EOF
> test_cmp expected actual1
> '
>
> +test_expect_success 'clean log decoration' '
> + git log --no-walk --tags --pretty="%H %D" --decorate=full >actual &&
> + cat <<EOF >expected &&
> +$head1 tag: refs/tags/tag2
> +$head2 tag: refs/tags/message-one
> +$old_head1 tag: refs/tags/message-two
> +EOF
> + sort actual >actual1 &&
> + test_cmp expected actual1
> +'
> +
> test_done
prev parent reply other threads:[~2014-09-15 22:44 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2014-09-15 21:50 [PATCH v2] pretty: add %D format specifier Harry Jeffery
2014-09-15 22:44 ` Junio C Hamano [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=xmqq7g144i7q.fsf@gitster.dls.corp.google.com \
--to=gitster@pobox$(echo .)com \
--cc=git@vger$(echo .)kernel.org \
--cc=harry@exec64$(echo .)co.uk \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox