Skip to content

Commit

Permalink
fix(remote): preserve first time contributors (#925)
Browse files Browse the repository at this point in the history
* fix(remote): preserve first time contributors

* fix: update based on clippy feedback

* docs: add new-contributors back in

* refactor: switch to using time

- add test for timestamp method as well

* refactor: polish implementation

---------

Co-authored-by: Orhun Parmaksız <orhunparmaksiz@gmail.com>
  • Loading branch information
mcwarman and orhun authored Oct 21, 2024
1 parent 2e65a72 commit 99b78b5
Show file tree
Hide file tree
Showing 17 changed files with 265 additions and 27 deletions.
2 changes: 1 addition & 1 deletion .github/fixtures/test-bitbucket-integration/cliff.toml
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ body = """
{% if bitbucket.contributors | filter(attribute="is_first_time", value=true) | length != 0 %}
{% raw %}\n{% endraw -%}
## New Contributors
### New Contributors
{%- endif %}\
{% for contributor in bitbucket.contributors | filter(attribute="is_first_time", value=true) %}
* @{{ contributor.username }} made their first contribution
Expand Down
3 changes: 3 additions & 0 deletions .github/fixtures/test-bitbucket-integration/expected.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,4 +14,7 @@
* fix(args): rename help argument due to conflict by @orhun <orhun@archlinux.org>
* docs(example)!: add tested usage example by @orhun <orhun@archlinux.org>

### New Contributors
* @orhun <orhun@archlinux.org> made their first contribution

<!-- generated by -cliff -->
4 changes: 2 additions & 2 deletions .github/fixtures/test-fixtures-locally.sh
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ export FIXTURES_DIR="$SCRIPT_DIR/$1"

# Set up a temporary repository
cd "$(mktemp -d)"
git init
git init >&2

# Commit
"$FIXTURES_DIR/commit.sh"
Expand All @@ -31,5 +31,5 @@ if [ -n "$MSYSTEM" ] && [ "$MSYSTEM" = "MINGW64" ]; then
fi

# Show results
echo -e "\n---Run git-cliff---"
echo -e "\n---Run git-cliff---" >&2
cargo run --manifest-path "$SCRIPT_DIR/../../Cargo.toml" -- -vv --config "$FIXTURES_DIR/cliff.toml" "${@:2}"
2 changes: 1 addition & 1 deletion .github/fixtures/test-gitea-integration/cliff.toml
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ body = """
{% if gitea.contributors | filter(attribute="is_first_time", value=true) | length != 0 %}
{% raw %}\n{% endraw -%}
## New Contributors
### New Contributors
{%- endif %}\
{% for contributor in gitea.contributors | filter(attribute="is_first_time", value=true) %}
* @{{ contributor.username }} made their first contribution
Expand Down
2 changes: 1 addition & 1 deletion .github/fixtures/test-gitea-integration/expected.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
* feat(config): support multiple file formats by @ThetaDev
* feat(cache): use cache while fetching pages by @ThetaDev

## New Contributors
### New Contributors
* @ThetaDev made their first contribution

<!-- generated by -cliff -->
2 changes: 1 addition & 1 deletion .github/fixtures/test-github-integration/cliff.toml
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ body = """
{% if github.contributors | filter(attribute="is_first_time", value=true) | length != 0 %}
{% raw %}\n{% endraw -%}
## New Contributors
### New Contributors
{%- endif %}\
{% for contributor in github.contributors | filter(attribute="is_first_time", value=true) %}
* @{{ contributor.username }} made their first contribution
Expand Down
3 changes: 3 additions & 0 deletions .github/fixtures/test-github-integration/expected.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,4 +15,7 @@
* fix(args): rename help argument due to conflict by @orhun
* docs(example)!: add tested usage example by @orhun

### New Contributors
* @orhun made their first contribution

<!-- generated by git-cliff -->
2 changes: 1 addition & 1 deletion .github/fixtures/test-gitlab-integration/cliff.toml
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ body = """
{% if gitlab.contributors | filter(attribute="is_first_time", value=true) | length != 0 %}
{% raw %}\n{% endraw -%}
## New Contributors
### New Contributors
{%- endif %}\
{% for contributor in gitlab.contributors | filter(attribute="is_first_time", value=true) %}
* @{{ contributor.username }} made their first contribution
Expand Down
19 changes: 19 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -64,6 +64,7 @@

## New Contributors ❤️

* @nejcgalof made their first contribution in [#853](https://github.com/orhun/git-cliff/pull/853)
* @pplmx made their first contribution in [#824](https://github.com/orhun/git-cliff/pull/824)

## [2.5.0](https://github.com/orhun/git-cliff/compare/v2.4.0..v2.5.0) - 2024-08-24
Expand Down Expand Up @@ -120,11 +121,14 @@

## New Contributors ❤️

* @weichweich made their first contribution in [#807](https://github.com/orhun/git-cliff/pull/807)
* @janbuchar made their first contribution in [#784](https://github.com/orhun/git-cliff/pull/784)
* @oberrich made their first contribution in [#809](https://github.com/orhun/git-cliff/pull/809)
* @tisonkun made their first contribution in [#599](https://github.com/orhun/git-cliff/pull/599)
* @DerTiedemann made their first contribution in [#758](https://github.com/orhun/git-cliff/pull/758)
* @DaniPopes made their first contribution in [#709](https://github.com/orhun/git-cliff/pull/709)
* @artrz made their first contribution in [#779](https://github.com/orhun/git-cliff/pull/779)
* @braineo made their first contribution in [#744](https://github.com/orhun/git-cliff/pull/744)
* @myl7 made their first contribution in [#776](https://github.com/orhun/git-cliff/pull/776)
* @pawamoy made their first contribution in [#774](https://github.com/orhun/git-cliff/pull/774)
* @tonybutt made their first contribution in [#742](https://github.com/orhun/git-cliff/pull/742)
Expand Down Expand Up @@ -205,6 +209,7 @@

## New Contributors ❤️

* @R11baka made their first contribution in [#672](https://github.com/orhun/git-cliff/pull/672)
* @0x61nas made their first contribution in [#669](https://github.com/orhun/git-cliff/pull/669)
* @dark0dave made their first contribution in [#663](https://github.com/orhun/git-cliff/pull/663)
* @antonengelhardt made their first contribution in [#653](https://github.com/orhun/git-cliff/pull/653)
Expand Down Expand Up @@ -299,6 +304,7 @@

## New Contributors ❤️

* @aminya made their first contribution in [#567](https://github.com/orhun/git-cliff/pull/567)
* @jsurkont made their first contribution in [#530](https://github.com/orhun/git-cliff/pull/530)
* @dupuy made their first contribution in [#535](https://github.com/orhun/git-cliff/pull/535)
* @daniel-carr-3000 made their first contribution in [#532](https://github.com/orhun/git-cliff/pull/532)
Expand Down Expand Up @@ -626,8 +632,10 @@
## New Contributors ❤️

* @alexfertel made their first contribution in [#253](https://github.com/orhun/git-cliff/pull/253)
* @tvcsantos made their first contribution
* @beeb made their first contribution in [#167](https://github.com/orhun/git-cliff/pull/167)
* @PSeitz made their first contribution in [#155](https://github.com/orhun/git-cliff/pull/155)
* @alerque made their first contribution in [#142](https://github.com/orhun/git-cliff/pull/142)

## [1.2.0](https://github.com/orhun/git-cliff/compare/v1.1.2..v1.2.0) - 2023-04-28

Expand Down Expand Up @@ -716,8 +724,11 @@

## New Contributors ❤️

* @bors[bot] made their first contribution in [#161](https://github.com/orhun/git-cliff/pull/161)
* @dependabot[bot] made their first contribution
* @mackness made their first contribution in [#157](https://github.com/orhun/git-cliff/pull/157)
* @jackton1 made their first contribution in [#152](https://github.com/orhun/git-cliff/pull/152)
* @radusuciu made their first contribution in [#147](https://github.com/orhun/git-cliff/pull/147)
* @lbowenwest made their first contribution in [#137](https://github.com/orhun/git-cliff/pull/137)
* @jankatins made their first contribution in [#141](https://github.com/orhun/git-cliff/pull/141)
* @saidsay-so made their first contribution in [#140](https://github.com/orhun/git-cliff/pull/140)
Expand Down Expand Up @@ -993,6 +1004,7 @@

## New Contributors ❤️

* @favna made their first contribution in [#83](https://github.com/orhun/git-cliff/pull/83)
* @kaushalmodi made their first contribution in [#80](https://github.com/orhun/git-cliff/pull/80)
* @uyha made their first contribution in [#76](https://github.com/orhun/git-cliff/pull/76)
* @mgrachev made their first contribution in [#73](https://github.com/orhun/git-cliff/pull/73)
Expand All @@ -1011,6 +1023,9 @@
- *(core)* Document timestamp format of `Release` struct ([#67](https://github.com/orhun/git-cliff/issues/67)) - ([d68eb12](https://github.com/orhun/git-cliff/commit/d68eb120c0a0a98bc1e7264a3aede17b5f5c54be))
- *(readme)* Add another option of GitHub Actions ([#64](https://github.com/orhun/git-cliff/issues/64)) - ([db7edf5](https://github.com/orhun/git-cliff/commit/db7edf5707f2bfdf49c749026969fd1833530ed7))

## New Contributors ❤️

* @MarcoIeni made their first contribution in [#67](https://github.com/orhun/git-cliff/pull/67)

## [0.6.0](https://github.com/orhun/git-cliff/compare/v0.5.0..v0.6.0) - 2022-02-12

Expand Down Expand Up @@ -1059,6 +1074,7 @@

## New Contributors ❤️

* @tranzystorekk made their first contribution in [#57](https://github.com/orhun/git-cliff/pull/57)
* @bachp made their first contribution in [#42](https://github.com/orhun/git-cliff/pull/42)

## [0.5.0](https://github.com/orhun/git-cliff/compare/v0.4.2..v0.5.0) - 2021-12-15
Expand Down Expand Up @@ -1104,6 +1120,9 @@
- *(fixtures)* Run test fixtures on ubuntu-latest - ([dea65f2](https://github.com/orhun/git-cliff/commit/dea65f235e2091001d8de41794bf3c98a7223917))
- *(fixtures)* Improve the workflow for test fixtures - ([92a54d6](https://github.com/orhun/git-cliff/commit/92a54d67b825b53b6993a769ea9d5cf37ea2e43e))

## New Contributors ❤️

* @kenji-miyake made their first contribution in [#40](https://github.com/orhun/git-cliff/pull/40)

## [0.4.2](https://github.com/orhun/git-cliff/compare/v0.4.1..v0.4.2) - 2021-10-22

Expand Down
1 change: 1 addition & 0 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions git-cliff-core/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -77,6 +77,7 @@ url.workspace = true
dyn-clone = "1.0.17"
urlencoding = "2.1.3"
cacache = { version = "13.0.0", features = ["mmap"], default-features = false }
time = "0.3.36"

[dependencies.git2]
version = "0.19.0"
Expand Down
Loading

0 comments on commit 99b78b5

Please sign in to comment.