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

Re: gitweb wishlist

From
Linus Torvalds <torvalds@osdl.org>
Date
May 21, 2005, 00:50 UTC
Message-ID
<Pine.LNX.4.58.0505201702170.2206@ppc970.osdl.org>
In-Reply-To
<428E745C.30304@zytor.com>
[ Thomas added to cc, since he seems to have also worked on this ]
On Fri, 20 May 2005, H. Peter Anvin wrote:
> 
> Here is my "main" OSS CVS repository; look at the syslinux module.  It 
> has at least some minor branching.
Ok, "cvsps" output scares me. I wonder what
	WARNING: Invalid PatchSet 775, Tag syslinux-2_12-pre7:
	    memdisk/init32.asm:1.3=after, memdisk/Makefile:1.26=before. Treated as 'before'
	WARNING: Invalid PatchSet 775, Tag syslinux-2_12-pre7:
	    memdisk/init32.asm:1.3=after, memdisk/e820test.c:1.7=before. Treated as 'before'
	...
means..
Also, your syslinux repo is interesting and shows another thing: doing a
	cvsps -g -p separate
ends badly with
	Directing PatchSet 938 to file separate/938.patch
	cvs rdiff: failed to read diff file header /tmp/cvso8PswZ for mdiskchk.com,v: end of file
	system command returned non-zero exit status: 1: aborting

which doesn't look very promising and causes an empty diff for mdiskck.com. Trying with --cvs-direct shows the reason:

	Index: syslinux/sample/mdiskchk.com
	===================================================================
	RCS file: 
	/home/torvalds/src/osscvs/cvsroot/syslinux/sample/mdiskchk.com,v
	retrieving revision 1.1
	retrieving revision 1.2
	diff -u -r1.1 -r1.2
	Binary files /tmp/cvsU6MGU0 and /tmp/cvsiskFVR differ

which shows that anything that bases itself of diffs (ie uses "-g" with cvsps) is just doomed to failure, since there's no good way to handle binary data. Both Kay's and Thomas' scripts try to do the "-g" thing, that's just not right.

So the cvs->git thing would need to be based on the actual objects, which obviously fits git quite well, but I was really hoping to have cvsps give some nice intermediate format..

So it looks like we should avoid the diff format, and instead use
	cvsps -p separate

and then just parse the "Members" thing and turning each of them either into a "delete" (for ->.*DEAD) or "cvs checkout -rxxx" (for ".*->xxx").

Handling branches by literally treating them as different heads in git sounds quite simple, and indeed it looks like the basic logic for cvs->git translation would be

	for-each-patch-from-cvsps
	do
		git-read-tree -m branchname-from-patch
		git-update-cache -f -u -q -a
		for-each-member-in-patch
		do
			if [ DEAD ]; then
				rm member
				git-update-cache --remove member
			else
				cvs co -rREV member
				git-update-cache --add member
			fi
			cat commit-message-from-patch | 
				git-commit-tree $(git-write-tree) -p branchname-from-patch > .git/revs/heads/branchname-from-patch
		done
	done
which looks like it should work, and handle binary files right.
There seems to be two questions:
 - what to do about branch creation (ie a branch name we haven't seen
   before): it looks like cvsps doesn't tell you what the _originating_
   branch was for a new branch (that may be my confusion - maybe you can't
   create branches off branches in CVS?)
   For syslinux, it looks like you can always base it on HEAD, or possibly 
   just the previous patch (which looks like it is always HEAD). The above 
   pseudo-script will actually do that automatically, simply by virtue of
   the "git-read-tree -m" at the top of the loop failing when the
   branchname doesn't exist yet.
 - whether to bother to create merge entries for when somebody tried to 
   merge a branch back or forth in CVS. 
   CVS fundamentally doesn't have the notion of such a thing, and cvsps 
   can't either. But we could try to guess, based on the commit message, 
   perhaps.
   NOTE! Such a "merge" would not have any real GIT merge functionality 
   what-so-ever. It would just introduce a second parent into the commit, 
   nothing more.
Bah. What crud.
		Linus
