All of lore.kernel.org
 help / color / mirror / Atom feed
From: Max Filenko <contact@filenko.ms>
To: git@vger.kernel.org
Subject: [BUG] git-am: all colons in the beginning of a subject are lost
Date: Thu, 28 Feb 2019 11:02:11 +0100	[thread overview]
Message-ID: <m2wolk6xjw.fsf@filenko.ms> (raw)

Hi!

If there are colons in the beginning of a patch subject line `git-am'
will drop them.

Consider the following patch:

    $ cat 0001-four-colons-prepended.patch
    From e8213a2d10a61c9dc75521d88d656b8d5330e6bb Mon Sep 17 00:00:00 2001
    From: Max Filenko <contact@filenko.ms>
    Date: Tue, 12 Feb 2019 12:21:21 +0100
    Subject: [PATCH] :::: four colons prepended
    
    ---
     file.txt | 2 +-
     1 file changed, 1 insertion(+), 1 deletion(-)
    
    diff --git a/file.txt b/file.txt
    index 4dd1ef7..b5da95d 100644
    --- a/file.txt
    +++ b/file.txt
    @@ -1 +1 @@
    -This is a file.
    +This is a plain text file.
    -- 
    2.17.1

There will be no colons in the beginning of a commit message if I apply
this patch:

    $ git am 0001-four-colons-prepended.patch
    Applying: four colons prepended

The four colons already gone in the log message above. There are neither
no colons in the commit subject line:

    $ git show
    commit 6341a6a2872f850ecb376c268b1b3bae54a6a74f (HEAD -> master)
    Author: Max Filenko <contact@filenko.ms>
    Date:   Tue Feb 12 12:21:21 2019 +0100
    
        four colons prepended
    
    diff --git a/file.txt b/file.txt
    index 4dd1ef7..b5da95d 100644
    --- a/file.txt
    +++ b/file.txt
    @@ -1 +1 @@
    -This is a file.
    +This is a plain text file.

I was able to reproduce this with git 2.17.1 on Ubuntu 18.04.2 LTS as
well as with git 2.17.2 (Apple Git-113) on macOS 10.14.3.

I was able to trace this down to <builtin/am.c>. It seems like there are
no colons already in the `state->msg' which to my understanding is being
filled by `read_commit_msg()' function. I would really appreciate a hand
on debugging it further.

I'm re-submitting this bug report because the original one [1] wasn't
really noticed. Hopefully, it's just because I've missed the proper
prefix in my email's subject line :)

[1]:
http://public-inbox.org/git/m2lg2lxmmm.fsf@bouncer.i-did-not-set--mail-host-address--so-tickle-me/

--
Best,
Max

             reply	other threads:[~2019-02-28 10:02 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-02-28 10:02 Max Filenko [this message]
2019-02-28 11:26 ` [BUG] git-am: all colons in the beginning of a subject are lost Jeff King

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=m2wolk6xjw.fsf@filenko.ms \
    --to=contact@filenko.ms \
    --cc=git@vger.kernel.org \
    /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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.