git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: "R. Tyler Ballance" <tyler@monkeypox.org>
To: Johannes Sixt <j.sixt@viscovery.net>
Cc: git@vger.kernel.org
Subject: Re: Rebasing with merges and conflict resolutions
Date: Fri, 26 Mar 2010 10:16:04 -0700	[thread overview]
Message-ID: <20100326171603.GA12592@kiwi.sharlinx.com> (raw)
In-Reply-To: <4BAC5C14.4060903@viscovery.net>

[-- Attachment #1: Type: text/plain, Size: 2669 bytes --]


On Fri, 26 Mar 2010, Johannes Sixt wrote:

> Please don't set Mail-Followup-To on this list.
> 
> Am 3/26/2010 4:11, schrieb R. Tyler Ballance:
> > Two contributors worked in tandem on a particular project, constantly merging
> > back and forth between each other creating a history of 118 commits total with
> > 37 of them being merge commits, 7 of those merge commits having conflict
> > resolutions involved.
> > 
> > I would /like/ to rebase those into a more linear revision history, but I
> > can't seem to find any set of commands that doesn't have me:
> >    a) Manually re-doing every conflict resolution and merge (git rebase -p master)
> >    b) Drastically diverging from the original topic branch and entering some
> >       sort of mergeless hell (git rebase master)
> 
> I'm afraid you can't avoid the merge conflict resolutions. But you can let
> you help by git-rerere. Look into the script rerere-train.sh that lets you
> prime your rerere database.
> 
> http://repo.or.cz/w/alt-git.git/blob_plain/master:/contrib/rerere-train.sh
> 
> > Is it even possible to straighten this out without a massive rework of these
> > commits?
> 
> I would sort the commits into topics and then repeatedly rebase -i the
> history involved onto the same commit, each time removing those commits
> that do not belong to the topic. That is, you get a forest of topics
> sprouting from the same commit. Finally, merge the topics back together.

The problem I'm having with this is that with a `git rebase -p -i master` I
can't even squash two related changes that are right next to each other
together because the rebase bails out earlier on conflicts while trying to
replay.

Perhaps I'm chosing the incorrect upstream?

> IOW, I wouldn't aim at a completely linear history, at least not at the
> first try.
> 
> > In the future, is there a better way for two developers to work in the same
> > back-and-forth fashion (code ping pong!) without leading to *heavily* merged
> > histories that are unpossible to untangle?
> 
> Discipline. Keep developers focused on their topic. Merge only after a
> topic is completed. Do not give in to "oh, *your* feature is cool, *I*
> want to have it now, so I merge it".

I think that's easier said than done, with backend work I'm able to clearly
define topics, whereas the front-end developers (as it is in this case)
typically overlap ever so slightly in their work

Cheers,
-R. Tyler Ballance
--------------------------------------
 Jabber: rtyler@jabber.org
 GitHub: http://github.com/rtyler
Twitter: http://twitter.com/agentdero
   Blog: http://unethicalblogger.com


[-- Attachment #2: Type: application/pgp-signature, Size: 198 bytes --]

  reply	other threads:[~2010-03-26 17:16 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-03-26  3:11 Rebasing with merges and conflict resolutions R. Tyler Ballance
2010-03-26  7:02 ` Johannes Sixt
2010-03-26 17:16   ` R. Tyler Ballance [this message]
2010-03-26 18:11     ` Jon Seymour
2010-03-26 17:36 ` Jon Seymour

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=20100326171603.GA12592@kiwi.sharlinx.com \
    --to=tyler@monkeypox.org \
    --cc=git@vger.kernel.org \
    --cc=j.sixt@viscovery.net \
    /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).