git@vger.kernel.org mailing list mirror (one of many)
 help / color / mirror / code / Atom feed
From: Florian Weimer <fw@deneb.enyo.de>
To: git@vger.kernel.org
Subject: Re: git mailinfo with patch parser
Date: Wed, 02 Oct 2019 07:41:17 +0200	[thread overview]
Message-ID: <878sq366wy.fsf@mid.deneb.enyo.de> (raw)
In-Reply-To: <xmqq1rvvhfq2.fsf@gitster-ct.c.googlers.com> (Junio C. Hamano's message of "Wed, 02 Oct 2019 14:35:33 +0900")

* Junio C. Hamano:

>> Is there a way to get the patch data, as parsed by git apply or git
>> am, and dump it back in patch format, without actually applying the
>> patch to a working tree?
>
> So, "the patch data as used by apply" is what you get from mailinfo.
> If it is a patch that applies to what you have in the working tree
> and/or the index is something you can/must ask "git apply".  IOW,
> when "git mailinfo" stored in $GIT_DIR/rebase-apply/patch the
> "remainder" of the message, you could
>
> 	git apply --check [--index] $GIT_DIR/rebase-apply/patch
>
> to see if it is an OK patch.  If it is, then there is no need to
> further "dump it back in patch format"; what you just fed to "apply
> --check" is already in the patch format.

Yes, but that requires a fully patched up Git repository containing
the right blobs.

We know from experience that it is easy for humans to misread patches
and fail to notice that certain patch hunks are actually ignored by
git apply and similar tools.  If there was a way to feed the patch
through the parser and serialize it back, these discrepancies would be
more noticeable, I think.  Any data ignored by git apply/git am would
be missing from the output.

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

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-10-02  4:43 git mailinfo with patch parser Florian Weimer
2019-10-02  5:35 ` Junio C Hamano
2019-10-02  5:41   ` Florian Weimer [this message]

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=878sq366wy.fsf@mid.deneb.enyo.de \
    --to=fw@deneb.enyo.de \
    --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.
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).