<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE sect2 SYSTEM "../../../dtd/dblite.dtd">

<sect2 lang="en" id="git-archimport(1)">
    <title>git-archimport(1)</title>
    <date>2024-07-02</date>
<revhistory><revision><date>2024-07-02</date></revision></revhistory>
<indexterm>
<primary>git-archimport(1)</primary>
</indexterm>
<simplesect id="git-archimport(1)__name">
<title>NAME</title>
<simpara>git-archimport - Import a GNU Arch repository into Git</simpara>
</simplesect>
<simplesect id="git-archimport(1)__synopsis">
<title>SYNOPSIS</title>
<blockquote>
<literallayout><emphasis>git archimport</emphasis> [-h] [-v] [-o] [-a] [-f] [-T] [-D &lt;depth&gt;] [-t &lt;tempdir&gt;]
               &lt;archive&gt;/&lt;branch&gt;[:&lt;git-branch&gt;]&#8230;</literallayout>
</blockquote>
</simplesect>
<simplesect id="git-archimport(1)__description">
<title>DESCRIPTION</title>
<simpara>Imports a project from one or more GNU Arch repositories.
It will follow branches
and repositories within the namespaces defined by the &lt;archive&gt;/&lt;branch&gt;
parameters supplied. If it cannot find the remote branch a merge comes from
it will just import it as a regular commit. If it can find it, it will mark it
as a merge whenever possible (see discussion below).</simpara>
<simpara>The script expects you to provide the key roots where it can start the import
from an <emphasis>initial import</emphasis> or <emphasis>tag</emphasis> type of Arch commit. It will follow and
import new branches within the provided roots.</simpara>
<simpara>It expects to be dealing with one project only. If it sees
branches that have different roots, it will refuse to run. In that case,
edit your &lt;archive&gt;/&lt;branch&gt; parameters to define clearly the scope of the
import.</simpara>
<simpara><emphasis>git archimport</emphasis> uses <emphasis>tla</emphasis> extensively in the background to access the
Arch repository.
Make sure you have a recent version of <emphasis>tla</emphasis> available in the path. <emphasis>tla</emphasis> must
know about the repositories you pass to <emphasis>git archimport</emphasis>.</simpara>
<simpara>For the initial import, <emphasis>git archimport</emphasis> expects to find itself in an empty
directory. To follow the development of a project that uses Arch, rerun
<emphasis>git archimport</emphasis> with the same parameters as the initial import to perform
incremental imports.</simpara>
<simpara>While <emphasis>git archimport</emphasis> will try to create sensible branch names for the
archives that it imports, it is also possible to specify Git branch names
manually.  To do so, write a Git branch name after each &lt;archive&gt;/&lt;branch&gt;
parameter, separated by a colon.  This way, you can shorten the Arch
branch names and convert Arch jargon to Git jargon, for example mapping a
"PROJECT&#45;&#45;devo&#45;&#45;VERSION" branch to "master".</simpara>
<simpara>Associating multiple Arch branches to one Git branch is possible; the
result will make the most sense only if no commits are made to the first
branch, after the second branch is created.  Still, this is useful to
convert Arch repositories that had been rotated periodically.</simpara>
</simplesect>
<simplesect id="git-archimport(1)__merges">
<title>MERGES</title>
<simpara>Patch merge data from Arch is used to mark merges in Git as well. Git
does not care much about tracking patches, and only considers a merge when a
branch incorporates all the commits since the point they forked. The end result
is that Git will have a good idea of how far branches have diverged. So the
import process does lose some patch-trading metadata.</simpara>
<simpara>Fortunately, when you try and merge branches imported from Arch,
Git will find a good merge base, and it has a good chance of identifying
patches that have been traded out-of-sequence between the branches.</simpara>
</simplesect>
<simplesect id="git-archimport(1)__options">
<title>OPTIONS</title>
<variablelist>
<varlistentry>
<term>
-h
</term>
<listitem>
<simpara>
        Display usage.
</simpara>
</listitem>
</varlistentry>
<varlistentry>
<term>
-v
</term>
<listitem>
<simpara>
        Verbose output.
</simpara>
</listitem>
</varlistentry>
<varlistentry>
<term>
-T
</term>
<listitem>
<simpara>
        Many tags. Will create a tag for every commit, reflecting the commit
        name in the Arch repository.
</simpara>
</listitem>
</varlistentry>
<varlistentry>
<term>
-f
</term>
<listitem>
<simpara>
        Use the fast patchset import strategy.  This can be significantly
        faster for large trees, but cannot handle directory renames or
        permissions changes.  The default strategy is slow and safe.
</simpara>
</listitem>
</varlistentry>
<varlistentry>
<term>
-o
</term>
<listitem>
<simpara>
        Use this for compatibility with old-style branch names used by
        earlier versions of <emphasis>git archimport</emphasis>.  Old-style branch names
        were category&#45;&#45;branch, whereas new-style branch names are
        archive,category&#45;&#45;branch&#45;&#45;version.  In both cases, names given
        on the command-line will override the automatically-generated
        ones.
</simpara>
</listitem>
</varlistentry>
<varlistentry>
<term>
-D &lt;depth&gt;
</term>
<listitem>
<simpara>
        Follow merge ancestry and attempt to import trees that have been
        merged from.  Specify a depth greater than 1 if patch logs have been
        pruned.
</simpara>
</listitem>
</varlistentry>
<varlistentry>
<term>
-a
</term>
<listitem>
<simpara>
        Attempt to auto-register archives at <emphasis>http://mirrors.sourcecontrol.net</emphasis>
        This is particularly useful with the -D option.
</simpara>
</listitem>
</varlistentry>
<varlistentry>
<term>
-t &lt;tmpdir&gt;
</term>
<listitem>
<simpara>
        Override the default tempdir.
</simpara>
</listitem>
</varlistentry>
<varlistentry>
<term>
&lt;archive&gt;/&lt;branch&gt;
</term>
<listitem>
<simpara>
        &lt;archive&gt;/&lt;branch&gt; identifier in a format that <emphasis>tla log</emphasis> understands.
</simpara>
</listitem>
</varlistentry>
</variablelist>
</simplesect>
<simplesect id="git-archimport(1)__git">
<title>GIT</title>
<simpara>Part of the <xref linkend="git(1)" /> suite</simpara>
</simplesect>
</sect2>
