Git development
 help / color / mirror / Atom feed
From: Junio C Hamano <gitster@pobox.com>
To: Tanga Joris <tangajoris@gmail.com>
Cc: phillip.wood@dunelm.org.uk,  git@vger.kernel.org,
	jackrawlings2011@gmail.com,  christian.couder@gmail.com,
	siddharthasthana31@gmail.com,  kaartic.sivaraam@gmail.com,
	usmanakinyemi202@gmail.com
Subject: Re: [Outreachy PATCH 1/2] apply: do not keep names from an unused "diff --git" line
Date: Mon, 09 Nov 2026 13:06:39 -0800	[thread overview]
Message-ID: <xmqq4idpyasg.fsf@gitster.g> (raw)
In-Reply-To: <CAKrRMNrwEgv6JsWcd+UorLrKcsBgHV=UUvfH316hedM2TYGWqA@mail.gmail.com> (Tanga Joris's message of "Mon, 9 Nov 2026 23:54:51 +0300")

Tanga Joris <tangajoris@gmail.com> writes:

> One thing I noticed while checking this. "git format-patch" can
> produce a "diff --git" line with nothing after it, when a line in the
> body of the commit message looks like "diff --git a/x b/x".

A garbage in the commit log message does not count as coming from
"git diff".  It may take some effort to teach "git am" to avoid
feeding such a false "diff --git" line down to "git apply", but an
important thing to keep in mind is that it is NOT "git apply"'s job
to worry about such a garbage input.


  reply	other threads:[~2026-11-09 21:06 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-10-17 15:17 Git crashed on `git apply --check` Gingrspacecadet
2026-10-24  6:10 ` Tanga Joris
     [not found]   ` <CALdwsC11JHUBBTt3e_RFixLYSF0VU1C+mG7bQsO0vV=a68XHNw@mail.gmail.com>
2026-10-25 22:56     ` Tanga Joris
2026-11-07 19:54 ` [Outreachy PATCH 1/2] apply: do not keep names from an unused "diff --git" line Tanga Joris
2026-11-07 19:54   ` [Outreachy PATCH 2/2] apply: reject new and deleted files that have both names Tanga Joris
2026-11-09 10:52   ` [Outreachy PATCH 1/2] apply: do not keep names from an unused "diff --git" line Phillip Wood
2026-11-09 13:13     ` Tanga Joris
2026-11-09 14:31       ` Phillip Wood
2026-11-09 20:54         ` Tanga Joris
2026-11-09 21:06           ` Junio C Hamano [this message]
2026-11-09 23:03             ` Tanga Joris
2026-11-09 19:56     ` 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=xmqq4idpyasg.fsf@gitster.g \
    --to=gitster@pobox.com \
    --cc=christian.couder@gmail.com \
    --cc=git@vger.kernel.org \
    --cc=jackrawlings2011@gmail.com \
    --cc=kaartic.sivaraam@gmail.com \
    --cc=phillip.wood@dunelm.org.uk \
    --cc=siddharthasthana31@gmail.com \
    --cc=tangajoris@gmail.com \
    --cc=usmanakinyemi202@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.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox