Re: [PATCH] Add git-graft-ripple, a tool for permanently grafting history into a tree.
- From
- Ryan Anderson <ryan@michonline.com>
- Date
- Nov 23, 2005, 13:51 UTC
- Message-ID
- <20051123135150.GA16995@mythryan2.michonline.com>
- In-Reply-To
- <Pine.LNX.4.64.0511221652530.13959@g5.osdl.org>
On Tue, Nov 22, 2005 at 04:55:04PM -0800, Linus Torvalds wrote:
Show 18 quoted lines
> On Tue, 22 Nov 2005, Ryan Anderson wrote: > > > > Enhancements over the original example: > > > > o Each newly created commit A' references A, and (A^1)' (The first try > > referenced A^1 and (A^1)' but not A) > > > > o Support for incrementally rewriting history is present. > > How about the case of having commits that have pointers to other commits > in the comments? > > For example, on the kernel do > > gitk 19842d67340e4a8f616552d344e97fc7452aa37a > > and see how gitk highlights the SHA1's in the commit message and makes > hyperlinks to the commits they point to..
For some reason, my gut says that this goes too far. I'm having a hard time pinning down a way to explain that.
I guess something (untested) like this could do it, right before I call git_commit_tree():
my $found;
do {
$found = 0;
if ($csets{$old}{comments} =~ /\s([a-f0-9]{40})\s/ &&
exists $newcsets{$1}) {my $tcommit = $1;
$found = 1;
$csets{$old}{comments} =~ s/$tcommit/$newcsets{$tcommit}/g;
}
} while ($found);I'm not entirely convinced this is a good idea, but there it is.
I'll write up a patch later for this (probably switching to GetOpt in the process.)
-- Ryan Anderson sometimes Pug Majere