Re: [Alt. PATCH] format-patch: do not use diff UI config
- From
Junio C Hamano <gitster@pobox.com>
- Date
- Sep 10, 2010, 16:21 UTC
- Message-ID
- <7vzkvph8n4.fsf@alter.siamese.dyndns.org>
- In-Reply-To
- <2a6b8c51903fd6a22606b8f592b1a2e11ea68741.1284020917.git.trast@student.ethz.ch>
Thomas Rast <trast@student.ethz.ch> writes:
> ... > arguably only diff.renames (and perhaps diff.ignoresubmodules, I don't > use them) should affect format-patch. Everything else undermines the > guarantee (by having a consistent format) that format-patch|am works.
We need to be a bit careful here.
Each user must be able to find a combination of ($opts1, $opts2) to make "format-patch $opts1 | am $opts2" run correctly with his funny settings (e.g. diff.noprefix). We must guarantee that [*1*].
I however don't think we need to guarantee that the pipeline always works for empty opts1/2, and certainly we shouldn't insist what flows in that pipe must be the bog-standard -p1 with a/ b/ prefix patch. For example, in circles under svn influence, people may prefer opts1=--no-prefix, and as long as the recipient understands that is the community norm around there, he can run his "am" with -p0 and everything should work. It is not unreasonable for the sender to have diff.noprefix in the repository config in such a setup, don't you think?
There is no way to easily affect what options the "format-patch | am" pipeline uses inside rebase. It may make sense to introduce --rebasing option to format-patch to cause it to ignore any funny setting the user might have, so that we don't have to keep adding options to the command invocation. "am" has --rebasing already, and it may be beneficial to teach the codepath to defeat some configuration variables in a similar way.
[Footnote]
*1* ... within reason. For example, I don't think there is no opts2 if you had opts1="--src-prefix=a/ --dst-prefix=b/c/" that makes the pipeline work reasonably.