Git development
 help / color / mirror / Atom feed
From: Junio C Hamano <gitster@pobox.com>
To: Linus Torvalds <torvalds@linux-foundation.org>
Cc: Johannes Sixt <johannes.sixt@telecom.at>,
	git@vger.kernel.org,
	Johannes Schindelin <Johannes.Schindelin@gmx.de>
Subject: Re: [PATCH 2/2] filter-branch: subdirectory filter needs --full-history
Date: Tue, 12 Jun 2007 23:58:53 -0700	[thread overview]
Message-ID: <7vps40fihe.fsf@assigned-by-dhcp.pobox.com> (raw)
In-Reply-To: <alpine.LFD.0.98.0706081822500.4205@woody.linux-foundation.org> (Linus Torvalds's message of "Fri, 8 Jun 2007 19:40:46 -0700 (PDT)")

Linus Torvalds <torvalds@linux-foundation.org> writes:

> ... There was no actual developmet on branch 
> "another", so all the commits went away, but it left the merge (because 
> that's how --full-history works), which has now become pointless.
>
> So you should do a "merge cleanup" phase after running --full-history.

In short, you will end up with something like this:

             .---. (side branch)
            /     \
	---A---B---C (merge)

The "merge clean-up" would conceptually be a simple operation.
Whenever you see a merge C, you look at its parents A and B, and
cull the ones that are reachable from other parents.  You notice
that A is an ancestor of B, drop A from the parents of C, and
simplify the above down to:

	---A---B---C (not-a-merge)

However, I suspect that this is impossible without making
--full-history with "merge clean-up" imply "limited".

In the case of filter-branch, it needs to use topo-order in
order to guarantee that all its parents commits have been
rewritten before rewriting a commit, so the traversal is already
limited.  

It might be simpler for filter-branch to remove parents that are
ancestor of other parents ("git show-branch --independent" would
work well for this, I think), before feeding the list of mapped
parents to the parent-filter.

      reply	other threads:[~2007-06-13  6:58 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2007-06-08 21:28 [PATCH 2/2] filter-branch: subdirectory filter needs --full-history Johannes Sixt
2007-06-09  2:40 ` Linus Torvalds
2007-06-13  6:58   ` Junio C Hamano [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=7vps40fihe.fsf@assigned-by-dhcp.pobox.com \
    --to=gitster@pobox.com \
    --cc=Johannes.Schindelin@gmx.de \
    --cc=git@vger.kernel.org \
    --cc=johannes.sixt@telecom.at \
    --cc=torvalds@linux-foundation.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox