Merge

Merge two documents that might be potentially duplicated.

If your Papis picker does not support selecting two items, then pass the --pick flag to pick twice from the documents.

Examples

  • Pick the duplicate documents:

    papis merge "prediction and subs"
    
    /papers/de8d6373a8cef74b5245124ddb288d45-dejong-gerald
    /papers/0e378c330dba4a4483660388183aa648-dejong-gerald
    

    With the default picker and config, you can pick the two offending documents with CTRL+T The selected entries will have a # in the beginning of the document title.

    Papis will show the difference between the files and let you select which ones you want to keep:

    - collections: ['t3']
    + collections: ['t3', 't3a2']
    

    The lines are prefixed by an indication of what will happen on accepting the change. Papis will remove lines prefixed with a minus sign and add those with a plus sign.

  • Merge the documents that match the query “prediction and subs” and commit the changes to git:

    papis merge --git "prediction and subs"
    
  • Choose which documents to keep:

    papis merge --keep "belief revision"
    

    After deciding which changes to apply, Papis will prompt for files that should be moved to the resulting location. The files can be chosen entering the numbers that precede the documents.

Command-line Interface

Merge two documents from a given library

papis merge [OPTIONS] [QUERY]

Options

-h, --help

Show this message and exit.

--sort <FIELD>

Sort documents with respect to the FIELD

--reverse

Reverse sort order

-s, --second

Keep the second document after merge and erase the first, the default is keep the first

-p, --pick

If your picker does not support picking two documents at once, call twice the picker to get two documents

-k, --keep

Do not erase any document

-o, --out <out>

Create the resulting document in this path

--git, --no-git

Merge in git

Arguments

QUERY

Optional argument