Package: git-darcs
Incremental import of git into darcs and back againgit-darcs on pypiWarningInstallUse-casesMain use-caseOther use-caseBut why?TutorialFor darcs beginnersCaveatsPerformancechmod and symbolic-linksLinearized HistoryUsage⚠ Warninggit-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.gitignoreand_darcs/pref/boring. By default it
will warn about this. You can add-nwto 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.InstallIntegration tests run on python 3.7 - 3.11.pipinstallgit-darcsUse-casesMain use-caseUse 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-casesConvert a git repository to darcs using thelinearized historyproposed by git-darcsVisualize a git-repository usingdarcs show dependenciesBut 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--fixupand--autosquashin git. Also I can find independent low-risk
patches easily withdarcs show dependencies, so I can constantly make MRs.
Making the finalbreakingchange/MR much smaller. This is less tedious for the
reviewers.TutorialThe tutorial covers the main use-case:Check-out a git-repo, because at work you have to use gitSnapshot the latest commit into darcsCraft patches: Use the excellent capabilities of darcs to move code between
patches to create very consistent and clean patchesUsegit darcs pullto bring the darcs-patches back into git and
create pull-requestClone your tracking-repository.$>gitclonehttps://github.com/adfinis-sygroup/document-merge-service.gitdms-track
Cloninginto'document-merge-service'...

.....

Resolvingdeltas:100%(1267/1267),done.Lazily import the git-repository to darcs.$>gitdarcsupdate
UseCTRL-Dforagracefulshutdown.git-darcs will import the latest commit and tag it, so it can update from there,
when you pull commits from upstream.$>(cddms-track;darcslog)patch7997a3365da1022db4b669ea63a37dc3f370a225
Author:Jean-LouisFuchs<email>
Date:FriOct717:40:10CEST2022taggedgit-checkpoint2022-10-07T17:40:10.963827
d3ce714f2d77897e773e89ee3344602fceb1b625

patch4e917fcc769b7a69858e0b11e7ee5aaffc76fbda
Author:Jean-LouisFuchs<email>
Date:FriOct717:40:10CEST2022*d3ce714chore(release):v5.0.0Create the work-repository. Note that git and darcs make sure that no historical
data is duplicated on disk (using hardlinks).$>gitdarcsclonedms-track/dms-work
clone:100%|████████████████████████████████████████████████|5/5[00:00<00:00,37.75it/s]Now you can implement a new feature.$>cddms-work
$>touchdocument_merge_service/feature.py
$>darcsadddocument_merge_service/feature.py
Adding'./document_merge_service/feature.py'Finishedadding:
./document_merge_service/feature.py

$>darcsrecord-m"a new feature"addfile./document_merge_service/feature.py
ShallIrecordthischange?(1/1)[ynW...],or?formoreoptions:y
DoyouwanttoRecordthesechanges?[Yglqk...],or?formoreoptions:y
Finishedrecordingpatch'a new feature'darcsshowdependencies|dot-Tpdf-Grankdir=TB-o$ftmpThere are new changes on upstream, let's pull them in.$>cd../dms-track/
$>gitpull
Updatingd3ce714..a6a8e35
Fast-forward.github/workflows/tests.yml|6++++-.....18fileschanged,262insertions(+),67deletions(-)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. (SeeLinearized History)$>gitdarcsupdate
UseCTRL-Dforagracefulshutdown.
commits:100%|███████████████████████████████████████████████████████|18/18[00:00<00:00,19.14it/s]We pull the new patches intodms-work.$>cd../dms-track/
$>darcspull../dms-track/
Pullingfrom"/home/jeanlf/Temp/dms-track"...
patch309682700e7142e37945c45cc3375674012e8050
Author:GitHub<noreply@github.com>
Date:FriOct718:07:08CEST2022*85892f6fix(docker):fixdockeruwsgicommandShallIpullthispatch?(1/19)[ynW...],or?formoreoptions:a
Finishedpulling.The 18 patches we pulled are now indms-workalong with a new snapshot-tag.$>darcslog--from-tag=.
patch430136524b02be562fdf0f0459594ffa981d386b
Author:Jean-LouisFuchs<email>
Date:FriOct718:07:09CEST2022taggedgit-checkpoint2022-10-07T18:07:09.041126a6a8e35ae3c3b42b04837a75ff59aa092130f326

patchef1f2894abd21d0deef19090d4b873bf62af890a
Author:Jean-LouisFuchs<email>
Date:FriOct717:55:22CEST2022*anewfeatureWe can now either pull thea new feature-patch intodms-trackor we can
create a temporarydms-stageso it is easier to clean up after the
merge-request has been accepted. Notegit-darcs clonewill copy git-remotes
from the source, so you can push into your fork if it is set up.If you pull intodms-trackinstead, you have to remove patches or commits on
both darcs and git, keeping darcs and git manually in sync.$>cd..
$>gitdarcsclonedms-track/dms-stage
clone:100%|████████████████████████████████████████████████|5/5[00:00<00:00,48.32it/s]$>cddms-stagegit-darcs pulltries to emulatedarcs pull.$>gitdarcspull../dms-work/
patchef1f2894abd21d0deef19090d4b873bf62af890a
Author:Jean-LouisFuchs<email>
Date:2022-10-0715:55:22
Subject:anewfeature
ShallIpullthispatch?1/1[ynwasc],or?formoreoptions:?

y:pullthispatch
n:don't pull itw: decide latera: pull all remaining patchesi: don'tpullremainingpatches

l:showfulllogmessage
f:showfullpatch

?:helph:helpc:cancelwithoutpulling
q:cancelwithoutpulling

ShallIpullthispatch?1/1[ynwasc],or?formoreoptions:y
resolve:0it[00:00,?it/s]ShallIpull1patches?[yn],or?formoreoptions:y
pull:100%|█████████████████████████████████████████████████|1/1[00:00<00:00,2.58it/s]The patcha new featureis now a git-commit.$>gitshow
commitc2541c6c3527d99a7fe69dc43b5863992d919a45(HEAD->main)Author:Jean-LouisFuchs<email>
Date:FriOct720:01:222022+0200anewfeature

diff--gita/document_merge_service/feature.pyb/document_merge_service/feature.py
newfilemode100644index0000000..e69de29$>cd..
$>rm-rdms-stageFor darcs beginnersThere is a greatvideobyraichoothe maintainer ofhikariYou have to read thedarcs book, you just
have to_darcs/pref/boringis the equivalent of.gitignore, but has quite a wide
definition of boring by defaultCaveatsPerformancegit-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 alsodarcs convert import.chmod and symbolic linksDarcs does not handlechmodor symbolic links. The easiest way to work around
this is by  lettinggitdo the work. Since I always make git-commits from the
darcs-patchesgitwill trackchmodand symbolic links for me.Linearized Historygit-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$> 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, bbbecomes this darcs-log* 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 ./aaSee how0d94733 Merge branch 'a'also containsd26d325and0d94733.Usage$> 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.$> 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.$> 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.$> 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.