git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
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: Wed, 18 Jul 2007 14:05:02 +0200	[thread overview]
Message-ID: <20070718120502.GZ999MdfPADPa@greensroom.kotnet.org> (raw)
In-Reply-To: <Pine.LNX.4.64.0707181153200.14781@racer.site>

On Wed, Jul 18, 2007 at 12:02:50PM +0100, Johannes Schindelin wrote:
> Hi,
> 
> On Mon, 16 Jul 2007, Sven Verdoolaege wrote:
> 
> > On Mon, Jul 16, 2007 at 01:38:11AM +0100, Johannes Schindelin wrote:
> > > On Sun, 15 Jul 2007, Sven Verdoolaege wrote:
> > > > TREECHANGE is only set when path pruning is in effect.
> > > > If I didn't check for path_pruning, then all commits would be
> > > > considered to have been pruned.  (Or am I missing something?
> > > > Honestly, I found all that TREECHANGE stuff difficult to follow.)
> > > 
> > > AFAICT TREECHANGE means that parents were rewritten.
> > 
> > I think you'll find that if all commits touch a path in the
> > path specifiers then all commits will have TREECHANGE set and
> > so no parents will be rewritten.
> 
> The code suggests otherwise.

Check again.

> But I really have to wonder: why do you play games with TREECHANGE?  I had 
> the impression that commit->parents is set appropriately by the revision 
> walker,

Only for unpruned commits and the references (explicitly specified
on the command line if you wish) may have been pruned.

> > > > revision.c itself is also riddled with "prune_fn && ".
> > > > Wouldn't it make sense to invert the meaning of this bit and call
> > > > it, say, PRUNED, so that the default is off and you would only
> > > > have to check if the bit was set ?
> > > 
> > > You meant the TREECHANGE bit?  No.
> > 
> > Yes.  Why?
> 
> Why invert the meaning of a perfectly fine bit?  Because you can?  It is 
> working right now, and it is not even a buglet, so what is there to fix?

Because it is confusing.  As explained above, the bit doesn't have a
meaning of its own.  You can only interpret the bit if some other
conditions are met.
It would be even more confusing if it meant what you claim it means.

> 
> > > BTW what do you plan to do about my objection to UNINTERESTING, given 
> > > the example "git rewrite-commits A..B x/y"?
> > 
> > That was based on an apparent misunderstanding of my code
> > that I tried to address above.  I did not intend to do what
> > you claim I do and a quick test confirms that my code does
> > indeed not to what you claim it does.
> > 
> > More specifically, the history will not be cut off at A
> > because A is marked UNINTERESTING and is therefore not considered
> > to have been pruned.
> 
> Why do you test for TREECHANGE | UNINTERESTING then?

Exactly for the reason mentioned above.
If the commit is marked UNINTERESTING then it has not been pruned,
because it hasn't even been checked for TREECHANGE.

> > A commit is considered pruned if it was either explicitly marked
> > as such or if TREECHANGE is not set, but the later check (in is_pruned)
> > is only done on commits that were checked for tree changes.
> 
> I don't understand.  What do you mean by "a commit is pruned"?  Does it 
> mean that this commit was left out from the revision walk?  What does that 
> have to do with TREECHANGE, which means that the parents set was modified?

You just claim that that is what it means.  The code (see try_to_simplify_commit
where the bit is set) and a simple experiment (explained above) show otherwise.

skimo

  reply	other threads:[~2007-07-18 12:05 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 [this message]
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

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=20070718120502.GZ999MdfPADPa@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.
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).