Skip to content

Commit cae4946

Browse files
memshardedAbrilRBS
andauthored
Git core.scm:local_url conf (#3801)
* Git core.scm:local_url conf * Update examples/tools/scm/git/capture_scm/git_capture_scm.rst Co-authored-by: Abril Rincón Blanco <git@rinconblanco.es> * Update examples/tools/scm/git/capture_scm/git_capture_scm.rst Co-authored-by: Abril Rincón Blanco <git@rinconblanco.es> * Update examples/tools/scm/git/capture_scm/git_capture_scm.rst Co-authored-by: Abril Rincón Blanco <git@rinconblanco.es> * Update examples/tools/scm/git/capture_scm/git_capture_scm.rst Co-authored-by: Abril Rincón Blanco <git@rinconblanco.es> --------- Co-authored-by: Abril Rincón Blanco <git@rinconblanco.es>
1 parent d2aae83 commit cae4946

File tree

1 file changed

+10
-1
lines changed

1 file changed

+10
-1
lines changed

examples/tools/scm/git/capture_scm/git_capture_scm.rst

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -133,7 +133,16 @@ This could be solved by cleaning the repo with ``git clean -xdf``, or by adding
133133
test_package/CMakeUserPresets.json
134134
135135
136-
136+
The capture of coordinates uses the ``Git.get_url_and_commit()`` method, that by default does:
137+
138+
- If the repository is dirty, it will raise an exception
139+
- 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``.
140+
This way, local commits can be tested without needing to push them to the server. The ``core.scm:local_url=allow`` can silence
141+
the warning and the ``core.scm:local_url=block`` will immediately raise an error: This last value can be useful for CI
142+
scenarios, to fail fast and save a build that would have been blocked later in the ``conan upload``.
143+
- Packages built with local commit will fail if trying to upload them to the server with ``conan upload`` as those local commits
144+
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``.
145+
- If the repository is not dirty, and the commit exists in the server, it will return the remote URL and the commit.
137146

138147

139148
Credentials management

0 commit comments

Comments
 (0)