All of lore.kernel.org
 help / color / mirror / Atom feed
From: Yann Dirson <ydirson@altern.org>
To: Pavel Roskin <proski@gnu.org>
Cc: git@vger.kernel.org, Catalin Marinas <catalin.marinas@gmail.com>
Subject: Re: StGIT discards local commits on "stg pull"
Date: Mon, 12 Feb 2007 22:47:04 +0100	[thread overview]
Message-ID: <20070212214704.GS5362@nan92-1-81-57-214-146.fbx.proxad.net> (raw)
In-Reply-To: <20070212202634.GX4266@nan92-1-81-57-214-146.fbx.proxad.net>

On Mon, Feb 12, 2007 at 09:26:34PM +0100, Yann Dirson wrote:
> On Mon, Feb 12, 2007 at 09:31:28AM +0000, Catalin Marinas wrote:
> > On 12/02/07, Pavel Roskin <proski@gnu.org> wrote:
> > >I have been bitten by a strange bug/feature of StGIT, and it looks like
> > >it's not only counterintuitive, but also inconsistent with git.
> > >
> > >I have a repository available over ssh and I push to it from several
> > >places. Sometimes I make a commit and forget to push it.  Then I run "stg
> > >pull" to make sure my repository is up to date.
> > >
> > >The result is that the repository is rebased back to the last remote
> > >commit. It's very easy to miss.  There is no warning.  Everything looks
> > >just like an update from the remote.
> > >
> > >The example below shows that git-pull keeps my commit, but "stg pull"
> > >discards it by rebasing back to the remote ID.
> > 
> > I think this is a "feature"
> 
> No, I agree it's a bug.  Rebasing after a fetch should allow this
> workflow to work as well.  If the parent branch is not a rewinding
> one, we should ensure there is nothing lost.  And even for rewinding
> branches, we should probably keep track of the existence of commits,
> so we can warn and nothing gets lost without knowing.

Thinking about it, detecting whether we're going to lose a commit is
just checking *before pulling* whether the current base is reachable
from the parent's current head.

In git-fetch-based workflows, proceeding further should be simply
refused.  I'm not sure about the git-pull-based workflows; here is at
least one problem with git-pull I can think of:

AFAICT, someone using git-pull would in this case get a merge commit,
so under 0.11 (or with the compat settings outlined by Catalin) you
should now have your stack based on a merge commit, with as parents
the new parent-branch head and the commits you did not push yet, right ?
So how did you proceed from there using 0.11 ?

I'd think you still want to push your patch into the parent repo, but
the situtation is cumbersome: it would have been far easier IMHO to
"stg pull" first, in which case the fetch-and-rebase model is what you
wanted, and then do a "stg commit && git push".

That makes me think that indeed we should have an stgit command doing
precisely this "stg commit && git push" (suggested in previous mail)
as an atomic operation, rolling back the commit if the push failed
because you were out of date.


Since that looks like a pathological case, I suppose this may not be
what you were trying to do.  Can you please give more information if
that is the case ?

Best regards,
-- 
Yann.

  reply	other threads:[~2007-02-12 21:48 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2007-02-12  7:26 StGIT discards local commits on "stg pull" Pavel Roskin
2007-02-12  9:31 ` Catalin Marinas
2007-02-12 20:26   ` Yann Dirson
2007-02-12 21:47     ` Yann Dirson [this message]
2007-02-19 23:07       ` Catalin Marinas
2007-02-19 23:28         ` Pavel Roskin
2007-02-20  0:00           ` Yann Dirson
2007-02-20 18:55             ` Yann Dirson
2007-02-19 23:44         ` Yann Dirson
2007-02-13  0:20   ` Pavel Roskin
2007-02-13 22:48     ` Catalin Marinas
2007-02-19 20:47       ` Yann Dirson

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=20070212214704.GS5362@nan92-1-81-57-214-146.fbx.proxad.net \
    --to=ydirson@altern.org \
    --cc=catalin.marinas@gmail.com \
    --cc=git@vger.kernel.org \
    --cc=proski@gnu.org \
    /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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.