Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Git core.scm:local_url conf #3801

Merged
merged 5 commits into from
Jul 31, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 10 additions & 1 deletion examples/tools/scm/git/capture_scm/git_capture_scm.rst
Original file line number Diff line number Diff line change
Expand Up @@ -133,7 +133,16 @@ This could be solved by cleaning the repo with ``git clean -xdf``, or by adding
test_package/CMakeUserPresets.json



The capture of coordinates uses the ``Git.get_url_and_commit()`` method, that by default does:

- If the repository is dirty, it will raise an exception
- If the repository is not dirty, but the commit doesn't exist in the remote, it will warn, but it will return the local folder as repo ``url``.
This way, local commits can be tested without needing to push them to the server. The ``core.scm:local_url=allow`` can silence
the warning and the ``core.scm:local_url=block`` will immediately raise an error: This last value can be useful for CI
scenarios, to fail fast and save a build that would have been blocked later in the ``conan upload``.
- Packages built with local commit will fail if trying to upload them to the server with ``conan upload`` as those local commits
are not in the server and then the package might not be reproducible. This upload error can be avoided by setting ``core.scm:local_url=allow``.
- If the repository is not dirty, and the commit exists in the server, it will return the remote URL and the commit.


Credentials management
Expand Down