[PATCH] Also handle CVS branches with a '/' in their name
I track a CVS project which has a branch with a '/' in the branch name. Since git wants the branch name to be a file name at the same time, translate that character to a '-'. This should work well, despite the fact that a division and a difference are completely different :-) Signed-off-by: Johannes Schindelin [EMAIL PROTECTED] --- git-cvsimport-script |1 + 1 files changed, 1 insertions(+), 0 deletions(-) 787879e1e16d6cece75dc4744358ba0073e908cc diff --git a/git-cvsimport-script b/git-cvsimport-script --- a/git-cvsimport-script +++ b/git-cvsimport-script @@ -621,6 +621,7 @@ while(CVS) { $state = 4; } elsif($state == 4 and s/^Branch:\s+//) { s/\s+$//; + s/\//-/g; $branch = $_; $state = 5; } elsif($state == 5 and s/^Ancestor branch:\s+//) { - To unsubscribe from this list: send the line unsubscribe git in the body of a message to [EMAIL PROTECTED] More majordomo info at http://vger.kernel.org/majordomo-info.html
Re: [PATCH] Also handle CVS branches with a '/' in their name
Johannes Schindelin [EMAIL PROTECTED] writes: I track a CVS project which has a branch with a '/' in the branch name. Since git wants the branch name to be a file name at the same time, translate that character to a '-'. This should work well, despite the fact that a division and a difference are completely different :-) My feeling is that there should be nothing to prevent you from having a non-flat namespace in .git/refs/heads; i.e. we should allow .git/refs/heads/foo/bar. Some of the existing tools may be forgetting to call either mkdir -p $(dirname $ref) if they are written in shell, or safe_create_leading_directories(ref) in C, but I consider that is a bug. - To unsubscribe from this list: send the line unsubscribe git in the body of a message to [EMAIL PROTECTED] More majordomo info at http://vger.kernel.org/majordomo-info.html
Re: [PATCH] Also handle CVS branches with a '/' in their name
Hi, On Wed, 17 Aug 2005, Junio C Hamano wrote: Johannes Schindelin [EMAIL PROTECTED] writes: I track a CVS project which has a branch with a '/' in the branch name. Since git wants the branch name to be a file name at the same time, translate that character to a '-'. This should work well, despite the fact that a division and a difference are completely different :-) My feeling is that there should be nothing to prevent you from having a non-flat namespace in .git/refs/heads; i.e. we should allow .git/refs/heads/foo/bar. That may be true, but CVS branches being named Hänsel/Gretel do not logically denote hierarchies. I never ever saw hierarchical CVS branch names with a / separator. I saw some with a . separator. My feeling is that it would be wrong to map CVS branch names to a hierarchy. Ciao, Dscho
Re: [PATCH] Also handle CVS branches with a '/' in their name
Johannes Schindelin [EMAIL PROTECTED] writes: That may be true, but CVS branches being named H.ANdnsel/Gretel do not logically denote hierarchies. I never ever saw hierarchical CVS branch names with a / separator. I saw some with a . separator. My feeling is that it would be wrong to map CVS branch names to a hierarchy. Although I've used / in CVS branch names to denote hierarchy, I now agree with you for a different reason. A CVS repository can have branches Hnsel and Hnsel/Gretel at the same time, which we cannot express it with '/'. However, this may make CVS tags Hnsel/Gretel and Hnsel-Gretel clash, so maybe the name mangling should be made somehow configurable? - To unsubscribe from this list: send the line unsubscribe git in the body of a message to [EMAIL PROTECTED] More majordomo info at http://vger.kernel.org/majordomo-info.html