All of lore.kernel.org
 help / color / mirror / Atom feed
From: Johannes Sixt <J.Sixt@eudaptics.com>
To: Johannes Schindelin <Johannes.Schindelin@gmx.de>
Cc: git@vger.kernel.org
Subject: Re: [PATCH] Add git-filter-branch
Date: Tue, 05 Jun 2007 09:01:44 +0200	[thread overview]
Message-ID: <46650A58.4934C07C@eudaptics.com> (raw)
In-Reply-To: Pine.LNX.4.64.0706041850350.4046@racer.site

Johannes Schindelin wrote:
> On Mon, 4 Jun 2007, Johannes Sixt wrote:
> > But this makes only sense if you have a linear history. Consider this
> > history, where you want to rewrite the commits that are only on branch
> > 'next':
> >
> > --A--B--C--D--E--F--G--H       <- master
> >    \  \  \  \  \  \  \  \
> >     X--o--o--o--o--o--o--o--o  <- next
> >
> > How would you go about with the current calling convention?
> 
> Are you actually sure that this scenario makes sense? When is the last
> time you wanted to filter a branch?

Oh, this makes a lot of sense. For example after I've imported a CVS
repository I had installed grafts for a number of merges that were made
in CVS (but we all know that CVS doesn't record them, so I did that
manually this way). That would be the merge commits in 'next' of the
example above. Now a simple

   git filter-branch -k master new-next

could "implant" the grafts into the commits. In this scenario I don't
need to rewrite 'master' because I know in advance that nothing would
actually be rewritten.

(Since 'master' was about 8000 commits I really didn't want to wait
until the no-ops would be completed, so I did it by actually fixing
cg-admin-rewritehist to not complain about the unmapped parents.)

> In any case, for such a degenerated test case I would rather try to limit
> filtering in the filter expression. Remember: you don't have to change
> _every_ commit.

I don't think that this is a degenerate case. See the example above.

Please observe that the only reasonable way to limit the commits to
rewrite is by giving some --not arguments to the rev-list. The filter
scriptlets themselves have no easy way to tell whether a commit should
be rewritten or not. They just rewrite - with the final result perhaps
ending up identical to the original; but no labor was saved.

-- Hannes

  reply	other threads:[~2007-06-05  7:00 UTC|newest]

Thread overview: 27+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2007-06-03  0:31 [PATCH] Add git-filter-branch Johannes Schindelin
2007-06-03  0:46 ` Jakub Narebski
2007-06-03  0:50   ` Johannes Schindelin
2007-06-03 10:28     ` Jakub Narebski
2007-06-03 18:36       ` Steven Grimm
2007-06-03 23:07       ` Johannes Schindelin
2007-06-05 10:18     ` Jonas Fonseca
2007-06-05 10:26       ` David Kastrup
2007-06-05 10:30       ` Junio C Hamano
2007-06-05 10:34         ` Jonas Fonseca
2007-06-05 13:55           ` Johannes Schindelin
2007-06-06 15:24           ` [PATCH] filter-branch: use $(($i+1)) instead of $((i+1)) Johannes Schindelin
2007-06-04  7:18 ` [PATCH] Add git-filter-branch Johannes Sixt
2007-06-04  7:59   ` Johannes Sixt
2007-06-04 16:11   ` Johannes Schindelin
2007-06-04 16:34     ` Johannes Sixt
2007-06-04 17:55       ` Johannes Schindelin
2007-06-05  7:01         ` Johannes Sixt [this message]
2007-06-05 15:58           ` Johannes Schindelin
2007-06-06  7:43             ` Johannes Sixt
2007-06-06  8:17               ` Junio C Hamano
2007-06-06 15:00               ` Johannes Schindelin
2007-06-06 15:22                 ` Johannes Sixt
2007-06-06 17:59                   ` Johannes Schindelin
2007-06-06 15:36             ` [PATCH] filter-branch: also don't fail in map() if a commit cannot be mapped Johannes Sixt
2007-06-06 17:50               ` Johannes Schindelin
2007-06-06 18:38                 ` [PATCH v2] " Johannes Sixt

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=46650A58.4934C07C@eudaptics.com \
    --to=j.sixt@eudaptics.com \
    --cc=Johannes.Schindelin@gmx.de \
    --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.