git@vger.kernel.org mailing list mirror (one of many)
 help / color / mirror / code / Atom feed
From: "Catalin Marinas" <catalin.marinas@gmail.com>
To: "Pavel Roskin" <proski@gnu.org>
Cc: git@vger.kernel.org, "Yann Dirson" <ydirson@altern.org>
Subject: Re: StGIT discards local commits on "stg pull"
Date: Mon, 12 Feb 2007 09:31:28 +0000	[thread overview]
Message-ID: <b0943d9e0702120131r528fb29ete143b8ce5a0a99e9@mail.gmail.com> (raw)
In-Reply-To: <20070212022625.rvyyo0kc0wowgogc@webmail.spamcop.net>

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" but we should've probably leave the
original behaviour as the default. Maybe we should also have this
per-branch rather than per-repository.

In StGIT 0.12, git-fetch is used by default rather than git-pull and
StGIT performs the rebasing. We had some discussions on whether this
would break existing workflows and we thought it wouldn't (I don't
usually mix git-commit with stg commands).

The solution would be to define the following in your gitconfig file
(either ~/.gitconfig or .git/config; a full example in StGIT's
examples/gitconfig):

[stgit]
	pullcmd = git-pull
	pull-does-rebase = no

The last line would tell StGIT not to do the rebasing and let git-pull
handle it.

I agree that for the rebasing case, we should have some warning if
fast-forwarding of the stack's base is not possible so that you could
run 'stg uncommit'.

-- 
Catalin

  reply	other threads:[~2007-02-12  9:31 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 [this message]
2007-02-12 20:26   ` Yann Dirson
2007-02-12 21:47     ` Yann Dirson
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

  List information: http://vger.kernel.org/majordomo-info.html

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

  git send-email \
    --in-reply-to=b0943d9e0702120131r528fb29ete143b8ce5a0a99e9@mail.gmail.com \
    --to=catalin.marinas@gmail.com \
    --cc=git@vger.kernel.org \
    --cc=proski@gnu.org \
    --cc=ydirson@altern.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.
Code repositories for project(s) associated with this public inbox

	https://80x24.org/mirrors/git.git

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 read-only IMAP folder(s) and NNTP newsgroup(s).