summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPhilip Withnall <philip.withnall@collabora.co.uk>2016-08-08 17:34:25 +0100
committerThibault Saunier <tsaunier@gnome.org>2016-08-09 14:37:45 -0400
commita42d52a20098860c367df07d83f85d1a555d6ed6 (patch)
treee7abf6c387c0b3fe01619ca8781b0f1681144902
parentf1e30b0e696311cf1c31efe50f7c71d97d1b0f85 (diff)
git-phab: Do not strip leading spaces from commit messages
Only strip leading newlines; otherwise commit messages which are a list of bullet points will end up with one space missing from the front of the first bullet point. Signed-off-by: Philip Withnall <philip.withnall@collabora.co.uk> Reviewed-by: Thibault Saunier <tsaunier@gnome.org> Differential Revision: https://phabricator.freedesktop.org/D1257
-rwxr-xr-xgit-phab4
1 files changed, 2 insertions, 2 deletions
diff --git a/git-phab b/git-phab
index a920716..910a8c2 100755
--- a/git-phab
+++ b/git-phab
@@ -677,7 +677,7 @@ Paste API Token from that page and press <enter>: """ % self.phabricator_uri)
def format_commit_msg(self, subject, body, git_fields, phab_fields,
ask=False):
subject = subject.strip()
- body = '\n'.join(body).strip()
+ body = '\n'.join(body).strip('\r\n')
fields = '\n'.join(git_fields + phab_fields).strip()
subject = self.format_field(subject, ask)
@@ -989,7 +989,7 @@ Paste API Token from that page and press <enter>: """ % self.phabricator_uri)
phab_fields.append("Projects: %s" % ','.join(self.project_phids))
- summary = ('\n'.join(body) + '\n' + '\n'.join(git_fields)).strip()
+ summary = ('\n'.join(body) + '\n' + '\n'.join(git_fields)).strip('\r\n')
revision_id = self.get_differential_id(self.repo.head.commit)
if revision_id: