#
# add_file "git.cc"
#
# add_file "git.hh"
#
# patch "ChangeLog"
# from [ad4c87bbca7d8bc3eb6776b8df109dfb492ffa52]
# to [b3e0e2a03c355cce0615f8bd98f260b7176706a9]
#
# patch "Makefile.am"
# from [c8f56d086950c437c10c455b623b7fb4766a8bdf]
# to [181d960c26d6bac3074bd9eb32237d879a350f73]
#
# patch "commands.cc"
# from [2546adbbe28ab041dcdbfeaf41afb0d5897e882c]
# to [0ad4562663c8b4b82cf8a773625d5a1c892a81cc]
#
# patch "git.cc"
# from []
# to [203033d75ca89c0025f03b41b84c620b0098f335]
#
# patch "git.hh"
# from []
# to [215071ed5af0e65bc816835dcb9188e6467c1ba0]
#
========================================================================
--- ChangeLog ad4c87bbca7d8bc3eb6776b8df109dfb492ffa52
+++ ChangeLog b3e0e2a03c355cce0615f8bd98f260b7176706a9
@@ -1,4 +1,13 @@
+2005-08-18 Petr Baudis
+ * Makefile.am, git.hh, git.cc: Initial support for importing from
+ GIT repositories to Monotone. This is pretty basic yet, full of
+ TODOs, can't do tags nor incremental imports, does not record
+ executability of files, and does not attach git certs to the
+ imported commits. But it more-or-less successfully imports history
+ of the GIT project itself, although it takes its time.
+ * commands.cc: git_import command.
+
2005-08-17 Timothy Brownawell
* sanity.cc (gasp()): When catching an error from dumping a MM'd
========================================================================
--- Makefile.am c8f56d086950c437c10c455b623b7fb4766a8bdf
+++ Makefile.am 181d960c26d6bac3074bd9eb32237d879a350f73
@@ -29,6 +29,7 @@
mkstemp.cc mkstemp.hh \
lcs.cc lcs.hh \
rcs_import.cc rcs_import.hh \
+ git.cc git.hh \
revision.cc revision.hh \
change_set.cc change_set.hh \
mt_version.cc mt_version.hh \
========================================================================
--- commands.cc 2546adbbe28ab041dcdbfeaf41afb0d5897e882c
+++ commands.cc 0ad4562663c8b4b82cf8a773625d5a1c892a81cc
@@ -31,6 +31,7 @@
#include "database_check.hh"
#include "diff_patch.hh"
#include "file_io.hh"
+#include "git.hh"
#include "keys.hh"
#include "manifest.hh"
#include "netsync.hh"
@@ -3394,6 +3395,15 @@
import_cvs_repo(mkpath(idx(args, 0)()), app);
}
+CMD(git_import, "git", "GITREPO", "import given head from GIT repository",
+ OPT_BRANCH_NAME)
+{
+ if (args.size() != 1)
+ throw usage(name);
+
+ import_git_repo(mkpath(idx(args, 0)()), app);
+}
+
static void
log_certs(app_state & app, revision_id id, cert_name name,
string label, string separator,
========================================================================
--- git.cc
+++ git.cc 203033d75ca89c0025f03b41b84c620b0098f335
@@ -0,0 +1,511 @@
+// -*- mode: C++; c-file-style: "gnu"; indent-tabs-mode: nil -*-
+// vim:sw=2:
+// Copyright (C) 2005 Petr Baudis
+// all rights reserved.
+// licensed to the public under the terms of the GNU GPL (>= 2)
+// see the file COPYING for details
+
+// Based on cvs_import by graydon hoare
+// Sponsored by Google's Summer of Code and SuSE
+
+// TODO:
+// * Incremental import
+// * Export, incremental export
+// * Non-master head
+// * Do not use external commands, but libgit directly (?)
+// * Remote repositories
+
+#include
+#include
+#include
+#include
+#include
+#include