# Re: Stg AssertionError in sink command

2 messages from 2007-09-15 to 2007-09-15. Participants: Catalin Marinas, Karl Hasselström.
Thread: https://gitlist.dev/t/9870

## Catalin Marinas, 2007-09-15 22:37

Subject: Re: Stg AssertionError in sink command
Message-ID: <b0943d9e0709151537k51f2f8d5w5a9bbfef84f82747@mail.gmail.com>
URL: https://gitlist.dev/e/b0943d9e0709151537k51f2f8d5w5a9bbfef84f82747%40mail.gmail.com
In-Reply-To: <9e4733910709131308la9b3e44le70e1fac2b339189@mail.gmail.com>

```
On 13/09/2007, Jon Smirl <jonsmirl@gmail.com> wrote:
> Patch 008 was hidden and I used unhide to bring it back. But the
> hide/unhide process moved it to the top of the stack. I need to sink
> it back down to where it came from. Shouldn't hide/unhide preserve the
> patch position in the stack?

I now got the time to read this thread in more detail.

The initial implementation of hide/unhide was to preserve the patch
position in the stack. This behaviour was really confusing for people
since pushing a patch after the hidden one actually forced the pushing
of the hidden patch, which isn't normally shown by 'series'. I decided
afterwards to create a third category of patches - 'hidden' (the other
two being applied and unapplied). This cleared the unpredictable
behaviour when pushing since hidden patches cannot be pushed.

Karl's patch does the correct thing of raising an error if sinking
below an unapplied patch.

I implemented the hidden patches feature just to hide some patches I
no longer need (various tests or early prototypes of some patches) but
I still want to keep them around in case I have to look again.

Regarding the reordering of the unapplied patches, at the moment you
can (but I *don't* recommend) edit .git/patches/<branch>/unapplied.
Maybe the 'float' and 'sink' functionality could be modified to also
act on unapplied patches (with a --unapplied option). I don't think a
separate command would be needed as it duplicates a lot of
functionality from the above.

-- 
Catalin

```

## Karl Hasselström, 2007-09-15 23:52

Subject: Re: Stg AssertionError in sink command
Message-ID: <20070915235221.GE25507@diana.vm.bytemark.co.uk>
URL: https://gitlist.dev/e/20070915235221.GE25507%40diana.vm.bytemark.co.uk
In-Reply-To: <b0943d9e0709151537k51f2f8d5w5a9bbfef84f82747@mail.gmail.com>

```
On 2007-09-15 23:37:21 +0100, Catalin Marinas wrote:

> The initial implementation of hide/unhide was to preserve the patch
> position in the stack. This behaviour was really confusing for
> people since pushing a patch after the hidden one actually forced
> the pushing of the hidden patch, which isn't normally shown by
> 'series'. I decided afterwards to create a third category of patches
> - 'hidden' (the other two being applied and unapplied). This cleared
> the unpredictable behaviour when pushing since hidden patches cannot
> be pushed.

I agree that the new semantics is way saner (though I'm still not
entirely convinced that hiding patches is a good idea in the first
place). But the man pages should probably point out clearly that
hidden patches must be unapplied.

> Karl's patch does the correct thing of raising an error if sinking
> below an unapplied patch.
>
> Regarding the reordering of the unapplied patches, at the moment you
> can (but I *don't* recommend) edit .git/patches/<branch>/unapplied.
> Maybe the 'float' and 'sink' functionality could be modified to also
> act on unapplied patches (with a --unapplied option). I don't think
> a separate command would be needed as it duplicates a lot of
> functionality from the above.

Why the extra option? Just do the right thing, since it's unambiguous
what the right thing is.

-- 
Karl Hasselström, kha@treskal.com
      www.treskal.com/kalle

```
