-
Notifications
You must be signed in to change notification settings - Fork 37
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add entry manually in dependant database, automatically updating master #215
Comments
I agree, this would be a nice thing to have. It shouldn't be too difficult to implement, either. The new entry could be added to the main database first and then included in the dependent, where it can then be edited. I also agree that this would be a good use of the prefix argument. If you find time to implement this, feel free to do so. |
This issue seems to be about using As an example, suppose that on my computer I have a Is the proper remedy to merge |
Merging is indeed the way to go: you can merge a dependent database as if it's a normal database. Entries with duplicate keys are logged but not loaded twice, so that case is handled. The entries that your collaborator adds are merged into By default, entries are only identified by key, though, so if your collaborator adds an entry that is already in the database but uses a different key for it, it won't be recognised as duplicate. ( |
This might point to a way to solve both issues at once. If merging for out-of-sync dependent databases could be handled succesfully, then my original feature request would be pretty simple to implement. Adding a new entry (in ebib) to a dependent database would work in exactly the same way as adding to an independent one, but then to include it in both one would just merge. Perhaps the easiest way to do this would be to add an Then I could add a new entry to my dependent database and save the database (as in my standard workdlow) and have the upstream file updated automatically. (There would be some vagueries to do with unsaved changes and merging in the upstream db. If the master db is open and has unsaved changes, then to get the dependent db's changes would requie a reload, which would overwrite them. So maybe in that case the master should be force-saved before the merge, and maybe force-reloaded after it, so that everything is obviously in sync? I for one would go so far as to implement this myself (with hooks and advice) if it wasn't part of the core, but it might not be for everyone) |
Actually, I think for the case of adding an entry from within Ebib there is no need to use the merge functionality. All that's needed is to check whether the user is adding an entry to a dependent database, create the entry in the main database instead and then add it to the dependent. Most of that functionality already exists, all that's needed is a bit of glue code and perhaps some very simple refactoring (e.g., For the case where the dependent If I find some time, I'll look into this, but of course I'll also take a PR. :-) |
I'm working on an paper. I have a dependant database in the same folder as the paper itself, to make keeping track of the specific literature easier. I keep everything I read in my master database though, because I don't want my overall reading to get fractured over time -- you never know when something might be relevant to another project down the line.
So I spend most of my time in ebib looking at the dependant database. While searching for literature, I want to add what I find as quickly as possible. The most obvious way for me seems to be add in the normal way to the dependant database (not by pulling it in from a master, because the entry is new to both databases, but by typing in the values), and for ebib to update the master database accordingly. I can't see a way to do this at the moment without switching and doing the actual adding of the new entry in the master. I can edit the already existing entries in the dependant database, so presumably syncing information between the two is something ebib can handle.
I would be happy to have a look at implementing this if you think it would be a good idea. Perhaps (in anaolgy with the prefix argument for editting a field), adding a prefix argument to a in the dependant database could allow me to add an entry manually?
The text was updated successfully, but these errors were encountered: