lauriii / drupalcores

A project to generate a list of core contributers
http://drupalcores.com
MIT License
27 stars 38 forks source link

Ensure origin/HEAD is pointing to the correct branch #113

Closed alexpott closed 6 years ago

alexpott commented 6 years ago

On an existing checkout origin/HEAD is not necessarily up-to-date. We need to update it in order to ensure we are pointing to the correct default remote branch. The default remote branch is updated on every Drupal 8 minor release so atm it is 8.5.x which is the probably okay to calculate from. At least it will auto-update. That said it does mean that some commits will not be counted until the 8.6.0 is released.

alexpott commented 6 years ago

Note that https://github.com/lauriii/drupalcores/pull/114 is probably a better approach that keeps us on the latest dev branch. This will only manage the latest stable branch.

fuzzbomb commented 6 years ago

I was about to open this, but you beat me to it.

This will only manage the latest stable branch.

Turns out the origin/HEAD ref is normally only set on during the initial clone. A fresh clone today DOES set origin/HEAD to 8.6.x, as does git remote set-head origin -a Drupalcores.com seems to be building from 8.2.x currently, going by my counts.

alexpott commented 6 years ago

Weird when I first tried it was setting it to 8.5.x - now it's 8.6.x so this approach is good.

fuzzbomb commented 6 years ago

I guess that origin/HEAD follows whatever is set as the default branch in the drupal.org project settings?

Most of the time we'll have two branches in play, say 8.5.x is stable, and 8.6.x development branch is marked as origin/HEAD

But when we reach 8.6.x alpha release, we'll have three branches in play: 8.5.x stable, 8.6.x marked as origin/HEAD, and 8.7.x open. So there'll be a month during each release cycle where where counts aren't fully up to date, but so many commits are cherry-picked backwards that the discrepancy will small. I think we can live with that.

lauriii commented 6 years ago

Looks good! I really like the fact that this removes the need to manually update the branch. Thank you all!

claudiu-cristea commented 5 years ago

This doesn't seem to work. The script still shows credits from 8.6.x branch while we're now on 8.8.x.

fuzzbomb commented 5 years ago

It's because origin/HEAD points to origin/8.6.x.

This PR removed the need to update the branchname in drupalcores, but it assumes that the latest dev branch is set as origin/HEAD on drupal.org

That was the case up until the 8.7.x branch.

The trouble is, we're relying on someone to set the active branch somewhere (this repo, or the drupal core repo) and it looks like neither is reliable.

Other ideas:

alexpott commented 5 years ago

I've changed the default branch to 8.8.x - it should be the dev branch.