From: Sven Verdoolaege <skimo@kotnet.org>
To: Johannes Schindelin <Johannes.Schindelin@gmx.de>
Cc: git@vger.kernel.org, Junio C Hamano <gitster@pobox.com>
Subject: Re: [PATCH 6/6] Add git-rewrite-commits
Date: Thu, 19 Jul 2007 14:40:53 +0200 [thread overview]
Message-ID: <20070719124053.GC999MdfPADPa@greensroom.kotnet.org> (raw)
In-Reply-To: <Pine.LNX.4.64.0707181205260.14781@racer.site>
On Wed, Jul 18, 2007 at 12:17:03PM +0100, Johannes Schindelin wrote:
> Okay. For me it does not at all exclude that. If I want to replace a
> commit by no commit, I write a commit-filter which does not return
> anything. If I return more than one SHA1s, I damned well want all of
> those be the replacement "commit".
So how about you telling me what it _means_ for one commit to
be replaced by more than one commit or at least giving me an
example?
> > - if the parents of a commit have been rewritten to one or more
> > commits, then they are replaced by the new commits.
>
> Yes, that is the primary use for the mapping.
>
> > If any parent has been pruned, then it is replaced by
> > the result of applying this operation on _its_ parents.
>
> Why? This is overy complicated. If a commit has been pruned, why does
> the mapping not point to the _non-pruned_ parent?
It may not have any non-pruned parents and for the pruned ones, we
wouldn't want to lose the relation with the non-pruned ancestors.
> IOW if you have
> something like this:
>
> A - B - C - D - E - F
>
> and all commits except A and F are pruned, the mapping for A, B, C, D and
> E should _all_ point to the (possibly rewritten) A.
I'm not sure what you mean by "mapping" here, but the operation
described above would make all of B, C, D, E and F have (the
possibly rewritten) A as single parent (and parenthood was all
I was talking about above).
> > - a SHA1 of a commit that appears in a commit message is replaced
> > by the rewritten commit iff it was rewritten to a single commit.
> > That is, if the commit was pruned or rewritten (through a commit
> > filter to more than one commit), then the SHA1 is left alone.
>
> Both this behaviour and the one you described in your reply are wrong.
So tell me what you would do then and why that would make sense.
> > - the mapping available to filters
> > * if the commit was pruned, an empty file is created
> > * otherwise a file is created containing all rewritten SHA1s
>
> As I stated above: it is utterly wrong to create an empty mapping for a
> commit that was pruned. It does not take long to think of an example:
>
> A - B - C - D
>
> Now, A and D get pruned. Do you want the whole branch to vanish? _Hell,
> no_.
Define "vanish" and, again, tell me what you would do.
> You have to at least give the users a chance to grasp what they are doing.
> And if that means to change the semantics to something saner, then so be
> it.
Let's get things straight. I've added the map files and the possibility
for a commit filter to return more than one commit because you asked me to.
I've tried to make sense of it, but if you think the behavior I defined
is not what it is supposed to be, then it is up to _you_ to tell me what
you think it should be instead of letting me guess.
I think I'll just remove the possibility for the commit filter to
return more than one SHA1 (or maybe even no SHA1s).
filter-branch doesn't seem to allow either of those either.
skimo
prev parent reply other threads:[~2007-07-19 12:41 UTC|newest]
Thread overview: 23+ messages / expand[flat|nested] mbox.gz Atom feed top
2007-07-12 19:05 [PATCH 0/6] Add git-rewrite-commits v2 skimo
2007-07-12 19:05 ` [PATCH 1/6] revision: allow selection of commits that do not match a pattern skimo
2007-07-12 19:05 ` [PATCH 2/6] export get_short_sha1 skimo
2007-07-12 19:06 ` [PATCH 3/6] Define ishex(x) in git-compat-util.h skimo
2007-07-14 10:18 ` Johannes Schindelin
2007-07-12 19:06 ` [PATCH 4/6] refs.c: lock cached_refs during for_each_ref skimo
2007-07-12 19:06 ` [PATCH 5/6] revision: mark commits that didn't match a pattern for later use skimo
2007-07-12 19:06 ` [PATCH 6/6] Add git-rewrite-commits skimo
2007-07-13 8:01 ` Sven Verdoolaege
2007-07-14 12:49 ` Johannes Schindelin
2007-07-14 19:26 ` Junio C Hamano
2007-07-15 14:07 ` Sven Verdoolaege
2007-07-14 20:15 ` Sven Verdoolaege
2007-07-15 14:44 ` Sven Verdoolaege
2007-07-16 0:38 ` Johannes Schindelin
2007-07-16 10:24 ` Sven Verdoolaege
2007-07-18 11:02 ` Johannes Schindelin
2007-07-18 12:05 ` Sven Verdoolaege
2007-07-16 20:04 ` Sven Verdoolaege
2007-07-16 21:47 ` Sven Verdoolaege
2007-07-18 11:05 ` Johannes Schindelin
2007-07-18 11:17 ` Johannes Schindelin
2007-07-19 12:40 ` Sven Verdoolaege [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
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=20070719124053.GC999MdfPADPa@greensroom.kotnet.org \
--to=skimo@kotnet.org \
--cc=Johannes.Schindelin@gmx.de \
--cc=git@vger.kernel.org \
--cc=gitster@pobox.com \
--cc=skimo@liacs.nl \
/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).