Replies: 4 comments 7 replies
-
There are various approaches to using branches in Git. For us, the fact that one release stream = one CTAN package means that we've tended to stick to just a single ( |
Beta Was this translation helpful? Give feedback.
-
Hello! 😉 I would favour the following scheme:
We do this approach at IoT and I must say it works wonders. I personally do not mind having other branches (that's why they exist, for experimenting things). The only thing I would be boring and demanding is regarding work flows: new branches can be merged into Also, at IoT we use the format proposed at Keep a changelog for, well, our changelogs. See, for instance, this example for |
Beta Was this translation helpful? Give feedback.
-
IMO that's a recipe for unnecessary complications. If you don't know much about |
Beta Was this translation helpful? Give feedback.
-
Both approaches seem much more complicated than necessary. While creating a PR, you can just select which branch you want to target.
IMO we shouldn't recommend to squash commits before creating a PR. Of course a nicely rewritten commit history can make a PR more readable, but if we advice new git users to squash their history it just means that it gets harder to separate changes later. If the history really needs some cleaning up, we can always do that by ourselves while merging.
I would go a step further and say that if the PR really aims to solve an issue, it should reference it with "Solved" or another one of the magic keywords. |
Beta Was this translation helpful? Give feedback.
-
Here are 2 articles concerning the Fork-and-Branch workflow where they explain how git can be used in practice. Below are some of their ideas that I find useful, most of them are listed for the record with a personal POV. The main point would be the "Create base develop branch" section.
In particular, the latter's Whole workflow example in a nutshell (at the page bottom) seems helpful. Here is copy annotated with ideas from the former article.
Fork-and-Branch workflow
Some of next CLI commands may be integrate to GitHub, your favorite IDE, GitHub desktop, VScode.
Initialize new repository
done: this is latex3/l3build repository
Create base develop branch
Missing
I vote for two development branches:
dev
for short term changesfuture
for long term changesFork repository
fork
button, and follow the instructionsNext instructions concern the fork
Clone your fork locally:
Or from your fork
https://github.com/[user-name]/l3build
click the green download code button, it should open GitHub desktop when available.Add upstream remote:
With GitHub desktop, this may help at least OSX users
Create feature branch diverged from develop branch:
or
[branch-name]
could befeature-
something when related to a well defined feature.Get your work done and commit it to your repository:
Integrated in some IDEs.
Create pull request to main repository
In the forked repository or with your local IDE capabilities.
This SO question explains how to target a pull request to a specific branch:
If the pull request would contain to many commits, a
git rebase
can “squash the commit history”.More details in this article.
If the pull request aims at solving an issue, the issue number should appear in the pull request.
Ask someone or wait for code review
This happens in the main repository. It may need some time
Fix your issues or conflicts if there are any
Change the forked code and commit changes, they will update the pull request accordingly
Get your code merged to the main repository
If nothing went wrong!
When it is time, merge develop branch to release branch by creating a pull request or merging it manually:
In the main repository
Enter the fix state
Beta Was this translation helpful? Give feedback.
All reactions