initial commit

This commit is contained in:
lroche
2018-03-09 18:33:55 +01:00
commit c16e4cf4bb
4 changed files with 70 additions and 0 deletions
+17
View File
@@ -0,0 +1,17 @@
FROM buildpack-deps:jessie
MAINTAINER Lionel Roche
RUN mkdir -p work
WORKDIR work
#Install fastexport tool:
RUN mkdir -p /usr/local/src \
&& cd /usr/local/src \
&& git clone https://github.com/frej/fast-export.git
RUN cd /work
COPY hg2git.sh .
RUN chmod +x hg2git.sh
ENTRYPOINT ["/work/hg2git.sh"]
+20
View File
@@ -0,0 +1,20 @@
The MIT License (MIT)
Copyright (c) 2018 Lionel Roche
Permission is hereby granted, free of charge, to any person obtaining a copy of
this software and associated documentation files (the "Software"), to deal in
the Software without restriction, including without limitation the rights to
use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of
the Software, and to permit persons to whom the Software is furnished to do so,
subject to the following conditions:
The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS
FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR
COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER
IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+17
View File
@@ -0,0 +1,17 @@
# Summary
The purpose of hg2git is to convert a Mercurial repository to a Git repository.
All mechanism of conversion is based on [fast-export](https://github.com/frej/fast-export.git) tool.
# Launch conversion
docker run -it -v ~/gitconversion/anyproject-hg:/work/projectname -v ~/gitconversion/project-result-git:/work/result lroche/hg2git projectname
the run uses two bound volumes, one for hg source, other for git target result.
the name of project has no matter but it will be the same between /work/projectname and the argument of the command (here projectname)
# How to retrieve git conversion ?
The result of git conversion can be found behind the /work/result volume
+16
View File
@@ -0,0 +1,16 @@
#!/bin/bash
PROJECT_NAME=$1
cd /work/result
mkdir -p $PROJECT_NAME-git
cd $PROJECT_NAME-git
git init
#avoid having unexpected issue:
git config core.ignoreCase false
/usr/local/src/fast-export/hg-fast-export.sh -r /work/$PROJECT_NAME
git checkout HEAD
bash