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

Re: [PATCH 0/4] Series short description

From
CMCatalin Marinas <catalin.marinas@gmail.com>
Date
Nov 24, 2006, 15:37 UTC
Message-ID
<b0943d9e0611240737h572bc5f8g3e9b34edf22fe1a5@mail.gmail.com>
In-Reply-To
<20061123230721.9769.38403.stgit@gandelf.nowhere.earth>
On 23/11/06, Yann Dirson <ydirson@altern.org> wrote:
Show 5 quoted lines
> The following adds a --patch flag to "stg refresh".  I mainly needed it to
> edit the log message in patches down the stack, but with some work it could
> be used to record changes in another file and come back.
>
> That would require to pop patches with --keep,

pop_patches(keep=True) allows this (I already added it to your patch). This option actually applies the reverse of the patch between the current index and the bottom of the last patch to be popped. If it fails, it doesn't affect the current tree and reports an error.

> and if we ask to only record
> a subset of the changes, we would need to implement "push --keep" first.

The "push --keep" is a bit more complicated to implement since it would usually have to generate commits (pop doesn't need to) since usually the base of the pushed patches might have changed (especially with the refresh --patch). It is even more complicated if the changes you want to preserve affect a file modified by the pushed patches.

A solution I see is to generate a temporary diff, push the patches you want and fold this temporary diff (the diff can be temporarily written to a local file so that you don't lose them in case of an error or Ctrl-C). If the push fails (conflicts) or the diff no longer applies, just undo the push and re-apply the diff. There is no way to simply check whether all the patches apply (git-apply --check) since you can't generate a single diff for all the pushed patches (which might not be in the committed order).

Previous: Yann Dirson
Message 6 of 6 in “Series short description”
  1. 0/4 Series short descriptionYann Dirson, Nov 23, 2006
  2. 1/4 Make Series::patch_applied public.Yann Dirson, Nov 23, 2006
  3. 2/4 Allows to refresh a non-top applied patch.Yann Dirson, Nov 23, 2006
  4. 3/4 Optimize stg goto in the pop case.Yann Dirson, Nov 23, 2006
  5. 4/4 Bomb out when --ack and --sign are both passed to "refresh".Yann Dirson, Nov 23, 2006
  6. Catalin MarinasNov 24, 2006

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.