Skip to content

Instantly share code, notes, and snippets.

@bitplane
Last active November 11, 2024 04:24
Show Gist options
  • Save bitplane/a1c8c1dd3ceee3af652eb1049f146581 to your computer and use it in GitHub Desktop.
Save bitplane/a1c8c1dd3ceee3af652eb1049f146581 to your computer and use it in GitHub Desktop.
Gecko commits 2007-2024
git clone [email protected]:mozilla/gecko-dev.git
cd gecko-dev
for year in $(seq 2007 2024); do
echo $year
git log --since="$year-01-01" --until="$year-12-31" --pretty=format:"%ae" | tr '[:upper:]' '[:lower:]' > $year.txt
done
blacklist="grep -Ev [email protected]|[email protected]|automation\-bot"
echo year total_commits mozilla_commits
for year in $(seq 2007 2024); do
echo $year $(cat $year.txt | $blacklist | wc -l) $(cat $year.txt | $blacklist | grep '@mozilla' | wc -l);
done
echo year total_contributors mozilla_contributors
for year in $(seq 2007 2024); do
echo $year $(cat $year.txt | sort -u | $blacklist | wc -l) $(cat $year.txt | $blacklist | sort -u | grep '@mozilla' | wc -l)
done
import matplotlib.pyplot as plt
# Data for commits by year
years = [
2007, 2008, 2009, 2010, 2011, 2012, 2013, 2014, 2015, 2016,
2017, 2018, 2019, 2020, 2021, 2022, 2023, 2024
]
total_commits = [
13233, 14598, 15109, 19583, 19730, 32129, 41207, 44637, 45864, 28700,
56939, 45857, 59875, 49168, 41706, 46735, 45044, 37388
]
mozilla_commits = [
1275, 4106, 5025, 7573, 7947, 15806, 21223, 22605, 22057, 14057,
27628, 22556, 30812, 26879, 20166, 27260, 24509, 21809
]
# Plotting total commits and Mozilla-specific commits by year
plt.figure(figsize=(12, 6))
plt.plot(years, total_commits, label='Total Commits', marker='o')
plt.plot(years, mozilla_commits, label='Mozilla Commits', marker='s')
# Adding labels and title
plt.xlabel("Year")
plt.ylabel("Commits")
plt.title("Commits by Year")
plt.legend()
plt.grid(True)
# Display the plot
plt.show()
# Data for contributors by year
total_contributors = [
335, 394, 500, 540, 662, 855, 1100, 1371, 1391, 1141,
1270, 1356, 1545, 1283, 1180, 1128, 1158, 1087
]
mozilla_contributors = [
27, 68, 98, 118, 181, 262, 314, 366, 357, 282,
349, 309, 340, 288, 247, 261, 265, 294
]
# Plotting total contributors and Mozilla-specific contributors by year
plt.figure(figsize=(12, 6))
plt.plot(years, total_contributors, label='Total Contributors', marker='o')
plt.plot(years, mozilla_contributors, label='Mozilla Contributors', marker='s')
# Adding labels and title
plt.xlabel("Year")
plt.ylabel("Contributors")
plt.title("Contributors by Year")
plt.legend()
plt.grid(True)
# Display the plot
plt.show()
# Function to generate updated ASCII chart with "Mozilla" first in one character and "Other" in another
def generate_swapped_ascii_chart(total_data, mozilla_data, label, max_width=50):
max_value = max(total_data)
scale = max_width / max_value
chart = f"{label}:\n"
for year, total, mozilla in zip(years, total_data, mozilla_data):
mozilla_bar = '▓' * int(mozilla * scale)
other_bar = '░' * int((total - mozilla) * scale) # Use light gray '░' for other contributions
chart += f"{year} | {mozilla_bar}{other_bar} ({mozilla} - Mozilla, {total - mozilla} - Non-Mozilla)\n"
return chart
# Generate swapped ASCII charts for commits and contributors
ascii_swapped_commits = generate_swapped_ascii_chart(total_commits, mozilla_commits, "Commits by Year")
ascii_swapped_contributors = generate_swapped_ascii_chart(total_contributors, mozilla_contributors, "Contributors by Year")
# Display swapped ASCII charts
ascii_swapped_chart = "\n\n".join([ascii_swapped_commits, ascii_swapped_contributors])
ascii_swapped_chart
plot please. "commits by year"
year total mozilla
2007 13233 1275
2008 14598 4106
2009 15109 5025
2010 19583 7573
2011 19730 7947
2012 32129 15806
2013 41207 21223
2014 44637 22605
2015 45864 22057
2016 28700 14057
2017 56939 27628
2018 45857 22556
2019 59875 30812
2020 49168 26879
2021 41706 20166
2022 46735 27260
2023 45044 24509
2024 37388 21809
contributors by year. same again please
year total mozilla
2007 335 27
2008 394 68
2009 500 98
2010 540 118
2011 662 181
2012 855 262
2013 1100 314
2014 1371 366
2015 1391 357
2016 1141 282
2017 1270 349
2018 1356 309
2019 1545 340
2020 1283 288
2021 1180 247
2022 1128 261
2023 1158 265
2024 1087 294
ok, render to ascii art please
Commits by Year:
2007 | ▓░░░░░░░░░ (1275 - Mozilla, 11958 - Non-Mozilla)
2008 | ▓▓▓░░░░░░░░ (4106 - Mozilla, 10492 - Non-Mozilla)
2009 | ▓▓▓▓░░░░░░░░ (5025 - Mozilla, 10084 - Non-Mozilla)
2010 | ▓▓▓▓▓▓░░░░░░░░░░ (7573 - Mozilla, 12010 - Non-Mozilla)
2011 | ▓▓▓▓▓▓░░░░░░░░░ (7947 - Mozilla, 11783 - Non-Mozilla)
2012 | ▓▓▓▓▓▓▓▓▓▓▓▓▓░░░░░░░░░░░░░ (15806 - Mozilla, 16323 - Non-Mozilla)
2013 | ▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓░░░░░░░░░░░░░░░░ (21223 - Mozilla, 19984 - Non-Mozilla)
2014 | ▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓░░░░░░░░░░░░░░░░░░ (22605 - Mozilla, 22032 - Non-Mozilla)
2015 | ▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓░░░░░░░░░░░░░░░░░░░ (22057 - Mozilla, 23807 - Non-Mozilla)
2016 | ▓▓▓▓▓▓▓▓▓▓▓░░░░░░░░░░░░ (14057 - Mozilla, 14643 - Non-Mozilla)
2017 | ▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓░░░░░░░░░░░░░░░░░░░░░░░░ (27628 - Mozilla, 29311 - Non-Mozilla)
2018 | ▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓░░░░░░░░░░░░░░░░░░░ (22556 - Mozilla, 23301 - Non-Mozilla)
2019 | ▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓░░░░░░░░░░░░░░░░░░░░░░░░ (30812 - Mozilla, 29063 - Non-Mozilla)
2020 | ▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓░░░░░░░░░░░░░░░░░░ (26879 - Mozilla, 22289 - Non-Mozilla)
2021 | ▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓░░░░░░░░░░░░░░░░░ (20166 - Mozilla, 21540 - Non-Mozilla)
2022 | ▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓░░░░░░░░░░░░░░░░ (27260 - Mozilla, 19475 - Non-Mozilla)
2023 | ▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓░░░░░░░░░░░░░░░░░ (24509 - Mozilla, 20535 - Non-Mozilla)
2024 | ▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓░░░░░░░░░░░░░ (21809 - Mozilla, 15579 - Non-Mozilla)
Contributors by Year:
2007 | ░░░░░░░░░ (27 - Mozilla, 308 - Non-Mozilla)
2008 | ▓▓░░░░░░░░░░ (68 - Mozilla, 326 - Non-Mozilla)
2009 | ▓▓▓░░░░░░░░░░░░░ (98 - Mozilla, 402 - Non-Mozilla)
2010 | ▓▓▓░░░░░░░░░░░░░ (118 - Mozilla, 422 - Non-Mozilla)
2011 | ▓▓▓▓▓░░░░░░░░░░░░░░░ (181 - Mozilla, 481 - Non-Mozilla)
2012 | ▓▓▓▓▓▓▓▓░░░░░░░░░░░░░░░░░░░ (262 - Mozilla, 593 - Non-Mozilla)
2013 | ▓▓▓▓▓▓▓▓▓▓░░░░░░░░░░░░░░░░░░░░░░░░░ (314 - Mozilla, 786 - Non-Mozilla)
2014 | ▓▓▓▓▓▓▓▓▓▓▓░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░ (366 - Mozilla, 1005 - Non-Mozilla)
2015 | ▓▓▓▓▓▓▓▓▓▓▓░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░ (357 - Mozilla, 1034 - Non-Mozilla)
2016 | ▓▓▓▓▓▓▓▓▓░░░░░░░░░░░░░░░░░░░░░░░░░░░ (282 - Mozilla, 859 - Non-Mozilla)
2017 | ▓▓▓▓▓▓▓▓▓▓▓░░░░░░░░░░░░░░░░░░░░░░░░░░░░░ (349 - Mozilla, 921 - Non-Mozilla)
2018 | ▓▓▓▓▓▓▓▓▓▓░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░ (309 - Mozilla, 1047 - Non-Mozilla)
2019 | ▓▓▓▓▓▓▓▓▓▓▓░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░ (340 - Mozilla, 1205 - Non-Mozilla)
2020 | ▓▓▓▓▓▓▓▓▓░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░ (288 - Mozilla, 995 - Non-Mozilla)
2021 | ▓▓▓▓▓▓▓░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░ (247 - Mozilla, 933 - Non-Mozilla)
2022 | ▓▓▓▓▓▓▓▓░░░░░░░░░░░░░░░░░░░░░░░░░░░░ (261 - Mozilla, 867 - Non-Mozilla)
2023 | ▓▓▓▓▓▓▓▓░░░░░░░░░░░░░░░░░░░░░░░░░░░░ (265 - Mozilla, 893 - Non-Mozilla)
2024 | ▓▓▓▓▓▓▓▓▓░░░░░░░░░░░░░░░░░░░░░░░░░ (294 - Mozilla, 793 - Non-Mozilla)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment