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

Re: [PATCH] Teach "git apply" to prepend a prefix with "--root=<root>"

From
HAH. Peter Anvin <hpa@zytor.com>
Date
Jul 1, 2008, 16:05 UTC
Message-ID
<486A55B0.9050404@zytor.com>
In-Reply-To
<7vvdzqnemk.fsf@gitster.siamese.dyndns.org>
Junio C Hamano wrote:
Show 12 quoted lines
> 
> The -p<num> came from patch where it is also called --strip=num.  This new
> option --root is about the reverse operation and it is about inserting at
> the beginning --- it is rerooting, in other words, but then --root is good
> enough and shorter.  mkisofs uses the word "graft" when it allows tree
> shifting (enabled with --graft-points), but the word "graft" means a
> totally different thing to us, so we would not want to use that word.
> 
> I am not complaining (--root is fine by me), but just thinking aloud,
> hoping somebody's brainwave is provoked while reading this babbling and
> comes up with a better wording ;-).
> 

There is an analogous concept in patch(1), it's just implemented by cd'ing to a subdirectory first. ;)

I think --root makes sense as the root of the patch. The other alternative would be --add (by analogy with --strip); the biggest advantage there is that -a, as a short option, isn't used for anything either by git-am, git-apply, or patch.

Incidentally, has anyone talked to the patch(1) maintainers about adding support for the git extensions, like binary patches? The main reason is that patch(1) is still useful when you have to suffer though fuzzy errors.

	-hpa
Previous: Junio C HamanoNext: Johannes Schindelin
Message 3 of 8 in “Teach "git apply" to prepend a prefix with "--root=<root>"”
  1. Teach "git apply" to prepend a prefix with "--root=<root>"Johannes Schindelin, Jun 30, 2008
  2. Junio C HamanoJul 1, 2008
  3. H. Peter AnvinJul 1, 2008
  4. Johannes SchindelinJul 1, 2008
  5. H. Peter AnvinJul 1, 2008
  6. Raimund BauerJul 1, 2008
  7. H. Peter AnvinJul 1, 2008
  8. Johannes SchindelinJul 1, 2008

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.