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

Re: RFC: grafts generalised

From
Jakub Narebski <jnareb@gmail.com>
Date
Jul 2, 2008, 16:35 UTC
Message-ID
<m3lk0kfdo1.fsf@localhost.localdomain>
In-Reply-To
<20080702143519.GA8391@cuci.nl>
"Stephen R. van den Berg" <srb@cuci.nl> writes:
Show 20 quoted lines
> I'm in the process of converting and stitching and patching vast amounts
> of initially disjunct CVS and SVN repositories into larger complete
> histories inside a single git repository.  Recreating history as
> accurately as possible.
> 
> The problem I encounter is that any number of times I have to "edit"
> history in a non-parameterable fashion, in any of the following ways:
> - Change parents.
> - Add merges.
> - Change author, committer, commitdate, authordate.
> - Change the tree (because of conversion errors in the automated
>   conversion process) belonging to a single commit.
> - Retrofit a patch which has to ripple through all of history until
>   the present.
> 
> The only things which are easily done at the moment are:
> Change parents and add merges.  This can be accomplished fairly easily
> using the grafts file.
> The other changes are messy at best and need to be parameterised into the
> form of a shell script so that git filter-branch can have a go at it.
[...]
Show 18 quoted lines
> I propose the following:
> - Extend git fsck to do more sanity checks on the content of the grafts
>   file (to make it more difficult to shoot yourself in the foot with
>   that file; my feet will be grateful).
> - Extend the grafts file format to support something like the following syntax:
> 
> commit eb03813cdb999f25628784bb4f07b3f4c8bfe3f6
> Parent: 7bc72e647d54c2f713160b22e2e08c39d86c7c28
> Merge: 3b3da24960a82a479b9ad64affab50226df02abe 13b8f53e8ccec3b08eeb6515e6a10a2a
> Merge: ac719ed37270558f21d89676fce97eab4469b0f1
> Tree: 32fc99814b97322174dbe97ec320cf32314959e2
> Author: Foo Bar (FooBar) <foo@bar>
> AuthorDate: Sat Jun 6 13:50:44 1998 +0000
> Commit: Foo Bar (FooBar) <foo@bar>
> CommitDate: Sat Jun 7 13:50:44 1998 +0000
> Logmessage: First line of logmessage override
> Logmessage: Second line of logmessage override
> Logmessage: Etc.
[...]

First, if I remember correctly (from KernelTrap and now defunct Kernel Traffic and one issue of Git Traffic) the 'graft' mechanizm was created so it would be possible to "graft" (join) historical conversion repository with the "current work" git repository (started from zero when git was deemed good enough for Linux kernel development). The same mechanism is used for shallow clone, where one goes in the opposite direction, shortening history instead of joining two repositories (two histories).

The fact that git-filter-branch (and earlier cg-admin-rewrite-hist) respects grafts, and rewrites history so that grafts are no-op and are not needed further is a bit of side-effect. So I think that it would be better to provide generic git-filter-branch filter which can understand this "generalized grafts" file format, or rather 'description of changes' file. Put it in contrib/, and here you go...

-- 
Jakub Narebski
Poland
ShadeHawk on #git
Previous: Stephen R. van den BergNext: Michael J Gruber
Message 2 of 36 in “RFC: grafts generalised”
  1. Stephen R. van den BergJul 2, 2008
  2. Jakub NarebskiJul 2, 2008
  3. Michael J GruberJul 2, 2008
  4. Stephen R. van den BergJul 2, 2008
  5. Mike HommeyJul 2, 2008
  6. Michael J GruberJul 2, 2008
  7. Stephen R. van den BergJul 2, 2008
  8. Stephan BeyerJul 2, 2008
  9. Stephan BeyerJul 2, 2008
  10. Dmitry PotapovJul 2, 2008
  11. Stephan BeyerJul 2, 2008
  12. Stephen R. van den BergJul 3, 2008
  13. Andreas EricssonJul 7, 2008
  14. Stephen R. van den BergJul 7, 2008
  15. Stephen R. van den BergJul 2, 2008
  16. Petr BaudisJul 3, 2008
  17. Stephen R. van den BergJul 3, 2008
  18. Jakub NarebskiJul 4, 2008
  19. Dmitry PotapovJul 2, 2008
  20. Dmitry PotapovJul 2, 2008
  21. Stephen R. van den BergJul 2, 2008
  22. Dmitry PotapovJul 2, 2008
  23. Dmitry PotapovJul 2, 2008
  24. Stephen R. van den BergJul 2, 2008
  25. Avery PennarunJul 2, 2008
  26. Junio C HamanoJul 2, 2008
  27. Junio C HamanoJul 2, 2008
  28. Junio C HamanoJul 3, 2008
  29. Johannes SixtJul 3, 2008
  30. Stephen R. van den BergJul 3, 2008
  31. Johannes SixtJul 3, 2008
  32. Stephen R. van den BergJul 3, 2008
  33. Stephen R. van den BergJul 2, 2008
  34. Petr BaudisJul 3, 2008
  35. Petr BaudisJul 3, 2008
  36. Junio C HamanoJul 3, 2008

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.