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

Re: StGIT: "stg new" vs "stg new --force"

From
PRPavel Roskin <proski@gnu.org>
Date
Jan 22, 2006, 05:05 UTC
Message-ID
<20060122000509.btnr4s4g0wgg0kwo@webmail.spamcop.net>
In-Reply-To
<b0943d9e0601211024s76528ce8m@mail.gmail.com>
Hello, Catalin!
Quoting Catalin Marinas <catalin.marinas@gmail.com>:
Show 11 quoted lines
> On 17/01/06, Pavel Roskin <proski@gnu.org> wrote:
> > I think if would be better to improve "stg fold" to work on arbitrary
> > patches.  This way, you prepare the patch in the editor (which would not
> > be harder than finding hunk numbers) and fold it into the patch of your
> > choice.  stg should check that the stack remains valid, possibly doing
> > trivial adjustments to the higher patches.  The current tree should not
> > be impacted.
>
> Note that 'stg fold' uses git-apply-patch which doesn't take fuzzy
> patches (a feature I began to like actually). Modifying the patch in
> an editor might create some problems with applying.

Actually, the safest way would be to keep the original patch as presented to the user. Then the new patch would be "subtracted" from the original patch (using e.g. interdiff from diff-utils). The the difference would be "added" to the current version of the patch. Changes to "binary files differ" and similar line should be ignored. This way, changes to binary files are preserved.

For additional safety (and at expense or concurrency), it could be required that
 the patch is unchanged since the editor was launched.  Editors tend to run for
a long time compared to non-interactive utilities.

Fuzziness should be tolerated to a point. Removing hunks could mean that the line numbers would be slightly off. If needed, the patch should be applied to a temporary copy and regenerated from it.

-- Regards, Pavel Roskin

Previous: Catalin MarinasNext: Catalin Marinas
Message 17 of 19 in “StGIT: "stg new" vs "stg new --force"”
  1. Pavel RoskinJan 13, 2006
  2. Karl HasselströmJan 13, 2006
  3. Catalin MarinasJan 16, 2006
  4. Pavel RoskinJan 17, 2006
  5. Yann DirsonJan 17, 2006
  6. Pavel RoskinJan 17, 2006
  7. Yann DirsonJan 18, 2006
  8. Pavel RoskinJan 19, 2006
  9. Yann DirsonJan 19, 2006
  10. Pavel RoskinJan 20, 2006
  11. J. Bruce FieldsJan 20, 2006
  12. Pavel RoskinJan 24, 2006
  13. J. Bruce FieldsJan 24, 2006
  14. Pavel RoskinJan 24, 2006
  15. Catalin MarinasJan 24, 2006
  16. Catalin MarinasJan 21, 2006
  17. Pavel RoskinJan 22, 2006
  18. Catalin MarinasJan 21, 2006
  19. Catalin MarinasJan 21, 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.