git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: "Catalin Marinas" <catalin.marinas@gmail.com>
To: "Karl Hasselström" <kha@treskal.com>
Cc: git@vger.kernel.org
Subject: Re: [StGit PATCH] Convert "sink" to the new infrastructure
Date: Wed, 17 Sep 2008 17:09:46 +0100	[thread overview]
Message-ID: <b0943d9e0809170909j4fce34acr8f0b844d0cb5281d@mail.gmail.com> (raw)
In-Reply-To: <20080916193647.GA12513@diana.vm.bytemark.co.uk>

2008/9/16 Karl Hasselström <kha@treskal.com>:
> On 2008-09-16 15:59:31 +0100, Catalin Marinas wrote:
>
>> 2008/9/16 Karl Hasselström <kha@treskal.com>:
>>
>> > iw is the index+worktree object. The idea is that you provide one
>> > if your branch is checked out, and not if not. Operations that
>> > have no need of index+worktree, like pop, and push in case
>> > automatic merging succeeds, will just work anyway, while
>> > operations that need index+worktree, such as a conflicting push,
>> > will cause the whole transaction to abort.
>>
>> Ah, that's the difference. I thought that even if iw isn't passed,
>> it uses the default one.
>
> It wouldn't be clean of it to do that -- it would be accessing
> non-local state it had no business knowing about. I try hard to avoid
> that kind of thing.

I'm still confused by this and I don't think your new flag would help.
The meaning of stop_before_conflict is that it won't push the
conflicting patch but actually leave the stack with several patches
pushed or popped.

What I want for sink (and float afterwards) is by default to cancel
the whole transaction if there is a conflict and revert the stack to
it's original state prior to the "stg sink" command. What I have in my
code:

    iw = stack.repository.default_iw
    trans = transaction.StackTransaction(stack, 'sink')

    try:
        trans.reorder_patches(applied, unapplied, hidden, iw)
    except transaction.TransactionHalted:
        if not options.conflict:
            ??? here it needs to check out the previous iw
            raise

    return trans.run(iw)

It runs as expected if --conflict is given but in the default case, if
there is a conflict, it keeps the original patchorder (as expected)
but the worktree isn't clean. What do I replace ??? with to clean the
work tree?

BTW, much shorter with reorder_patches.

-- 
Catalin

  parent reply	other threads:[~2008-09-17 16:11 UTC|newest]

Thread overview: 18+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-09-12 22:01 [StGit PATCH] Convert "sink" to the new infrastructure Catalin Marinas
2008-09-14  8:51 ` Karl Hasselström
2008-09-14 21:19   ` Catalin Marinas
2008-09-15  7:57     ` Karl Hasselström
2008-09-15 16:44       ` Catalin Marinas
2008-09-16  7:40         ` Karl Hasselström
2008-09-16 14:59           ` Catalin Marinas
2008-09-16 19:36             ` Karl Hasselström
2008-09-17 11:55               ` Catalin Marinas
2008-09-17 13:04                 ` Karl Hasselström
2008-09-17 13:09                   ` Karl Hasselström
2008-09-17 16:01                   ` Catalin Marinas
2008-09-18  7:10                     ` Karl Hasselström
2008-09-18 11:24                       ` Catalin Marinas
2008-09-17 16:09               ` Catalin Marinas [this message]
2008-09-18  7:24                 ` Karl Hasselström
2008-09-18 11:31                   ` Catalin Marinas
2008-09-18 15:47                     ` Karl Hasselström

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=b0943d9e0809170909j4fce34acr8f0b844d0cb5281d@mail.gmail.com \
    --to=catalin.marinas@gmail.com \
    --cc=git@vger.kernel.org \
    --cc=kha@treskal.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).