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

Re: [StGit PATCH] Convert "sink" to the new infrastructure

From
Karl Hasselström <kha@treskal.com>
Date
Sep 18, 2008, 15:47 UTC
Message-ID
<20080918154757.GA19868@diana.vm.bytemark.co.uk>
In-Reply-To
<b0943d9e0809180431x30c8f751g374732ee861ffe61@mail.gmail.com>
On 2008-09-18 12:31:35 +0100, Catalin Marinas wrote:
Show 18 quoted lines
> 2008/9/18 Karl Hasselström <kha@treskal.com>:
>
> > Ah, OK. Then I think you want something like this:
> >
> >  try:
> >      trans.reorder_patches(applied, unapplied, hidden, iw)
> >  except transaction.TransactionHalted:
> >      if not options.conflict:
> >          trans.abort(iw)
> >          raise common.CmdException(
> >              'Operation rolled back -- would result in conflicts')
> >  return trans.run(iw)
>
> I tried this before but trans.abort(iw) seems to check out the iw
> index which is the one immediately after the push conflict, though
> the stack is unmodified, i.e. stg status shows some missing files
> (which are added by subsequent patches after the conflicting one)
> and a conflict.

Hmm, strange. That's not what I thought it was supposed to do. Look at how coalesce uses it, for example.

Show 7 quoted lines
> Or simply give up on the --conflict option and always stop after the
> conflict (catch the exception and don't re-raise it). This way we
> don't have to bother with checking out the initial state. With the
> "undo" command in your branch, people could simply revert the stack
> to the state prior to the sink command. Maybe that's a good idea so
> that we don't complicate commands further with different conflict
> behaviours.

Yes, this is what every other command does, so it makes sense consistency-wise.

But I liked the idea of your "roll-back-in-case-of-conflicts" flag; it would be nice to have in many commands.

-- 
Karl Hasselström, kha@treskal.com
      www.treskal.com/kalle
Previous: Catalin Marinas
Message 18 of 18 in “Convert "sink" to the new infrastructure”
  1. Convert "sink" to the new infrastructureCatalin Marinas, Sep 12, 2008
  2. Karl HasselströmSep 14, 2008
  3. Catalin MarinasSep 14, 2008
  4. Karl HasselströmSep 15, 2008
  5. Catalin MarinasSep 15, 2008
  6. Karl HasselströmSep 16, 2008
  7. Catalin MarinasSep 16, 2008
  8. Karl HasselströmSep 16, 2008
  9. Catalin MarinasSep 17, 2008
  10. Karl HasselströmSep 17, 2008
  11. Karl HasselströmSep 17, 2008
  12. Catalin MarinasSep 17, 2008
  13. Karl HasselströmSep 18, 2008
  14. Catalin MarinasSep 18, 2008
  15. Catalin MarinasSep 17, 2008
  16. Karl HasselströmSep 18, 2008
  17. Catalin MarinasSep 18, 2008
  18. Karl HasselströmSep 18, 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.