From mboxrd@z Thu Jan 1 00:00:00 1970 From: Alex Sassmannshausen Subject: Re: Rollback problems Date: Thu, 24 Jan 2013 15:33:48 +0000 Message-ID: <87ip6mzjc3.fsf@gmail.com> References: <201301232148.46744.andreas@enge.fr>, <87mwvzsdzt.fsf@gnu.org>, <201301240017.55013.andreas@enge.fr>, <87mwvystku.fsf@gnu.org> Reply-To: alex.sassmannshausen@gmail.com Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit Return-path: Received: from eggs.gnu.org ([208.118.235.92]:44978) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1TyOoR-0008TD-Ge for bug-guix@gnu.org; Thu, 24 Jan 2013 10:34:05 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1TyOoL-00033Y-Cn for bug-guix@gnu.org; Thu, 24 Jan 2013 10:33:59 -0500 Received: from mail-wi0-f179.google.com ([209.85.212.179]:56685) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1TyOoL-00033R-4c for bug-guix@gnu.org; Thu, 24 Jan 2013 10:33:53 -0500 Received: by mail-wi0-f179.google.com with SMTP id o1so563785wic.6 for ; Thu, 24 Jan 2013 07:33:52 -0800 (PST) In-reply-to: <87mwvystku.fsf@gnu.org> List-Id: Bug reports for GNU Guix List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: bug-guix-bounces+gcggb-bug-guix=m.gmane.org@gnu.org Sender: bug-guix-bounces+gcggb-bug-guix=m.gmane.org@gnu.org To: bug-guix@gnu.org Hello, For what it's worth, my 2 cents on the issue: - I too think that rollback into an empty profile should be possible. The empty state seems like a valid state to be in for me. On the issue of rollbacks and branches, I like the simplicity of numbers. To try and understand Ludo's suggestion, would the following be right? >> I find the behaviour of roll back currently very confusing, and the >> situation looks reasonable to me: >> I install hello, it works, so I keep it. Generation 1, from Generation 0 >> I install freetype, Generation 2, from Generation 1 >> it does not work, so I drop it again. Generation 1, from Generation 2 >> I install file, Generation 3, from Generation 1 >> it does not work, so I drop it again. Generation 1, from Generation 3 Is rollback supposed to be one-directional? I.e. you can go back in time, but you can't then go forward in time again ('undo' and 'redo')? It makes sense for rollback, but it would be cool to be able to move forward again (conceptually — I don't know whether it would be useful in real life…). --switch-generation would allow one to move forward anyhow. And presumably we'd need some way to output descriptive state information between the different generations, to be able to switch between those effectively. Or at least the differences between a target generation and the current one. Numbers seem sensible as a means to navigate using switch, and as shorthand, but maybe, for completeness, the full identifier should be some form of combination of the 'descriptive number' and the 'forward' and 'backward' neighbours. Generations should not just remember how you got there, but also where you went after that. An example might be: Blank profile: generation 0 Install pdfwrit3r: generation 1 Actually that's pretty rubbish -> rollback: generation 0 Install pdfwriter: generation 2 No, this is even worse! -> Panic, rollback: generation 0 But we need *something* -> 'rollforward' should allow me to choose between generation 1 and generation 2, as both are direct 'neighbours' of 0. This functionality would be provided by --switch-generation anyway, but maybe this provides a concrete example of how a user might want to move back and forth. I don't know whether the above explodes the framework of what --rollback is intended for though, so it might not be helpful at all. Best wishes, Alex You might rollback to generation 1, but really that gener > Right, that seems like a real-world scenario, I admit. > > So I guess we can make that change. That will mean storing the ordered > list of previous generations in each generation’s manifest, and then > getting the previous generation number from there. > Ludovic Courtès writes: > Hello! > > Andreas Enge skribis: > >> Am Mittwoch, 23. Januar 2013 schrieb Ludovic Courtès: >>> And what if you roll back once you’re at the empty profile? >> >> Then nothing should happen. >> >>> It seems more intuitive for me to error out like this, because there was >>> really nothing but nothingness before “hello” was installed. :-) >>> WDYT? >> >> No, I disagree; when I have nothing, install hello and roll back, I should >> be back to nothing. Some other opinions would be useful on this matter. > > Hmm, OK. > > Well, that’s doable, so if you or others find it less confusing this > way, it’s probably worth doing it. > >>> This is expected (same behavior as nix-env.) Profile generations are >>> not deleted unless you explicitly do so; this is what guarantees that >>> one can roll back anywhere they want. >>> >>> But I wonder if this is really worth the trouble. In my experience, a >>> scenario like the one above rarely happens, if ever. >> >> I find the behaviour of roll back currently very confusing, and the >> situation looks reasonable to me: >> I install hello, it works, so I keep it. >> I install freetype, it does not work, so I drop it again. >> I install file, it does not work, so I drop it again. >> Now I expect to have only hello, but I have hello and freetype. > > Right, that seems like a real-world scenario, I admit. > > So I guess we can make that change. That will mean storing the ordered > list of previous generations in each generation’s manifest, and then > getting the previous generation number from there. > > I wonder if generations should be identified by a number at all, then. > > Thoughts? > > Thanks, > Ludo’.