Skip to content

Add (simple) git support #12350

Open
JabRef/jabref-koppor
#714
@koppor

Description

@koppor

As user, I would like to have a seamless integration in git. For "straight-forward" cases, JabRef should do "magic".

Implementation drivers

  • In case of an error, the file should be in the state before JabRef started to do some wizard thing

Opening a library

  1. When opening a library (.bib file), JabRef checks whether the .bib file is contained in a git repository. If not in a git repository, no further action is done. Otherwise it is tagged as "versioned" (BibDatabaseContext)
  2. JabRef exetues a "git pull" to update the .bib file
  3. If error: notification of error, revert file to previous state
  4. JabRef opens the updated file

Saving of a library

No action taken (to save number of commits)

Saving a library

  1. JabRef saves the .bib file
  2. A git commit is created. git commit message "Automatic update via JabRef".
  3. git pull --rebase is executed. Just execute git pull
  4. In case of an error, revert to commit created at step 2 and try git pull
  5. In case of an error, revert to commit created at step 2 and ouput a notification - and stop
  6. Then, git push
  7. In case of an error, output error - and stop
  8. Output "Successfully pushed"

Advanced implementation

A user might want to trigger pushing

  • Reuse button "synchronize" of shared database. This button has the same functionality as "Saving a library"
  • Let user configure frequency of push. At this frequence, on "Saving a library", a commit and the steps of "Saving a library" are done.

Implementation hints

Metadata

Metadata

Assignees

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions