ref-format should take precedence over `--from bibtex`
I have in my .config/papis/config
[settings]
ref-format = '{doc[author_list][0][family]!l}{doc[year]}'
When I run papis add --from bibtex test.bib, the ref field is set to the one in the test.bib file, and not re-generated according to ref-format. ref-format works correctly when adding from doi, isbn, etc.
So for example if test.bib is
@article{lewis1993many,
title={Many, but almost one},
author={Lewis, David},
journal={Ontology, causality and mind},
pages={23--42},
year={1993},
publisher={Cambridge University Press Cambridge}
}
then the generated document has lewis1993many as the ref, instead of lewis1993, which is what I would expect given my ref-format.
There should at the very least be a setting (ref-format-rewrite or something) to toggle this behavior.
I would argue that the correct default behavior is to follow ref-format no matter what, and the flag should switch back to the current behavior. In my opinion, if I have gone to the length of setting ref-format, it's because I want all my references to follow the same format, and just because I imported from bibtex should not change that.
I cannot really imagine why someone would want the current behavior (maybe to have the bibtex export correspond to the import, given no other changes?), but that should be a flag.
Having run into this as well a bunch of times, I totally agree. ref-format should take precedence. I don't think we'd need to make this configurable either since I think users want their refs to be consistent. We have more than enough configuration options as it is 😅. (Or am I missing some use case?)
I opened a PR to fix this.
In the PR, there is no way of keeping the "source" ref field, so it's updated no matter what.