Skip to content

Allow configuration of git PAT#14509

Merged
koppor merged 7 commits intomainfrom
add-git-pat-config-option
Dec 4, 2025
Merged

Allow configuration of git PAT#14509
koppor merged 7 commits intomainfrom
add-git-pat-config-option

Conversation

@koppor
Copy link
Copy Markdown
Member

@koppor koppor commented Dec 3, 2025

Currently, the git credentials are only availble when connecting to GitHub. To re-use an existing connection, one needs to configure git credentials somehow. This PR does it.

Follow-up:

  • Support for multiple git providers - currently, it is possible to store a single username/pat
  • Support for SSH - this seems to be a bigger issue
grafik

Steps to test

  1. Greate a Git repo at your provider of choice. I used gitlab
  2. Clone this repo (use http - NOT ssh)
  3. Create a PAT
  4. Start this PR (gg.cmd just run-pr xyz)
  5. Go to preferences -> Network
  6. Configure username and password
  7. Save .bib file in the git repo
  8. File -> Git commit
  9. File -> Git push
  10. Check page of Git provider -> bib is there

Mandatory checks

- Use JabRefException instead of customized IOExceptions
- Refine conditions for actions
- Some code reformatting
- enable changing git username and pat in Network Preferences
- rename "passwort" to "pat"
- adapt casing of headings in Network Preferences
.filter(context -> context.getLocation() == DatabaseLocation.LOCAL)
.map(context ->
context.getDatabasePath()
.flatMap(path -> Injector.instantiateModelOrService(GitHandlerRegistry.class)
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This really looks hacky here, is there no better way?

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It was in the old code already... I can take a look later.

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Could lead to 50+ changes, because of passing through all it and handling it in StateManager probably. This cache is a global variable for the GUI.

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Could lead to 50+ changes, because of passing through all it and handling it in StateManager probably. This cache is a global variable for the GUI.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

then just fix the faling tests checkstyle

Siedlerchr
Siedlerchr previously approved these changes Dec 3, 2025
@koppor koppor enabled auto-merge December 3, 2025 23:13
@koppor koppor requested a review from Siedlerchr December 3, 2025 23:13
@koppor koppor added this pull request to the merge queue Dec 4, 2025
Merged via the queue into main with commit aa92a8f Dec 4, 2025
53 checks passed
@koppor koppor deleted the add-git-pat-config-option branch December 4, 2025 11:36
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants