git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] Ignore commits for which cvsps can't identify a branch
@ 2006-02-10 21:02 Christian Biesinger
  2006-02-10 21:21 ` Junio C Hamano
  2006-06-10 19:24 ` Yann Dirson
  0 siblings, 2 replies; 6+ messages in thread
From: Christian Biesinger @ 2006-02-10 21:02 UTC (permalink / raw)


cvps sometimes can't identify a branch for a specific revision, it shows
messages like:
  WARNING: revision 1.36.2.2 of file Makefile.in on unnamed branch
and uses #CVSPS_NO_BRANCH as branch name in its output.

This checkin makes it so that git-cvsimport ignores such branches, and when they
appear as ancestor branch, it maps them to HEAD.

Signed-off-by: Christian Biesinger <cbiesinger@web.de>

---

I tried to import the Mozilla CVS Repository into git, just for fun, and it
failed. This is one of the patches that are required for it.

I hope I did this right, I'm not so familiar with git...
Documentation/SubmittingPatches says to mail patches to the maintainer, who is
that? :)

 git-cvsimport.perl |   11 +++++++++++
 1 files changed, 11 insertions(+), 0 deletions(-)

ed142593c84ba76580e780ce8f12244214023213
diff --git a/git-cvsimport.perl b/git-cvsimport.perl
index 00fc3ba..4b8ca95 100755
--- a/git-cvsimport.perl
+++ b/git-cvsimport.perl
@@ -799,7 +799,18 @@ while(<CVS>) {
 			$state = 11;
 			next;
 		}
+                if ($branch eq "#CVSPS_NO_BRANCH") {
+			# skip
+			print "skip patchset $patchset: unknown branch\n" if $opt_v;
+			$state = 11;
+			next;
+		}
 		if($ancestor) {
+			if ($ancestor eq "#CVSPS_NO_BRANCH") {
+				# skip
+				print "In patchset $patchset: ancestor branch unknown, setting to $opt_o" if $opt_v;
+				$ancestor = $opt_o;
+			}
 			if(-f "$git_dir/refs/heads/$branch") {
 				print STDERR "Branch $branch already exists!\n";
 				$state=11;
-- 
1.1.6

^ permalink raw reply related	[flat|nested] 6+ messages in thread

* Re: [PATCH] Ignore commits for which cvsps can't identify a branch
  2006-02-10 21:02 [PATCH] Ignore commits for which cvsps can't identify a branch Christian Biesinger
@ 2006-02-10 21:21 ` Junio C Hamano
  2006-02-10 22:02   ` Christian Biesinger
  2006-06-10 19:24 ` Yann Dirson
  1 sibling, 1 reply; 6+ messages in thread
From: Junio C Hamano @ 2006-02-10 21:21 UTC (permalink / raw)
  To: Christian Biesinger; +Cc: git

Christian Biesinger <cbiesinger@web.de> writes:

> cvps sometimes can't identify a branch for a specific revision, it shows
> messages like:
>   WARNING: revision 1.36.2.2 of file Makefile.in on unnamed branch
> and uses #CVSPS_NO_BRANCH as branch name in its output.
>
> This checkin makes it so that git-cvsimport ignores such branches,
> and when they
> appear as ancestor branch, it maps them to HEAD.

Does continuing with this kind of "fixups" produce usable
history, perhaps just some changes missing but trees contained
in other commits are still faithful reproductions of what the
CVS repository would have given you?  Or does it result in
unusable history?

Depending on the nature of corruption and its expected use,
sometimes silently corrupt conversion result is worse than not
having it at all.  If you are going to use it primarily for
archaeology, it is much more useful to have a more-or-less
correct conversion than not having anything at all, but if you
are building on top of it, you at least would want to have the
correct tree at the tip of the branch you build upon.  I cannot
offhand tell how this workaround affects the conversion result,
hence this question.

> I hope I did this right, I'm not so familiar with git...

The only gripe I might have is your log message is too wide.
Other than that it looks like it properly follows the the
formatting and submitting convention.

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [PATCH] Ignore commits for which cvsps can't identify a branch
  2006-02-10 21:21 ` Junio C Hamano
@ 2006-02-10 22:02   ` Christian Biesinger
  2006-02-10 23:25     ` Linus Torvalds
  0 siblings, 1 reply; 6+ messages in thread
From: Christian Biesinger @ 2006-02-10 22:02 UTC (permalink / raw)
  To: Junio C Hamano; +Cc: git

Junio C Hamano wrote:
> Does continuing with this kind of "fixups" produce usable
> history, perhaps just some changes missing but trees contained
> in other commits are still faithful reproductions of what the
> CVS repository would have given you?  Or does it result in
> unusable history?

I have to admit that I can't actually tell you for sure, since I still 
get a failure later (I think it's because cvsps orders changesets 
wrongly). However, I was told that the revisions that give me this 
CVSPS_NO_BRANCH issue came into existence by (partially) removing tags 
from a file, so not listing them should be fine, I think. (This happened 
by copying a ,v file and removing its tags, simulating a file copy)

Anyway, based on that, I expect that the history is the same as what I 
get from cvs, but I can't verify that.

> Depending on the nature of corruption and its expected use,
> sometimes silently corrupt conversion result is worse than not
> having it at all.

Well, without the patch this error is fatal, and the conversion is very 
partial. I'm not sure if that's better.

(This is also not "silent" corruption. I do show a message for it. Would 
you rather have it displayed unconditionally?)

Would it be better to have a flag --continue-on-errors?

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [PATCH] Ignore commits for which cvsps can't identify a branch
  2006-02-10 22:02   ` Christian Biesinger
@ 2006-02-10 23:25     ` Linus Torvalds
  0 siblings, 0 replies; 6+ messages in thread
From: Linus Torvalds @ 2006-02-10 23:25 UTC (permalink / raw)
  To: Christian Biesinger; +Cc: Junio C Hamano, git



On Fri, 10 Feb 2006, Christian Biesinger wrote:
> 
> I have to admit that I can't actually tell you for sure, since I still get a
> failure later (I think it's because cvsps orders changesets wrongly).

Do you have a recent version of "cvsps"? The wrong ordering happened quite 
often with old cvsps versions. So make sure you absolutely have 2.1.

Also, David Mansfield may not be maintaining it horribly actively, but 
that's probably because it's purely a "minimal maintenance" project for 
him by now. He reacted in a very timely manner when we pointed out 
specific bugs, so if you can pinpoint the exact thing cvsps does wrong, I 
bet David will be more than happy to apply patches or perhaps even fix it 
himself and make a new version.

So while it's fine to work around cvsps problems inside "git cvsimport", 
it's even better if you could try to see if you can figure out why they 
happen in the first place. The source code wasn't all that unreadable from 
what I can remember.

		Linus

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [PATCH] Ignore commits for which cvsps can't identify a branch
  2006-02-10 21:02 [PATCH] Ignore commits for which cvsps can't identify a branch Christian Biesinger
  2006-02-10 21:21 ` Junio C Hamano
@ 2006-06-10 19:24 ` Yann Dirson
  2006-06-10 19:45   ` Christian Biesinger
  1 sibling, 1 reply; 6+ messages in thread
From: Yann Dirson @ 2006-06-10 19:24 UTC (permalink / raw)
  To: Christian Biesinger; +Cc: GIT list

On Fri, Feb 10, 2006 at 10:02:33PM +0100, Christian Biesinger wrote:
> cvps sometimes can't identify a branch for a specific revision, it shows
> messages like:
>   WARNING: revision 1.36.2.2 of file Makefile.in on unnamed branch
> and uses #CVSPS_NO_BRANCH as branch name in its output.

This issue is a bit old, but still...

I have seen such CVSPS_NO_BRANCH things with "cvsps -u", and could
always get rid of it using "cvspx -x".  Christian, did you try to run
"cvsps -x" to be sure the cache is valid, and did it get rid of the
CVSPS_NO_BRANCH ?  It could help if you could make a cvsps cache
available, which exhibits the problem.

Best regards,
-- 
Yann Dirson    <ydirson@altern.org> |
Debian-related: <dirson@debian.org> |   Support Debian GNU/Linux:
                                    |  Freedom, Power, Stability, Gratis
     http://ydirson.free.fr/        | Check <http://www.debian.org/>

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [PATCH] Ignore commits for which cvsps can't identify a branch
  2006-06-10 19:24 ` Yann Dirson
@ 2006-06-10 19:45   ` Christian Biesinger
  0 siblings, 0 replies; 6+ messages in thread
From: Christian Biesinger @ 2006-06-10 19:45 UTC (permalink / raw)
  To: Yann Dirson; +Cc: GIT list

Yann Dirson wrote:
> I have seen such CVSPS_NO_BRANCH things with "cvsps -u", and could
> always get rid of it using "cvspx -x".  Christian, did you try to run
> "cvsps -x" to be sure the cache is valid, and did it get rid of the
> CVSPS_NO_BRANCH ?  It could help if you could make a cvsps cache
> available, which exhibits the problem.

I'm pretty sure that I did use -x and didn't have a cache. Unfortunately 
I don't have anything about that cvsps setup available anymore.

^ permalink raw reply	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2006-06-10 19:46 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2006-02-10 21:02 [PATCH] Ignore commits for which cvsps can't identify a branch Christian Biesinger
2006-02-10 21:21 ` Junio C Hamano
2006-02-10 22:02   ` Christian Biesinger
2006-02-10 23:25     ` Linus Torvalds
2006-06-10 19:24 ` Yann Dirson
2006-06-10 19:45   ` Christian Biesinger

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).