Skip to content
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

Use bibtool to format publication list. #391

Merged
merged 2 commits into from
Sep 8, 2022
Merged

Conversation

marcfehling
Copy link
Member

@marcfehling marcfehling commented Sep 7, 2022

On the weekend I looked around existing solutions to format bib files. I was specifically looking for tools that allow us to sort entries and generate citekeys as this would help maintaining the list. I see the following benefits:

  • We won't have trouble with merge conflicts of concurrent PRs as all bibtex entries will be placed at the correct spot
  • We can easily identify duplicates if the citekey of each entry is generated uniquely from its fields (e.g. author, title).
  • Globally uniform indentation as eye candy

I found that multiple tools to sort bib files exist. biber in tool-mode is capable, but translates all entries from the bibtex to the biblatex format. As we want to maintain compatibility, I instead opted to use the well-established bibtool (github), which was developed somewhen in the 90s and is still maintained. It is part of the ubuntu repositories as well as archlinux and possibly others.

So far, I've only added the citekey generation and adjustment of indentation to the bibtool configuration to show you that bibtool really only adjusts the formatting. I want to add the sorting mechanism in a follow-up PR (or add it as a separate commit to this one).

I introduced a Makefile target sort so that users can easily apply the formatting. To make sure all PRs conform to the format, I've also added a new sort stage to the CI.

What is your opinion?

@tjhei -- If you agree to that mechanism, could you make sure that bibtool is installed on the system you run the CI on?

@bangerth
Copy link
Member

bangerth commented Sep 8, 2022

I like the idea, though I will note that that means that everyone who adds an entry also has to have bibtool installed -- this just increases the threshold for people to be able to add entries.

It would be an alternative to just add this to make sort and do it periodically, rather than on every pull request.

@marcfehling
Copy link
Member Author

I like the idea, though I will note that that means that everyone who adds an entry also has to have bibtool installed -- this just increases the threshold for people to be able to add entries.

It is true that it increases the threshold, but this puts again more maintenance responsibilities on our side as we will not be able to identify duplicates before merging PRs. Plus, it might still happen that we get merge conflicts of concurring PRs.

This threshold is not negligible, but in my opinon very small as bibtool is practically available in repositories of any OS (even macos).

@tjhei
Copy link
Member

tjhei commented Sep 8, 2022

I think Wolfgang's comment makes sense, but I am not 100% opposed to this PR.

could you make sure that bibtool is installed on the system you run the CI on?

I will need to update the docker image...

as bibtool is practically available in repositories of any OS (even macos).

What repository on macOS are you talking about, homebrew?

@marcfehling
Copy link
Member Author

marcfehling commented Sep 8, 2022

I think Wolfgang's comment makes sense, but I am not 100% opposed to this PR.

I can also remove the CI part, and we can address this in a separate PR (see #392).

What repository on macOS are you talking about, homebrew?

Yes, I found it in homebrew but also macports. Furthermore, it is available on various linux distributions (including ubuntu and thus WSL).

I can prepare a wiki entry for installing bibtool, but then we need a wiki for this repository first. I think only owners of the dealii group can do this.

EDIT: First draft of wiki entry: bibtool.md

README.md Outdated Show resolved Hide resolved
Copy link
Member

@bangerth bangerth left a comment

Choose a reason for hiding this comment

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

OK to merge if you remove the changes to the readme.

@marcfehling
Copy link
Member Author

OK to merge if you remove the changes to the readme.

Done. I would appreciate if we would merge this PR after #390 though.

@bangerth
Copy link
Member

bangerth commented Sep 8, 2022

OK, you'll have to rebase now.

@marcfehling marcfehling force-pushed the bibtool branch 2 times, most recently from dcc11eb to b6b6a22 Compare September 8, 2022 23:35
@marcfehling
Copy link
Member Author

I've added installation instructions for bibtool to the readme. If make sort does not find bibtool, it will output a link to the installation isntructions in the readme.

This PR is now okay to be merged from my side.

@bangerth bangerth merged commit 82b51fb into dealii:master Sep 8, 2022
@marcfehling marcfehling deleted the bibtool branch September 8, 2022 23:55
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.

3 participants