git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Pratyush Yadav <me@yadavpratyush.com>
To: Felipe Contreras <felipe.contreras@gmail.com>
Cc: git@vger.kernel.org
Subject: Re: Applying a patch with a diff header in its commit message
Date: Tue, 6 Jul 2021 13:47:38 +0530	[thread overview]
Message-ID: <20210706081738.5th24lypiicnbckv@yadavpratyush.com> (raw)
In-Reply-To: <60da5ed21ec8c_1f78f2082a@natae.notmuch>

On 28/06/21 06:44PM, Felipe Contreras wrote:
> Pratyush Yadav wrote:
> > I have a patch at $DAYJOB that contains a diff header ("diff --git 
> > a/...") in its commit message, and unfortunately it is not indented. So 
> > naturally, git-am trips up and thinks it is the start of the main diff 
> > and tries to apply the diff starting there. It does not apply and the 
> > patch is rejected as being corrupt.
> > 
> > I know one option for me is to manually edit the patch and indent the 
> > diff header. But I would like to avoid that if possible. Is there any 
> > way to apply that patch as-is? Is it possible to tell git-am where to 
> > start looking for the diff?
> 
> git apply?

Sure, that is an option. But then I would have to copy/paste the commit 
message and add the author information manually. Is there any way to do 
this automatically? What if I have 100 commits like this?

This is a valid Git commit. It would be nice if the Git email tooling 
could handle it cleanly.

-- 
Regards,
Pratyush Yadav

  reply	other threads:[~2021-07-06  8:17 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-06-28 18:30 Applying a patch with a diff header in its commit message Pratyush Yadav
2021-06-28 23:44 ` Felipe Contreras
2021-07-06  8:17   ` Pratyush Yadav [this message]
2021-07-06 14:37     ` Ævar Arnfjörð Bjarmason
2021-07-06 22:17     ` Felipe Contreras

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=20210706081738.5th24lypiicnbckv@yadavpratyush.com \
    --to=me@yadavpratyush.com \
    --cc=felipe.contreras@gmail.com \
    --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 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).