git/list[1] front-page[2] threads[3] people[4] search[5] about
 

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.

Previous: Jeff KingNext: Junio C Hamano
Message 8 of 11 in “Add explicit --src/dst-prefix to git-formt-patch in git-rebase.sh for the case of "diff.noprefix" in git-config”
  1. Add explicit --src/dst-prefix to git-formt-patch in git-rebase.sh for the case of "diff.noprefix" in git-configOded Shimon, Sep 8, 2010
  2. ods15@ods15.dyndns.orgSep 8, 2010
  3. Jan KrügerSep 8, 2010
  4. Add --src/dst-prefix to git-formt-patch in git-rebase.shOded Shimon, Sep 9, 2010
  5. format-patch: do not use diff UI configThomas Rast, Sep 9, 2010
  6. Sverre RabbelierSep 9, 2010
  7. Jeff KingSep 9, 2010
  8. Junio C HamanoSep 10, 2010
  9. Junio C HamanoSep 9, 2010
  10. ods15@ods15.dyndns.orgSep 9, 2010
  11. Add --src/dst-prefix to git-formt-patch in git-rebase.shOded Shimon, Sep 9, 2010

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.