git@vger.kernel.org mailing list mirror (one of many)
 help / color / mirror / code / Atom feed
From: Sergey Organov <sorganov@gmail.com>
To: Theodore Ts'o <tytso@mit.edu>
Cc: git@vger.kernel.org
Subject: Re: git rebase: yet another newbie quest.
Date: Mon, 08 Sep 2014 17:52:44 +0400	[thread overview]
Message-ID: <87sik28bir.fsf@osv.gnss.ru> (raw)
In-Reply-To: <20140905154159.GB1510@thunk.org> (Theodore Ts'o's message of "Fri, 5 Sep 2014 11:41:59 -0400")

Theodore Ts'o <tytso@mit.edu> writes:
> I'm not going to say what you *should* have done, since it's not clear
> whether anything close to what you were doing is a supported workflow.
> But I can tell you what I *do* myself.  Personally, I vastly distrust
> git pull --rebase.

Thank you for sharing your experience!

In the particular case at hand though, "git rebase" is the actual cause
of the problem, not "git pull --rebase".

> So in general, my pulls are all the equivalent of "git pull
> --ff-only", and if I want to rebase the topic branch (which in
> general, is a bad idea to do regularly; I will generally not do it at
> all until I'm almost done).  So I'll branch the topic branch off of
> origin (which tracks origin/master, typically):
>
> git checkout -b topic1 origin
> <hack hack hack>
> git commit
>
>   ...
> <make>
>
> In general, I will only rebase a topic branch when it's needed to fix
> a serious conflcit caused by significant changes upstream.  And in
> that case, I might do something like this:
>
> git checkout topic1
> git rebase origin/master
> <make>
> <make check>

Yeah, it's a good way to do things, but for most of quick fixes I'm lazy
to create topic branch, and in this case it lead to a nasty unexpected
trouble.

I didn't intend to make topic branch from the very beginning, and
already made a commit or two on the remote tracking branch bofore I
realized I'd better use topic branch. It'd create no problem as far as I
can see, provided vanilla "git rebase" has "sane" defaults. That said,
I've already been once pointed to by Junio that my definition of "sane"
doesn't take into account workflows of others, so now I try to be
carefull calling vanilla "git rebase" names.

Please also notice that I didn't pull immediately after I've re-arranged
my branches, and this fact only made it more difficult to find and
isolate the problem.

[...]

> P.S.  There is a separate, and completely valid discussion which is
> how to prevent a newbie from falling into a same trap you did.  I'll
> defer that discussion to others...

Yeah, it'd be fine if at least documentation is fixed.

-- 
Sergey.

  reply	other threads:[~2014-09-08 13:53 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-09-05 10:28 git rebase: yet another newbie quest Sergey Organov
2014-09-05 15:41 ` Theodore Ts'o
2014-09-08 13:52   ` Sergey Organov [this message]
2014-09-08 14:07     ` Theodore Ts'o
2014-09-08 15:47       ` Sergey Organov
2014-09-08 17:32         ` Theodore Ts'o
2014-09-08 19:49           ` Sergey Organov
2014-09-05 22:13 ` John Keeping
2014-09-08 13:51   ` Sergey Organov

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=87sik28bir.fsf@osv.gnss.ru \
    --to=sorganov@gmail.com \
    --cc=git@vger.kernel.org \
    --cc=tytso@mit.edu \
    /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).