All of lore.kernel.org
 help / color / mirror / Atom feed
From: Avery Pennarun <apenwarr@gmail.com>
To: David Reitter <david.reitter@gmail.com>
Cc: git@vger.kernel.org, Christian MICHON <christian.michon@gmail.com>
Subject: Re: git-log - hide parent (was: merging two equivalent branches)
Date: Fri, 8 Jan 2010 14:50:03 -0500	[thread overview]
Message-ID: <32541b131001081150k3de53301tf6d206718d538a6@mail.gmail.com> (raw)
In-Reply-To: <DF05F91F-CBFD-458A-A99F-79E98ACA5146@gmail.com>

On Thu, Jan 7, 2010 at 4:16 PM, David Reitter <david.reitter@gmail.com> wrote:
> I'm still unsure how, after the filter-branch, I would have some ancestor from the
> B series so that future pulls from the remote work, while having an ancestor from
> A, to make sure I can continue merging into C.  If history is rewritten, I'll get new
> revisions and lose ancestors.
> I'm beginning to thing that the cutting and pasting I'd like is conceptually impossible.

Hmm, this is pretty nasty.  Essentially, you want your repo to include
both sets of commits (so that it doesn't try to re-merge in the other
commits later), but you don't want to *see* them in git log.
Basically, you want git log to lie to you :)

Luckily, it already has this ability: it's called history simplification :)

Try this in your merged repo:

   git log .

(note the '.').

Without the dot, git log doesn't simplify any history, and you get
every change.  With the dot, it shows only commits that had a tangible
effect on the file in question (in this case, the top directory, which
includes *everything*).  Thus, a "git merge -s ours" gets eliminated.

Beware that it might eliminate other equally non-impactful commits, however.

The same trick also works with gitk.

Have fun,

Avery

      parent reply	other threads:[~2010-01-08 19:50 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-01-07 18:17 merging two equivalent branches David Reitter
2010-01-07 18:22 ` Christian MICHON
2010-01-07 21:16   ` git-log - hide parent (was: merging two equivalent branches) David Reitter
2010-01-08  5:00     ` Christian Couder
2010-01-12 16:59       ` David Reitter
2010-01-08 19:50     ` Avery Pennarun [this message]

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=32541b131001081150k3de53301tf6d206718d538a6@mail.gmail.com \
    --to=apenwarr@gmail.com \
    --cc=christian.michon@gmail.com \
    --cc=david.reitter@gmail.com \
    --cc=git@vger.kernel.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.