Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

What is the proper way to script darcs?

Tags:

darcs

I have a few different darcs repos and I would like to write a script to automatically push changes from these repos at the end of the day. I read at this thread that the "right" way to script darcs is using the library. But here http://darcs.net/Library it says that "it is very much a work in progress" and lacks a stable API. What is the "right" way to script darcs.

like image 258
cwitte Avatar asked Aug 06 '12 15:08

cwitte


1 Answers

It's perfectly fine to script everyday darcs commands, like any other command-line program. It's also fine to script interactive darcs commands, but that's where it gets fragile, because those interactive prompts get refined and changed quite often in new darcs releases. So if at all possible, make the command non-interactive, eg using the -a/--all flag. Push and pull is easy, here's a regular pull that I run from /etc/crontab:

*/15 * * * * darcsden  cd /home/darcsden/darcs/darcs-reviewed; darcs pull -a http://darcs.net/reviewed >/dev/null # 2>&1

but watch out for things that can prevent a successful non-interactive push or pull:

  • conflicts, especially with unrecorded changes
  • wrong user/file ownership/file permissions
  • stray _darcs/lock file left over from an abnormal termination
like image 179
Simon Michael Avatar answered Sep 22 '22 15:09

Simon Michael