From: "René Scharfe" <l.s.r@web.de>
To: Junio C Hamano <gitster@pobox.com>
Cc: "brian m. carlson" <sandals@crustytoothpaste.net>,
Git List <git@vger.kernel.org>
Subject: Re: [PATCH] cocci: avoid self-references in object_id transformations
Date: Mon, 17 Oct 2016 22:04:43 +0200 [thread overview]
Message-ID: <014ef44e-9dd8-40b3-a3ec-b483f938ee02@web.de> (raw)
In-Reply-To: <xmqqlgxmvof2.fsf@gitster.mtv.corp.google.com>
Am 17.10.2016 um 20:08 schrieb Junio C Hamano:
> ... oops. Totally unrelated to this patch, but I see these in
> strbuf.cocci.patch (this is at the tip of 'pu'), which are total
> nonsense. Perhaps I am running a way-stale spatch? It claims to be
> "spatch version 1.0.0-rc19 with Python support and with PCRE support"
>
> --- date.c
> +++ /tmp/cocci-output-21568-bd3448-date.c
> @@ -179,7 +179,7 @@ const char *show_date(unsigned long time
>
> if (mode->type == DATE_UNIX) {
> strbuf_reset(&timebuf);
> - strbuf_addf(&timebuf, "%lu", time);
> + strbuf_addstr(&timebuf, time);
> return timebuf.buf;
> }
>
> --- log-tree.c
> +++ /tmp/cocci-output-21608-b02087-log-tree.c
> @@ -400,7 +400,7 @@ void log_write_email_headers(struct rev_
> extra_headers = subject_buffer;
>
> if (opt->numbered_files)
> - strbuf_addf(&filename, "%d", opt->nr);
> + strbuf_addstr(&filename, opt->nr);
> else
> fmt_output_commit(&filename, commit, opt);
> snprintf(buffer, sizeof(buffer) - 1,
I get these instead with 6513eabcbcbcfa684d4bb2d57f61c662b870b5ca on
Debian testing with its "spatch version 1.0.4 with Python support and
with PCRE support", which look legit:
--- sequencer.c
+++ /tmp/cocci-output-40365-db7a71-sequencer.c
@@ -159,7 +159,7 @@ int sequencer_remove_state(struct replay
free(opts->xopts[i]);
free(opts->xopts);
- strbuf_addf(&dir, "%s", get_dir(opts));
+ strbuf_addstr(&dir, get_dir(opts));
remove_dir_recursively(&dir, 0);
strbuf_release(&dir);
--- builtin/branch.c
+++ /tmp/cocci-output-40858-a86d1a-branch.c
@@ -316,7 +316,7 @@ static char *build_format(struct ref_fil
if (filter->verbose) {
strbuf_addf(&local, "%%(align:%d,left)%%(refname:strip=2)%%(end)", maxwidth);
- strbuf_addf(&local, "%s", branch_get_color(BRANCH_COLOR_RESET));
+ strbuf_addstr(&local, branch_get_color(BRANCH_COLOR_RESET));
strbuf_addf(&local, " %%(objectname:short=7) ");
if (filter->verbose > 1)
next prev parent reply other threads:[~2016-10-17 20:05 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2016-10-15 8:25 [PATCH] cocci: avoid self-references in object_id transformations René Scharfe
2016-10-15 13:45 ` brian m. carlson
2016-10-17 18:08 ` Junio C Hamano
2016-10-17 20:04 ` René Scharfe [this message]
2016-10-17 21:11 ` Junio C Hamano
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=014ef44e-9dd8-40b3-a3ec-b483f938ee02@web.de \
--to=l.s.r@web.de \
--cc=git@vger.kernel.org \
--cc=gitster@pobox.com \
--cc=sandals@crustytoothpaste.net \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
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;
as well as URLs for NNTP newsgroup(s).