Incremental import of git into darcs and back again
====================================================
[![Test](https://github.com/ganwell/git-darcs/actions/workflows/test.yml/badge.svg)](https://github.com/ganwell/git-darcs/actions/workflows/test.yml) [![CodeQL](https://github.com/ganwell/git-darcs/actions/workflows/codeql-analysis.yml/badge.svg)](https://github.com/ganwell/git-darcs/actions/workflows/codeql-analysis.yml)
[git-darcs on pypi](https://pypi.org/project/git-darcs/)
- [Warning](#-warning)
- [Install](#Install)
- [Use-cases](#use-cases)
* [Main use-case](#main-use-case)
* [Other use-case](#other-use-case)
* [But why?](#but-why)
- [Tutorial](#Tutorial)
- [For darcs beginners](#for-darcs-beginners)
- [Caveats](#caveats)
* [Performance](#performance)
* [chmod and symbolic-links](#chmod-and-symbolic-links)
* [Linearized History](#linearized-history)
- [Usage](#usage)
⚠ Warning
=========
git-darcs needs a repository only for tracking. Don't use your working
git-repository. git-darcs will clear all your work that is not commited. It also
needs to temporarily change `.gitignore` and `_darcs/pref/boring`. By default it
will warn about this. You can add `-nw` to avoid the warning. The tutorial never
contains a `-nw`, so people don't copy-paste from the tutorial and lose their
work.
The tool is made for developers, while error-handling is okayish, there is
almost no error-reporting, you'll have to read the traceback.
![demo](https://github.com/ganwell/git-darcs/blob/main/demo.gif?raw=true)
Install
=======
Integration tests run on python 3.7 - 3.11.
```sh-session
$ pip install git-darcs
```
Use-cases
=========
Main use-case
-------------
Use the excellent capabilities of darcs to craft consistent, clear and concise
patches while the remote repository still remains git. Thats the situation most
of us in are because at work we have to use git.
Other use-cases
---------------
* Convert a git repository to darcs using the [linearized history](#linearized-history)
proposed by git-darcs
* Visualize a git-repository using `darcs show dependencies`
But why?
--------
I prefer to group changes by topic, so I am constantly amending commits/patches.
This is very easy in darcs and more complicated in git. Yes, I know about
`--fixup` and `--autosquash` in git. Also I can find independent low-risk
patches easily with `darcs show dependencies`, so I can constantly make MRs.
Making the final _breaking_ change/MR much smaller. This is less tedious for the
reviewers.
Tutorial
========
The tutorial covers the main use-case:
1. Check-out a git-repo, because at work you have to use git
2. Snapshot the latest commit into darcs
3. Craft patches: Use the excellent capabilities of darcs to move code between
patches to create very consistent and clean patches
4. Use `git darcs pull` to bring the darcs-patches back into git and
create pull-request
Clone your tracking-repository.
```sh-session
$ git clone https://github.com/adfinis-sygroup/document-merge-service.git dms-track
Cloning into 'document-merge-service'...
.....
Resolving deltas: 100% (1267/1267), done.
```
Lazily import the git-repository to darcs.
```sh-session
$ git darcs update
Use CTRL-D for a graceful shutdown.
```
git-darcs will import the latest commit and tag it, so it can update from there,
when you pull commits from upstream.
```sh-session
$ (cd dms-track; darcs log)
patch 7997a3365da1022db4b669ea63a37dc3f370a225
Author: Jean-Louis Fuchs <email>
Date: Fri Oct 7 17:40:10 CEST 2022
tagged git-checkpoint 2022-10-07T17:40:10.963827
d3ce714f2d77897e773e89ee3344602fceb1b625
patch 4e917fcc769b7a69858e0b11e7ee5aaffc76fbda
Author: Jean-Louis Fuchs <email>
Date: Fri Oct 7 17:40:10 CEST 2022
* d3ce714 chore(release): v5.0.0
```
Create the work-repository. Note that git and darcs make sure that no historical
data is duplicated on disk (using hardlinks).
```sh-session
$ git darcs clone dms-track/ dms-work
clone: 100%|████████████████████████████████████████████████| 5/5 [00:00<00:00, 37.75it/s]
```
Now you can implement a new feature.
```sh-session
$ cd dms-work
$ touch document_merge_service/feature.py
$ darcs add document_merge_service/feature.py
Adding './document_merge_service/feature.py'
Finished adding:
./document_merge_service/feature.py
$ darcs record -m "a new feature"
addfile ./document_merge_service/feature.py
Shall I record this change? (1/1) [ynW...], or ? for more options: y
Do you want to Record these changes? [Yglqk...], or ? for more options: y
Finished recording patch 'a new feature'
```
```sh-session
$ darcs show dependencies | dot -Tpdf -Grankdir=TB -o $ftmp
```
![first record](https://github.com/ganwell/git-darcs/blob/main/_static/first.png?raw=true)
There are new changes on upstream, let's pull them in.
```sh-session
$ cd ../dms-track/
$ git pull
Updating d3ce714..a6a8e35
Fast-forward
.github/workflows/tests.yml | 6 ++++-
.....
18 files changed, 262 insertions(+), 67 deletions(-)
```
From now on git-darcs will import every commit, but with a linearized
history. That means the history might look different than in git, but no change will be
forgotten. (See [Linearized History](#linearized-history))
```sh-session
$ git darcs update
Use CTRL-D for a graceful shutdown.
commits:
100%|███████████████████████████████████████████████████████| 18/18 [00:00<00:00, 19.14it/s]
```
We pull the new patches into `dms-work`.
```sh-session
$ cd ../dms-track/
$ darcs pull ../dms-track/
Pulling from "/home/jeanlf/Temp/dms-track"...
patch 309682700e7142e37945c45cc3375674012e8050
Author: GitHub <noreply@github.com>
Date: Fri Oct 7 18:07:08 CEST 2022
* 85892f6 fix(docker): fix docker uwsgi command
Shall I pull this patch? (1/19) [ynW...], or ? for more options: a
Finished pulling.
```
The 18 patches we pulled are now in `dms-work` along with a new snapshot-tag.
```sh-session
$ darcs log --from-tag=.
patch 430136524b02be562fdf0f0459594ffa981d386b
Author: Jean-Louis Fuchs <email>
Date: Fri Oct 7 18:07:09 CEST 2022
tagged git-checkpoint 2022-10-07T18:07:09.041126 a6a8e35ae3c3b42b04837a75ff59aa092130f326
patch ef1f2894abd21d0deef19090d4b873bf62af890a
Author: Jean-Louis Fuchs <email>
Date: Fri Oct 7 17:55:22 CEST 2022
* a new feature
```
We can now either pull the `a new feature`-patch into `dms-track` or we can
create a temporary `dms-stage` so it is easier to clean up after the
merge-request has been accepted. Note `git-darcs clone` will copy git-remotes
from the source, so you can push into your fork if it is set up.
If you pull into `dms-track` instead, you have to remove patches or commits on
both darcs and git, keeping darcs and git manually in sync.
```sh-session
$ cd ..
$ git darcs clone dms-track/ dms-stage
clone: 100%|████████████████████████████████████████████████| 5/5 [00:00<00:00, 48.32it/s]
$ cd dms-stage
```
`git-darcs pull` tries to emulate `darcs pull`.
```sh-session
$ git darcs pull ../dms-work/
patch ef1f2894abd21d0deef19090d4b873bf62af890a
Author: Jean-Louis Fuchs <email>
Date: 2022-10-07 15:55:22
Subject: a new feature
Shall I pull this patch? 1/1 [ynwasc], or ? for more options: ?
y: pull this patch
n: don't pull it
w: decide later
a: pull all remaining patches
i: don't pull remaining patches
l: show full log message
f: show full patch
?: help
h: help
c: cancel without pulling
q: cancel without pulling
Shall I pull this patch? 1/1 [ynwasc], or ? for more options: y
resolve: 0it [00:00, ?it/s]
Shall I pull 1 patches? [yn], or ? for more options: y
pull: 100%|█████████████████████████████████████████████████| 1/1 [00:00<00:00, 2.58it/s]
```
The patch `a new feature` is now a git-commit.
```sh-session
$ git show
commit c2541c6c3527d99a7fe69dc43b5863992d919a45 (HEAD -> main)
Author: Jean-Louis Fuchs <email>
Date: Fri Oct 7 20:01:22 2022 +0200
a new feature
diff --git a/document_merge_service/feature.py b/document_merge_service/feature.py
new file mode 100644
index 0000000..e69de29
```
```sh-session
$ cd ..
$ rm -r dms-stage
```
For darcs beginners
===================
* There is a great [video](https://hikari.acmelabs.space/videos/hikari-darcs.mp4) by
[raichoo](https://hub.darcs.net/raichoo) the maintainer of
[hikari](https://hikari.acmelabs.space/)
* You have to read the [darcs book](https://darcsbook.acmelabs.space/), you just
have to
* `_darcs/pref/boring` is the equivalent of `.gitignore`, but has quite a wide
definition of boring by default
Caveats
=======
Performance
-----------
git-darcs will playback the history of the git-repository. Every commit that is
recorded will first be checked out in git and then recorded in darcs. For that reason
git-darcs lazily imports the latest commit by default. This is how it is meant
to be used: Using darcs to complement git. You can use it to convert
repositories, if you like the way non-linear history is handled, it will be
sloooow. See also `darcs convert import`.
chmod and symbolic links
------------------------
Darcs does not handle `chmod` or symbolic links. The easiest way to work around
this is by letting `git` do the work. Since I always make git-commits from the
darcs-patches `git` will track `chmod` and symbolic links for me.
Linearized History
------------------
git-darcs will traverse the git-history in topological order. For every commit
it encounters, it will test if the previous commit was an ancestor, if not it
will ignore that commit for now. That way git-darcs can only "enter" one branch
of parallel history. Once it reaches a commit that is an ancestor it will import
that commit and log the complete history between it and the last successful
commit. So git-darcs creates patches that combine the complete history of a
parallel branch.
This git-log
```sh-session
$ git log --oneline --graph
* eef24d8 (HEAD -> master) end > end0
* 841c900 end
* 969ad57 Merge branch 'b'
|\
| * 76ca538 (b) bb2 > bb3
| * 0040cee bb1 > bb2
* | 663168a antiforward > antiforward0
* | 0d94733 Merge branch 'a'
|\ \
| * | d26d325 (a) aa2 > aa3
| * | 8090696 aa1 > aa2
| |/
* / fa7accb antiforward
|/
* 7bc2b76 aa0 > aa1, bb0 > bb1
* 665937d aa > aa0, bb bb0
* 1fd0236 aa, bb
```
becomes this darcs-log
```sh-session
* eef24d8 end > end0
move ./end ./end0
* 841c900 end
addfile ./end
* 969ad57 Merge branch 'b'
76ca538 bb2 > bb3
0040cee bb1 > bb2
move ./bb1 ./bb3
* 663168a antiforward > antiforward0
move ./antiforward ./antiforward0
* 0d94733 Merge branch 'a'
d26d325 aa2 > aa3
8090696 aa1 > aa2
move ./aa1 ./aa3
* fa7accb antiforward
addfile ./antiforward
* 7bc2b76 aa0 > aa1, bb0 > bb1
move ./aa0 ./aa1
move ./bb0 ./bb1
* 665937d aa > aa0, bb bb0
move ./aa ./aa0
move ./bb ./bb0
* 1fd0236 aa, bb
addfile ./aa
```
See how `0d94733 Merge branch 'a'` also contains `d26d325` and `0d94733`.
Usage
=====
```sh-session
$ git-darcs --help
Usage: git-darcs [OPTIONS] COMMAND [ARGS]...
Click entrypoint.
Options:
--help Sow this message and exit.
Commands:
clone Locally clone a tracking-repository to get a working-repository.
pull Pull from source darcs-repository into a tracking-repository.
update Incremental import of git into darcs.
```
```sh-session
$ git-darcs update --help
Usage: git-darcs update [OPTIONS]
Incremental import of git into darcs.
By default it imports a shallow copy (the current commit). Use `--no-
shallow` to import the complete history.
Options:
-v, --verbose / -nv, --no-verbose
-w, --warn / -nw, --no-warn Warn that repository will be cleared
-b, --base TEXT On first update import from (commit-ish)
-s, --shallow / -ns, --no-shallow
On first update only import current commit
--help Show this message and exit.
```
```sh-session
$ git-darcs clone --help
Usage: git-darcs clone [OPTIONS] SOURCE DESTINATION
Locally clone a tracking-repository to get a working-repository.
Options:
-v, --verbose / -nv, --no-verbose
--help Show this message and exit.
```
```sh-session
$ git-darcs pull --help
Usage: git-darcs pull [OPTIONS] SOURCE [DARCS]...
Pull from source darcs-repository into a tracking-repository.
A tracking-repository is created by `git darcs update` and contains a git-
and a darcs-repository. Arguments after `--` are passed to `darcs pull`.
Options:
-v, --verbose / -nv, --no-verbose
-w, --warn / -nw, --no-warn Warn that repository will be cleared
-a, --all / -na, --no-all Pull all patches
-i, --ignore-temp / -ni, --no-ignore-temp
Ignore temporary patches (with 'temp: ')
--help Show this message and exit.
```
Raw data
{
"_id": null,
"home_page": "https://github.com/ganwell/git-darcs",
"name": "git-darcs",
"maintainer": null,
"docs_url": null,
"requires_python": "<4.0,>=3.10",
"maintainer_email": null,
"keywords": "git, darcs, import, incremental",
"author": "Jean-Louis Fuchs",
"author_email": "safe.pen2857@rhizoome.ch",
"download_url": "https://files.pythonhosted.org/packages/2e/81/91632198f1e91ac6629eb5ed2f7041fa946c232a4acd22600cdf917ba9f4/git_darcs-0.10.1.tar.gz",
"platform": null,
"description": "Incremental import of git into darcs and back again\n====================================================\n\n[![Test](https://github.com/ganwell/git-darcs/actions/workflows/test.yml/badge.svg)](https://github.com/ganwell/git-darcs/actions/workflows/test.yml) [![CodeQL](https://github.com/ganwell/git-darcs/actions/workflows/codeql-analysis.yml/badge.svg)](https://github.com/ganwell/git-darcs/actions/workflows/codeql-analysis.yml)\n\n[git-darcs on pypi](https://pypi.org/project/git-darcs/)\n\n- [Warning](#-warning)\n- [Install](#Install)\n- [Use-cases](#use-cases)\n * [Main use-case](#main-use-case)\n * [Other use-case](#other-use-case)\n * [But why?](#but-why)\n- [Tutorial](#Tutorial)\n- [For darcs beginners](#for-darcs-beginners)\n- [Caveats](#caveats)\n * [Performance](#performance)\n * [chmod and symbolic-links](#chmod-and-symbolic-links)\n * [Linearized History](#linearized-history)\n- [Usage](#usage)\n\n\u26a0 Warning\n=========\n\ngit-darcs needs a repository only for tracking. Don't use your working\ngit-repository. git-darcs will clear all your work that is not commited. It also\nneeds to temporarily change `.gitignore` and `_darcs/pref/boring`. By default it\nwill warn about this. You can add `-nw` to avoid the warning. The tutorial never\ncontains a `-nw`, so people don't copy-paste from the tutorial and lose their\nwork.\n\nThe tool is made for developers, while error-handling is okayish, there is\nalmost no error-reporting, you'll have to read the traceback.\n\n![demo](https://github.com/ganwell/git-darcs/blob/main/demo.gif?raw=true)\n\nInstall\n=======\n\nIntegration tests run on python 3.7 - 3.11.\n\n```sh-session\n$ pip install git-darcs\n```\n\nUse-cases\n=========\n\nMain use-case\n-------------\n\nUse the excellent capabilities of darcs to craft consistent, clear and concise\npatches while the remote repository still remains git. Thats the situation most\nof us in are because at work we have to use git.\n\nOther use-cases\n---------------\n\n* Convert a git repository to darcs using the [linearized history](#linearized-history)\n proposed by git-darcs\n* Visualize a git-repository using `darcs show dependencies`\n\nBut why?\n--------\n\nI prefer to group changes by topic, so I am constantly amending commits/patches.\nThis is very easy in darcs and more complicated in git. Yes, I know about\n`--fixup` and `--autosquash` in git. Also I can find independent low-risk\npatches easily with `darcs show dependencies`, so I can constantly make MRs.\nMaking the final _breaking_ change/MR much smaller. This is less tedious for the\nreviewers.\n\nTutorial\n========\n\nThe tutorial covers the main use-case:\n\n1. Check-out a git-repo, because at work you have to use git\n2. Snapshot the latest commit into darcs\n3. Craft patches: Use the excellent capabilities of darcs to move code between\n patches to create very consistent and clean patches\n4. Use `git darcs pull` to bring the darcs-patches back into git and\n create pull-request\n\nClone your tracking-repository.\n\n```sh-session\n$ git clone https://github.com/adfinis-sygroup/document-merge-service.git dms-track\nCloning into 'document-merge-service'...\n\n.....\n\nResolving deltas: 100% (1267/1267), done.\n```\n\nLazily import the git-repository to darcs.\n\n```sh-session\n$ git darcs update\nUse CTRL-D for a graceful shutdown.\n```\n\ngit-darcs will import the latest commit and tag it, so it can update from there,\nwhen you pull commits from upstream.\n\n```sh-session\n$ (cd dms-track; darcs log)\npatch 7997a3365da1022db4b669ea63a37dc3f370a225\nAuthor: Jean-Louis Fuchs <email>\nDate: Fri Oct 7 17:40:10 CEST 2022\n tagged git-checkpoint 2022-10-07T17:40:10.963827\nd3ce714f2d77897e773e89ee3344602fceb1b625\n\npatch 4e917fcc769b7a69858e0b11e7ee5aaffc76fbda\nAuthor: Jean-Louis Fuchs <email>\nDate: Fri Oct 7 17:40:10 CEST 2022\n * d3ce714 chore(release): v5.0.0\n```\n\nCreate the work-repository. Note that git and darcs make sure that no historical\ndata is duplicated on disk (using hardlinks).\n\n```sh-session\n$ git darcs clone dms-track/ dms-work\nclone: 100%|\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588| 5/5 [00:00<00:00, 37.75it/s]\n```\n\nNow you can implement a new feature.\n\n```sh-session\n$ cd dms-work\n$ touch document_merge_service/feature.py\n$ darcs add document_merge_service/feature.py\nAdding './document_merge_service/feature.py'\nFinished adding:\n./document_merge_service/feature.py\n\n$ darcs record -m \"a new feature\"\naddfile ./document_merge_service/feature.py\nShall I record this change? (1/1) [ynW...], or ? for more options: y\nDo you want to Record these changes? [Yglqk...], or ? for more options: y\nFinished recording patch 'a new feature'\n```\n\n```sh-session\n$ darcs show dependencies | dot -Tpdf -Grankdir=TB -o $ftmp\n```\n\n![first record](https://github.com/ganwell/git-darcs/blob/main/_static/first.png?raw=true)\n\nThere are new changes on upstream, let's pull them in.\n\n```sh-session\n$ cd ../dms-track/\n$ git pull\nUpdating d3ce714..a6a8e35\nFast-forward\n .github/workflows/tests.yml | 6 ++++-\n \n.....\n \n 18 files changed, 262 insertions(+), 67 deletions(-)\n```\n\nFrom now on git-darcs will import every commit, but with a linearized\nhistory. That means the history might look different than in git, but no change will be\nforgotten. (See [Linearized History](#linearized-history))\n\n```sh-session\n$ git darcs update\nUse CTRL-D for a graceful shutdown.\ncommits:\n100%|\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588| 18/18 [00:00<00:00, 19.14it/s]\n```\n\nWe pull the new patches into `dms-work`.\n\n```sh-session\n$ cd ../dms-track/\n$ darcs pull ../dms-track/\nPulling from \"/home/jeanlf/Temp/dms-track\"...\npatch 309682700e7142e37945c45cc3375674012e8050\nAuthor: GitHub <noreply@github.com>\nDate: Fri Oct 7 18:07:08 CEST 2022\n * 85892f6 fix(docker): fix docker uwsgi command\nShall I pull this patch? (1/19) [ynW...], or ? for more options: a\nFinished pulling.\n```\n\nThe 18 patches we pulled are now in `dms-work` along with a new snapshot-tag.\n\n```sh-session\n$ darcs log --from-tag=.\npatch 430136524b02be562fdf0f0459594ffa981d386b\nAuthor: Jean-Louis Fuchs <email>\nDate: Fri Oct 7 18:07:09 CEST 2022\n tagged git-checkpoint 2022-10-07T18:07:09.041126 a6a8e35ae3c3b42b04837a75ff59aa092130f326\n\npatch ef1f2894abd21d0deef19090d4b873bf62af890a\nAuthor: Jean-Louis Fuchs <email>\nDate: Fri Oct 7 17:55:22 CEST 2022\n * a new feature\n```\n\nWe can now either pull the `a new feature`-patch into `dms-track` or we can\ncreate a temporary `dms-stage` so it is easier to clean up after the\nmerge-request has been accepted. Note `git-darcs clone` will copy git-remotes\nfrom the source, so you can push into your fork if it is set up.\n\nIf you pull into `dms-track` instead, you have to remove patches or commits on\nboth darcs and git, keeping darcs and git manually in sync.\n\n\n```sh-session\n$ cd ..\n$ git darcs clone dms-track/ dms-stage\nclone: 100%|\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588| 5/5 [00:00<00:00, 48.32it/s]\n$ cd dms-stage\n```\n\n`git-darcs pull` tries to emulate `darcs pull`.\n\n```sh-session\n$ git darcs pull ../dms-work/\npatch ef1f2894abd21d0deef19090d4b873bf62af890a\nAuthor: Jean-Louis Fuchs <email>\nDate: 2022-10-07 15:55:22\nSubject: a new feature\nShall I pull this patch? 1/1 [ynwasc], or ? for more options: ?\n\ny: pull this patch\nn: don't pull it\nw: decide later\n\na: pull all remaining patches\ni: don't pull remaining patches\n\nl: show full log message\nf: show full patch\n\n?: help\nh: help\n\nc: cancel without pulling\nq: cancel without pulling\n\nShall I pull this patch? 1/1 [ynwasc], or ? for more options: y\nresolve: 0it [00:00, ?it/s]\nShall I pull 1 patches? [yn], or ? for more options: y\npull: 100%|\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588| 1/1 [00:00<00:00, 2.58it/s]\n```\n\nThe patch `a new feature` is now a git-commit.\n\n```sh-session\n$ git show\ncommit c2541c6c3527d99a7fe69dc43b5863992d919a45 (HEAD -> main)\nAuthor: Jean-Louis Fuchs <email>\nDate: Fri Oct 7 20:01:22 2022 +0200\n\n a new feature\n\ndiff --git a/document_merge_service/feature.py b/document_merge_service/feature.py\nnew file mode 100644\nindex 0000000..e69de29\n```\n\n```sh-session\n$ cd ..\n$ rm -r dms-stage\n```\n\nFor darcs beginners\n===================\n\n* There is a great [video](https://hikari.acmelabs.space/videos/hikari-darcs.mp4) by\n [raichoo](https://hub.darcs.net/raichoo) the maintainer of\n [hikari](https://hikari.acmelabs.space/)\n* You have to read the [darcs book](https://darcsbook.acmelabs.space/), you just\n have to\n* `_darcs/pref/boring` is the equivalent of `.gitignore`, but has quite a wide\n definition of boring by default\n\nCaveats\n=======\n\nPerformance\n-----------\n\ngit-darcs will playback the history of the git-repository. Every commit that is\nrecorded will first be checked out in git and then recorded in darcs. For that reason\ngit-darcs lazily imports the latest commit by default. This is how it is meant\nto be used: Using darcs to complement git. You can use it to convert\nrepositories, if you like the way non-linear history is handled, it will be\nsloooow. See also `darcs convert import`.\n\nchmod and symbolic links\n------------------------\n\nDarcs does not handle `chmod` or symbolic links. The easiest way to work around\nthis is by letting `git` do the work. Since I always make git-commits from the\ndarcs-patches `git` will track `chmod` and symbolic links for me.\n\nLinearized History\n------------------\n\ngit-darcs will traverse the git-history in topological order. For every commit\nit encounters, it will test if the previous commit was an ancestor, if not it\nwill ignore that commit for now. That way git-darcs can only \"enter\" one branch\nof parallel history. Once it reaches a commit that is an ancestor it will import\nthat commit and log the complete history between it and the last successful\ncommit. So git-darcs creates patches that combine the complete history of a\nparallel branch.\n\nThis git-log\n\n```sh-session\n$ git log --oneline --graph\n* eef24d8 (HEAD -> master) end > end0\n* 841c900 end\n* 969ad57 Merge branch 'b'\n|\\\n| * 76ca538 (b) bb2 > bb3\n| * 0040cee bb1 > bb2\n* | 663168a antiforward > antiforward0\n* | 0d94733 Merge branch 'a'\n|\\ \\\n| * | d26d325 (a) aa2 > aa3\n| * | 8090696 aa1 > aa2\n| |/\n* / fa7accb antiforward\n|/\n* 7bc2b76 aa0 > aa1, bb0 > bb1\n* 665937d aa > aa0, bb bb0\n* 1fd0236 aa, bb\n```\n\nbecomes this darcs-log\n\n```sh-session\n* eef24d8 end > end0\n move ./end ./end0\n* 841c900 end\n addfile ./end\n* 969ad57 Merge branch 'b'\n 76ca538 bb2 > bb3\n 0040cee bb1 > bb2\n move ./bb1 ./bb3\n* 663168a antiforward > antiforward0\n move ./antiforward ./antiforward0\n* 0d94733 Merge branch 'a'\n d26d325 aa2 > aa3\n 8090696 aa1 > aa2\n move ./aa1 ./aa3\n* fa7accb antiforward\n addfile ./antiforward\n* 7bc2b76 aa0 > aa1, bb0 > bb1\n move ./aa0 ./aa1\n move ./bb0 ./bb1\n* 665937d aa > aa0, bb bb0\n move ./aa ./aa0\n move ./bb ./bb0\n* 1fd0236 aa, bb\n addfile ./aa\n```\n\nSee how `0d94733 Merge branch 'a'` also contains `d26d325` and `0d94733`.\n\nUsage\n=====\n\n```sh-session\n$ git-darcs --help\nUsage: git-darcs [OPTIONS] COMMAND [ARGS]...\n\n Click entrypoint.\n\nOptions:\n --help Sow this message and exit.\n\nCommands:\n clone Locally clone a tracking-repository to get a working-repository.\n pull Pull from source darcs-repository into a tracking-repository.\n update Incremental import of git into darcs.\n```\n\n```sh-session\n$ git-darcs update --help\nUsage: git-darcs update [OPTIONS]\n\n Incremental import of git into darcs.\n\n By default it imports a shallow copy (the current commit). Use `--no-\n shallow` to import the complete history.\n\nOptions:\n -v, --verbose / -nv, --no-verbose\n -w, --warn / -nw, --no-warn Warn that repository will be cleared\n -b, --base TEXT On first update import from (commit-ish)\n -s, --shallow / -ns, --no-shallow\n On first update only import current commit\n --help Show this message and exit.\n```\n\n```sh-session\n$ git-darcs clone --help\nUsage: git-darcs clone [OPTIONS] SOURCE DESTINATION\n\n Locally clone a tracking-repository to get a working-repository.\n\nOptions:\n -v, --verbose / -nv, --no-verbose\n --help Show this message and exit.\n```\n\n```sh-session\n$ git-darcs pull --help\nUsage: git-darcs pull [OPTIONS] SOURCE [DARCS]...\n\n Pull from source darcs-repository into a tracking-repository.\n\n A tracking-repository is created by `git darcs update` and contains a git-\n and a darcs-repository. Arguments after `--` are passed to `darcs pull`.\n\nOptions:\n -v, --verbose / -nv, --no-verbose\n -w, --warn / -nw, --no-warn Warn that repository will be cleared\n -a, --all / -na, --no-all Pull all patches\n -i, --ignore-temp / -ni, --no-ignore-temp\n Ignore temporary patches (with 'temp: ')\n --help Show this message and exit.\n```\n",
"bugtrack_url": null,
"license": "AGPL-3.0-or-later",
"summary": " Incremental import of git into darcs and back again",
"version": "0.10.1",
"project_urls": {
"Homepage": "https://github.com/ganwell/git-darcs",
"Repository": "https://github.com/ganwell/git-darcs"
},
"split_keywords": [
"git",
" darcs",
" import",
" incremental"
],
"urls": [
{
"comment_text": "",
"digests": {
"blake2b_256": "534344616907183005d2a5b712f17ec0bf6fb8b1d1fca88a416c56669253b5b1",
"md5": "21453b979f71901531125ac25a65fb03",
"sha256": "5c2bb7da5069a85cf1a4183610cf893cc233e729687516fab11b0572c79b0262"
},
"downloads": -1,
"filename": "git_darcs-0.10.1-py3-none-any.whl",
"has_sig": false,
"md5_digest": "21453b979f71901531125ac25a65fb03",
"packagetype": "bdist_wheel",
"python_version": "py3",
"requires_python": "<4.0,>=3.10",
"size": 37369,
"upload_time": "2024-08-30T09:58:12",
"upload_time_iso_8601": "2024-08-30T09:58:12.268459Z",
"url": "https://files.pythonhosted.org/packages/53/43/44616907183005d2a5b712f17ec0bf6fb8b1d1fca88a416c56669253b5b1/git_darcs-0.10.1-py3-none-any.whl",
"yanked": false,
"yanked_reason": null
},
{
"comment_text": "",
"digests": {
"blake2b_256": "2e8191632198f1e91ac6629eb5ed2f7041fa946c232a4acd22600cdf917ba9f4",
"md5": "28894ebe0daae1a4592e5b4027eeb77b",
"sha256": "6229b9633aa50c06f92fe58fceca6537eafd5f095a14580f51a3514a68787e02"
},
"downloads": -1,
"filename": "git_darcs-0.10.1.tar.gz",
"has_sig": false,
"md5_digest": "28894ebe0daae1a4592e5b4027eeb77b",
"packagetype": "sdist",
"python_version": "source",
"requires_python": "<4.0,>=3.10",
"size": 28838,
"upload_time": "2024-08-30T09:58:14",
"upload_time_iso_8601": "2024-08-30T09:58:14.030610Z",
"url": "https://files.pythonhosted.org/packages/2e/81/91632198f1e91ac6629eb5ed2f7041fa946c232a4acd22600cdf917ba9f4/git_darcs-0.10.1.tar.gz",
"yanked": false,
"yanked_reason": null
}
],
"upload_time": "2024-08-30 09:58:14",
"github": true,
"gitlab": false,
"bitbucket": false,
"codeberg": false,
"github_user": "ganwell",
"github_project": "git-darcs",
"travis_ci": false,
"coveralls": false,
"github_actions": true,
"lcname": "git-darcs"
}