maebert/jrnl — pull request #292 by gcgoogle (2014-10-11 00:45:52+00:00)
Title: Added support for importing entries

Hi! This pull adds --import support to jrnl, which lets the user import entries into the current journal from either stdin or another journal (if -i is specified). It does not import duplicate entries (defined to be entries with both the same date and content), which means that it provides a safe way to merge two journals.

This functionality is important to me because I put my journal.txt into a Dropbox and update it on multiple computers, and occasionally there is a conflict which results in multiple versions of journal.txt. Using --import I can easily resolve the conflict by importing journal entries from the conflicting version of journal.txt into the main journal.txt file.

Also, I designed --import so that plays nicely with --export and --edit; this was done not out of an immediate need but because part of the philosophy behind jrnl seems to be that the user should be able to ask for whatever they want in any combination and we should do our best to grant it.