git/list[1] front-page[2] threads[3] people[4] search[5] about
 

Re: [PATCH] Add git-graft-ripple, a tool for permanently grafting history into a tree.

From
RARyan 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
Previous: Andreas EricssonNext: Randal L. Schwartz
Message 4 of 7 in “Add git-graft-ripple, a tool for permanently grafting history into a tree.”
  1. Add git-graft-ripple, a tool for permanently grafting history into a tree.Ryan Anderson, Nov 22, 2005
  2. Linus TorvaldsNov 23, 2005
  3. Andreas EricssonNov 23, 2005
  4. Ryan AndersonNov 23, 2005
  5. Randal L. SchwartzNov 23, 2005
  6. Johannes SchindelinNov 23, 2005
  7. Linus TorvaldsNov 23, 2005

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.