Previous: Kay SieversNext: Matthias Urlichs
Message 38 of 102 in “gitweb wishlist”
  1. Petr BaudisMay 11, 2005
  2. YOSHIFUJI Hideaki / 吉藤英明May 11, 2005
  3. Petr BaudisMay 11, 2005
  4. Kay SieversMay 11, 2005
  5. Jan-Benedict GlawMay 11, 2005
  6. Kay SieversMay 14, 2005
  7. Junio C HamanoMay 12, 2005
  8. Kay SieversMay 12, 2005
  9. Junio C HamanoMay 12, 2005
  10. Junio C HamanoJun 4, 2005
  11. Jonas FonsecaMay 13, 2005
  12. Kay SieversMay 14, 2005
  13. Kay SieversMay 14, 2005
  14. Jonas FonsecaMay 14, 2005
  15. Kay SieversMay 18, 2005
  16. Petr BaudisMay 18, 2005
  17. Linus TorvaldsMay 20, 2005
  18. Junio C HamanoMay 20, 2005
  19. Linus TorvaldsMay 20, 2005
  20. Kay SieversMay 20, 2005
  21. Linus TorvaldsMay 20, 2005
  22. Linus TorvaldsMay 20, 2005
  23. Kay SieversMay 20, 2005
  24. Thomas GlanzmannMay 20, 2005
  25. Linus TorvaldsMay 20, 2005
  26. Linus TorvaldsMay 20, 2005
  27. H. Peter AnvinMay 20, 2005
  28. Linus TorvaldsMay 20, 2005
  29. H. Peter AnvinMay 20, 2005
  30. Thomas GlanzmannMay 20, 2005
  31. Kay SieversMay 20, 2005
  32. H. Peter AnvinMay 20, 2005
  33. Linus TorvaldsMay 20, 2005
  34. Kay SieversMay 20, 2005
  35. Kay SieversMay 20, 2005
  36. Matthias UrlichsMay 21, 2005
  37. Kay SieversMay 21, 2005
  38. Linus TorvaldsMay 21, 2005
  39. cvs->git (was Re: gitweb wishlist)Matthias Urlichs, May 21, 2005
  40. David MansfieldMay 24, 2005
  41. H. Peter AnvinMay 24, 2005
  42. David MansfieldMay 24, 2005
  43. H. Peter AnvinMay 24, 2005
  44. Linus TorvaldsMay 24, 2005
  45. Linus TorvaldsMay 24, 2005
  46. Linus TorvaldsMay 24, 2005
  47. Linus TorvaldsMay 24, 2005
  48. David MansfieldMay 24, 2005
  49. David MansfieldMay 24, 2005
  50. David MansfieldMay 24, 2005
  51. David MansfieldMay 24, 2005
  52. Linus TorvaldsMay 24, 2005
  53. H. Peter AnvinMay 24, 2005
  54. David MansfieldMay 24, 2005
  55. Thomas GlanzmannMay 24, 2005
  56. Linus TorvaldsMay 24, 2005
  57. Linus TorvaldsMay 24, 2005
  58. Linus TorvaldsMay 24, 2005
  59. Thomas GlanzmannMay 24, 2005
  60. Linus TorvaldsMay 24, 2005
  61. Edgar ToernigMay 24, 2005
  62. Linus TorvaldsMay 24, 2005
  63. Junio C HamanoMay 25, 2005
  64. Linus TorvaldsMay 25, 2005
  65. Junio C HamanoMay 25, 2005
  66. David MansfieldMay 24, 2005
  67. Thomas GlanzmannMay 24, 2005
  68. Linus TorvaldsMay 24, 2005
  69. Linus TorvaldsMay 24, 2005
  70. David MansfieldMay 24, 2005
  71. Linus TorvaldsMay 24, 2005
  72. Thomas GlanzmannMay 24, 2005
  73. Linus TorvaldsMay 24, 2005
  74. Thomas GlanzmannMay 24, 2005
  75. Linus TorvaldsMay 24, 2005
  76. David MansfieldMay 24, 2005
  77. Linus TorvaldsMay 24, 2005
  78. H. Peter AnvinMay 24, 2005
  79. Thomas GlanzmannMay 24, 2005
  80. Thomas GlanzmannMay 24, 2005
  81. Kay SieversMay 24, 2005
  82. Linus TorvaldsMay 24, 2005
  83. Junio C HamanoMay 25, 2005
  84. Linus TorvaldsMay 25, 2005
  85. Junio C HamanoMay 25, 2005
  86. Kay SieversMay 25, 2005
  87. David GreavesMay 25, 2005
  88. Junio C HamanoMay 25, 2005
  89. David GreavesMay 25, 2005
  90. Kay SieversMay 25, 2005
  91. Kay SieversMay 25, 2005
  92. Junio C HamanoMay 25, 2005
  93. Junio C HamanoMay 25, 2005
  94. Linus TorvaldsMay 24, 2005
  95. Thomas GlanzmannMay 24, 2005
  96. Linus TorvaldsMay 24, 2005
  97. Thomas GlanzmannMay 24, 2005
  98. Junio C HamanoMay 24, 2005
  99. Junio C HamanoMay 24, 2005
  100. Martin LanghoffMay 24, 2005
  101. Thomas GlanzmannMay 24, 2005
  102. David MansfieldMay 26, 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.