From: Johannes Schindelin <johannes.schindelin@gmx.de>
To: git@vger.kernel.org
Cc: Junio C Hamano <gitster@pobox.com>, Liam Beguin <liambeguin@gmail.com>
Subject: [PATCH 5/5] sequencer: do not invent whitespace when transforming OIDs
Date: Sat, 23 Dec 2017 00:56:00 +0100 (STD) [thread overview]
Message-ID: <da288dac49ac1e54db99349a50a7cd684956671c.1513986836.git.johannes.schindelin@gmx.de> (raw)
In-Reply-To: <cover.1513986836.git.johannes.schindelin@gmx.de>
For commands that do not have an argument, there is no need to append a
trailing space at the end of the line.
Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
---
sequencer.c | 5 ++++-
1 file changed, 4 insertions(+), 1 deletion(-)
diff --git a/sequencer.c b/sequencer.c
index 5632415ea2d..970842e3fcc 100644
--- a/sequencer.c
+++ b/sequencer.c
@@ -2584,7 +2584,10 @@ int transform_todos(unsigned flags)
strbuf_addf(&buf, " %s", oid);
}
/* add all the rest */
- strbuf_addf(&buf, " %.*s\n", item->arg_len, item->arg);
+ if (!item->arg_len)
+ strbuf_addch(&buf, '\n');
+ else
+ strbuf_addf(&buf, " %.*s\n", item->arg_len, item->arg);
}
i = write_message(buf.buf, buf.len, todo_file, 0);
--
2.15.1.windows.2
next prev parent reply other threads:[~2017-12-22 23:56 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2017-12-22 23:55 [PATCH 0/5] A couple of sequencer cleanups Johannes Schindelin
2017-12-22 23:55 ` [PATCH 1/5] rebase: do not continue when the todo list generation failed Johannes Schindelin
2017-12-22 23:55 ` [PATCH 2/5] sequencer: strip bogus LF at end of error messages Johannes Schindelin
2017-12-22 23:55 ` [PATCH 3/5] sequencer: remove superfluous conditional Johannes Schindelin
2017-12-22 23:55 ` [PATCH 4/5] sequencer: report when noop has an argument Johannes Schindelin
2017-12-22 23:56 ` Johannes Schindelin [this message]
2017-12-27 22:19 ` [PATCH 5/5] sequencer: do not invent whitespace when transforming OIDs Liam Beguin
2017-12-27 20:33 ` [PATCH 0/5] A couple of sequencer cleanups 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
List information: http://vger.kernel.org/majordomo-info.html
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=da288dac49ac1e54db99349a50a7cd684956671c.1513986836.git.johannes.schindelin@gmx.de \
--to=johannes.schindelin@gmx.de \
--cc=git@vger.kernel.org \
--cc=gitster@pobox.com \
--cc=liambeguin@gmail.com \
/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.
Code repositories for project(s) associated with this public inbox
https://80x24.org/mirrors/git.git
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 read-only IMAP folder(s) and NNTP newsgroup(s).