1
1
mirror of https://github.com/orhun/git-cliff.git synced 2024-11-25 09:02:10 +03:00
git-cliff/CONTRIBUTING.md
Paul Campbell 2e65a72bb0
test(git): find upstream remote when using ssh (#926)
* feat: find upstream remote when using ssh

The `upstream_remote` function was relying on `url::Url::parse` to extract the `owner` and `repo` from the `url`. But that only works when the repo is cloned using a URL, e.g. `https://github.com/orhun/git-cliff.git`. However, this would fail to parse when cloned using SSH, e.g. `git@github.com:orhun/git-cliff.git`.

If the url::URL::parser fails, we now try to parse an SSH remote in the format `git@hostname:owner/repo.git`.

The error from `upstream_remote` also notes that a posible reason for it failing would be that the `HEAD` is detached.

* Update git-cliff-core/src/repo.rs

* Update git-cliff-core/src/repo.rs

---------

Co-authored-by: Orhun Parmaksız <orhunparmaksiz@gmail.com>
2024-10-21 23:29:39 +03:00

2.4 KiB

Contributing

Thank you for considering contributing to git-cliff!

When contributing, please first discuss the change you wish to make via issue, email, or any other method with the owners of this repository before making a change.

Note that we have a Code of Conduct, please follow it in all your interactions with the project.

Setup

  1. Fork this repository and create your branch from main.

  2. Clone your forked repository.

git clone https://github.com/{username}/git-cliff && cd git-cliff
# OR
git clone git@github.com:{username}/git-cliff && cd git-cliff

To ensure the successful execution of the tests, it is essential to fetch the tags as follows:

git fetch --tags https://github.com/orhun/git-cliff
  1. Make sure that you have Rust 1.64.0 or later installed and build the project.
cargo build
  1. Start committing your changes. Follow the conventional commit specification while doing so.

  2. Add your tests (if you haven't already) or update the existing tests according to the changes. And check if the tests are passed.

cargo test
  1. If needed, update the snapshot tests (i.e. tests using expect_test):
env UPDATE_EXPECT=1 cargo test
  1. Make sure rustfmt and clippy don't complain about your changes.

We use the nightly channel for rustfmt so please set the appropriate settings for your editor/IDE for that.

Create a Pull Request

  1. Ensure that you updated the documentation and filled the Pull Request template according to the changes you made.

  2. Wait for approval from the project owner/maintainer. Discuss the possible changes and update your Pull Request if necessary.

  3. You may merge the Pull Request once you have the sign-off of the project owner/maintainer, or if you do not have permission to do that, you may request the project owner/maintainer to merge it in case they haven't done it after a while.

License

By contributing, you agree that your contributions will be licensed under The MIT License or Apache License 2.0.