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

Re: [PATCH (resend)] Pass -C1 to git-apply in StGIT's apply_diff() and apply_patch().

From
CMCatalin Marinas <catalin.marinas@gmail.com>
Date
Apr 10, 2007, 22:38 UTC
Message-ID
<b0943d9e0704101538p3de0bf56m7906cfe2f5fc157e@mail.gmail.com>
In-Reply-To
<20070410193214.GF4946@moonlight.home>
On 10/04/07, Tomash Brechko <tomash.brechko@gmail.com> wrote:
Show 6 quoted lines
> Once we are talking about StGIT's push (push of
> the patch back to the stack), why would we want to start tree-way
> merge when the context has changed?  My point was exactly that since I
> want to keep my patches up-to-date with the main branch, I do rebase
> from time to time, and I'm not interested in doing the merge every
> time just because something has changed upstream in surrounding code.

When something has changed in the surrounding code (not touched by your patch), the automatic three-way merge should, in general, be able to solve the issue as it uses the ancestor information. Is the automatic three-way merge failing as well in your case?

> The same goes for patches that were already applied upstream.
> Whatever the current context around the code of my applied patch is, I
> have to accept it, because the patch was applied.  I'm going to throw
> it away locally, but currently I have to do the merge first.

I think -C1 should be OK for merge detection (in most situations) and importing patch files (via import, fold) but I personally don't like it when rebasing a patch. I still prefer a more precise context checking, rather than the fuzzy one similar to the "patch" tool (as the line numbers are usually volatile).

I'm OK with the idea of this patch but I would prefer a config option and/or command line option rather than hard-coding it for people with different views. A command line option could make sense for commands like import/fold and a config option for the rest.

Thanks.
-- 
Catalin
Previous: Tomash BrechkoNext: Tomash Brechko
Message 5 of 6 in “Pass -C1 to git-apply in StGIT's apply_diff() and apply_patch().”
  1. Pass -C1 to git-apply in StGIT's apply_diff() and apply_patch().Tomash Brechko, Apr 9, 2007
  2. Catalin MarinasApr 10, 2007
  3. Tomash BrechkoApr 10, 2007
  4. Tomash BrechkoApr 10, 2007
  5. Catalin MarinasApr 10, 2007
  6. Tomash BrechkoApr 11, 2007

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.