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: "David Kågedal" <davidk@lysator.liu.se>, git@vger.kernel.org
Subject: Re: [StGit PATCH 09/13] Clear up the semantics of Series.new_patch
Date: Tue, 9 Oct 2007 22:01:44 +0100	[thread overview]
Message-ID: <b0943d9e0710091401s280b3a12md9e700fb3ae007bf@mail.gmail.com> (raw)
In-Reply-To: <20071008132524.GA11253@diana.vm.bytemark.co.uk>

On 08/10/2007, Karl Hasselström <kha@treskal.com> wrote:
> On 2007-10-08 14:16:10 +0100, Catalin Marinas wrote:
>
> > On 14/09/2007, David Kågedal <davidk@lysator.liu.se> wrote:
> >
> > > +        assert commit or (top and bottom)
> > > +        assert not before_existing or (top and bottom)
> > > +        assert not (commit and before_existing)
> > > +        assert (top and bottom) or (not top and not bottom)
> > > +        assert not top or (bottom == git.get_commit(top).get_parent())
> >
> > The last assertion here prevents the use of 'stg pick --reverse'.
> > This command creates an unapplied patch with top and bottom reversed
> > and pushes it to force a three-way merge.
> >
> > It seems to work OK if I comment it out but I wonder whether it will
> > break in the future with the planned removal of the top and bottom
> > files.
>
> I think the assert represents a real constraint, namely that there has
> to be a 1:1 correspondance between patches and commits.
>
> Couldn't "stg pick --reverse" create a new commit and use that? That
> is, given that we want to revert commit C, create a new commit C* with

Series.new_patch already creates a commit, why should we move the
functionality to 'pick'? The only call to new_patch with commit=False
seems to be from 'uncommit' (and it makes sense indeed).

> And shouldn't there be a test for this? :-)

Yes :-). I think there are many other tests needed. It would be useful
to do a code coverage with the existing tests to see what we are
missing. Unit testing might be useful as well but we all have limited
spare time.

-- 
Catalin

  reply	other threads:[~2007-10-09 21:01 UTC|newest]

Thread overview: 30+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2007-09-14 22:31 [StGit PATCH 00/13] Eliminate 'top' and 'bottom' files David Kågedal
2007-09-14 22:31 ` [StGit PATCH 01/13] Add some more tests of "stg status" output David Kågedal
2007-09-14 22:31 ` [StGit PATCH 02/13] Clear up semantics of tree_status David Kågedal
2007-09-14 22:31 ` [StGit PATCH 03/13] Moved that status function to the status command file David Kågedal
2007-09-14 22:36   ` David Kågedal
2007-09-14 22:31 ` [StGit PATCH 04/13] Split Series.push_patch in two David Kågedal
2007-09-14 22:31 ` [StGit PATCH 05/13] Remove dead code from push_empty_patch David Kågedal
2007-09-14 22:31 ` [StGit PATCH 06/13] Refactor Series.push_patch David Kågedal
2007-09-14 22:31 ` [StGit PATCH 07/13] Clean up Series.refresh_patch David Kågedal
2007-09-14 22:31 ` [StGit PATCH 08/13] Add a 'bottom' parameter to Series.refresh_patch and use it David Kågedal
2007-09-14 22:31 ` [StGit PATCH 09/13] Clear up the semantics of Series.new_patch David Kågedal
2007-10-08 13:16   ` Catalin Marinas
2007-10-08 13:25     ` Karl Hasselström
2007-10-09 21:01       ` Catalin Marinas [this message]
2007-10-10  7:43         ` David Kågedal
2007-10-11 20:42           ` Catalin Marinas
2007-10-10  7:45         ` Karl Hasselström
2007-10-10  8:15           ` Karl Hasselström
2007-09-14 22:32 ` [StGit PATCH 10/13] Refactor Series.new_patch David Kågedal
2007-09-14 22:32 ` [StGit PATCH 11/13] Check bottom and invariants David Kågedal
2007-09-14 22:32 ` [StGit PATCH 12/13] Remove the 'bottom' field David Kågedal
2007-09-14 22:32 ` [StGit PATCH 13/13] Remove the 'top' field David Kågedal
2007-09-15 23:36   ` Karl Hasselström
2007-09-16 10:22     ` David Kågedal
2007-09-17  7:30       ` Karl Hasselström
2007-09-15 23:42 ` [StGit PATCH 00/13] Eliminate 'top' and 'bottom' files Karl Hasselström
2007-09-16  7:28   ` Catalin Marinas
2007-09-16 10:28     ` David Kågedal
2007-09-17  8:17     ` Karl Hasselström
2007-09-16 10:25   ` David Kågedal

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=b0943d9e0710091401s280b3a12md9e700fb3ae007bf@mail.gmail.com \
    --to=catalin.marinas@gmail.com \
    --cc=davidk@lysator.liu.se \
    --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).