aboutsummaryrefslogtreecommitdiff
path: root/guix/git.scm
Commit message (Collapse)AuthorAge
* Autoload (gcrypt hash).Ludovic Courtès2024-04-15
| | | | | | | * guix/derivations.scm: Autoload (guix utils) and (gcrypt hash). * guix/git.scm, guix/store.scm: Autoload (gcrypt hash). Change-Id: I6145231d41c61f2d8c36e28f29e91074910bdd15
* Autoload (guix build syscalls).Ludovic Courtès2024-04-15
| | | | | | | | * guix/discovery.scm, guix/git.scm, guix/nar.scm, guix/scripts.scm, guix/scripts/build.scm: Autoload (guix build syscalls). * guix/packages.scm: Autoload (guix build utils). Change-Id: Ia7703b5f46e55fbfadff63b13c35bfe097ce2220
* git: Add ‘tag->commit’ and use it in (guix channels).Ludovic Courtès2024-04-15
| | | | | | | | | * guix/git.scm (tag->commit): New procedure, taken from… (resolve-reference): … here. Use it in the ‘tag’ case. * guix/channels.scm (resolve-channel-news-entry-tag): Use ‘tag->commit’ instead of custom code. Change-Id: I46ea387345dc1b695ce0702991a52d0cde29e2f0
* channels: Move ‘commit-short-id’ to (guix git).Ludovic Courtès2024-04-15
| | | | | | | * guix/channels.scm (commit-short-id): Move to… * guix/git.scm (commit-short-id): … here. Change-Id: If4b34b1d82b1aa5068d157f26e57e8aecc967061
* git: Add ‘repository-info’ and use it in (guix channels).Ludovic Courtès2024-04-15
| | | | | | | | * guix/git.scm (repository-info): New procedure. * guix/channels.scm (repository->guix-channel): Use it instead of local code. Change-Id: I74c758c73a22e16031571ca4271cc9cab0492f6e
* git: Shell out to ‘git gc’ when necessary.Ludovic Courtès2023-11-22
| | | | | | | | | | | Fixes <https://issues.guix.gnu.org/65720>. This fixes a bug whereby libgit2-managed checkouts would keep growing as we fetch. * guix/git.scm (packs-in-git-repository, maybe-run-git-gc): New procedures. (update-cached-checkout): Use it.
* guix: Properly compute progress bar width.Julien Lepiller2023-11-11
| | | | | | | | | * guix/progress.scm (progress-reporter/bar): Take font width into account to compute progress bar width. * guix/git.scm (show-progress): Take font width into account to compute progress bar width. Change-Id: I946e447c1ea7c6eb4ff805400280f39e8f1a7c02
* git: Restore 'false-if-git-not-found' in 'reference-available?'.Simon Tournier2023-09-25
| | | | | * guix/git/scm (reference-available?): Add 'false-if-git-not-found' for the case 'commit.
* git: Avoid touching the network unless needed in 'reference-available?'.Simon Tournier2023-09-22
| | | | | | | Follow-up of 756e336fa008c2469b4a7317ad5c641ed48f25d6 fixing the issue. * guix/git/scm (reference-available?): Address case by case to determine whether the reference exists in the local Git checkout.
* git: Fix typo in reference-available? comment.Maxim Cournoyer2023-09-05
| | | | * guix/git.scm (reference-available?): Fix typo.
* Revert "guix: git: Avoid touching the network unless needed in ↵Maxim Cournoyer2023-09-05
| | | | | | | | | | | | | 'reference-available?'." This reverts commit a789dd58656d5f7f1b8edf790d77753fc71670af, which broke e.g.: guix time-machine -C <(echo %default-channels) -- describe Add an explanatory comment as suggested. Reported-by: Ludovic Courtès <ludo@gnu.org>
* guix: git: Avoid touching the network unless needed in 'reference-available?'.Simon Tournier2023-08-29
| | | | | | | * guix/git/scm (reference-available?): Use the resolve-reference procedure to determine whether the reference exists in the local Git checkout. Signed-off-by: Maxim Cournoyer <maxim.cournoyer@gmail.com>
* git: Clarify commit relation reference in doc.Maxim Cournoyer2023-08-16
| | | | | | * guix/git.scm (update-cached-checkout): Clarify that it is the relation of STARTING-COMMIT that is returned, relative to the new commit, not the other way around.
* guix: Strip #:use-module lists.Ludovic Courtès2023-03-13
| | | | | | | | | | | | This was obtained by setting up this environment: guix shell -D guix --with-input=guile@3.0.9=guile-next \ --with-commit=guile-next=e2ed33ef0445c867fe56c247054aa67e834861f2 -- make -j5 then adding 'unused-module' to (@@ (guix build compiler) %warnings), building, and checking all the "unused module" warnings and removing those that were definitely unused.
* git: Make better use of the better progress bar.Tobias Geerinckx-Rice2023-02-19
| | | | | | | | | Commit 189525412e3d803f3f77e15ec4a62aaa57f65a2d introduced ‘high-resolution’ Unicode progress bars, but these require more granular calls to reach their full potential. * guix/git.scm (show-progress): Derive the number of PROGRESS-BAR updates from its maximum resolution, rather than hard-coding 100.
* git: Factor out INDEXER-PROGRESS-TOTAL-OBJECTS access.Tobias Geerinckx-Rice2023-02-19
| | | | * guix/git.scm (show-progress): Reuse the result of the first call.
* git: 'update-cached-checkout' returns the commit ID when given a tag.Ludovic Courtès2022-10-17
| | | | | | | | | | | Previously, starting with commit efa578ecaece67366b4b0e2266de7c2faaa4ae54, 'update-cached-checkout' would return the OID of the annotated tag the tag points to. With this change it returns the OID of the commit object in all cases. * guix/git.scm (resolve-reference): In the 'tag' case, call 'tag-target-id' and 'tag-lookup' when OID designates an annotated tag. * tests/git.scm ("update-cached-checkout, tag"): New test.
* git: 'update-cached-checkout' recognizes truncated commit IDs.Ludovic Courtès2022-10-15
| | | | | | | | | Fixes a regression introduced in 602527ab9778165ca9a8f9cb62036038b5354688 that broke 'tests/guix-build-branch.sh'. * guix/git.scm (resolve-reference): Revert change from 602527ab9778165ca9a8f9cb62036038b5354688.
* git: Factorize 'commit-id?' predicate.Ludovic Courtès2022-10-11
| | | | | | * guix/git.scm (commit-id?): New procedure, copied from (guix swh). (resolve-reference): Use it instead of inline code. * guix/inferior.scm (channel-full-commit): Likewise.
* git: Add 'commit-descendant?'.Ludovic Courtès2022-02-14
| | | | | * guix/git.scm (commit-descendant?): New procedure. * tests/git.scm ("commit-descendant?"): New test.
* upstream: Support updating and fetching 'git-fetch' origins.Sarah Morgensen2022-01-06
| | | | | | | | | | | | | | | | | | | | | | | | | | | Updaters need to be modified to return 'git-reference' objects. This patch modifies the 'generic-git' and 'minetest' updater, but others might need to be modified as well. * guix/git.scm (git-reference->git-checkout): New procedure. * guix/upstream.scm (package-update/git-fetch): New procedure. (<upstream-source>)[urls]: Document it can be a 'git-reference'. (%method-updates): Add 'git-fetch' mapping. (update-package-source): Support 'git-reference' sources. (upstream-source-compiler/url-fetch): Split off from ... (upstream-source-compiler): ... this, and call ... (upstream-source-compiler/git-fetch): ... this new procedure if the URL field contains a 'git-reference'. * guix/import/git.scm (latest-git-tag-version): Always return two values and document that the tag is returned as well. (latest-git-release)[urls]: Use the 'git-reference' instead of the repository URL. * guix/import/minetest.scm (latest-minetest-release)[urls]: Don't wrap the 'git-reference' in a list. * tests/minetest.scm (upstream-source->sexp): Adjust to new convention. Co-authored-by: Maxime Devos <maximedevos@telenet.be> Signed-off-by: Ludovic Courtès <ludo@gnu.org>
* git: 'reference-available?' recognizes 'tag-or-commit'.Ludovic Courtès2021-09-18
| | | | | * guix/git.scm (reference-available?): Handle 'tag-or-commit' with a 40-digit hex string.
* git: 'update-cached-checkout' can fall back to SWH when cloning.Ludovic Courtès2021-09-18
| | | | | | | | | Fixes <https://issues.guix.gnu.org/44187>. Reported by zimoun <zimon.toutoune@gmail.com>. * guix/git.scm (GITERR_HTTP): New variable. (clone-from-swh, clone/swh-fallback): New procedures. (update-cached-checkout): Use 'clone/swh-fallback' instead of 'clone*'.
* import: Add 'generic-git' updater.Xinglu Chen2021-09-18
| | | | | | | | | | | | * guix/git.scm (ls-remote-refs): New procedure. * tests/git.scm ("remote-refs" "remote-refs: only tags"): New tests. * guix/import/git.scm: New file. * doc/guix.texi (Invoking guix refresh): Document it. * tests/import-git.scm: New test file. * Makefile.am (MODULES, SCM_TESTS): Register the new files. Co-authored-by: Sarah Morgensen <iskarian@mgsn.dev> Signed-off-by: Ludovic Courtès <ludo@gnu.org>
* transformations: Git tags and 'git describe' style IDs are used as version.Marius Bakke2021-09-08
| | | | | | | | | | * guix/transformations.scm (commit->version-string): New procedure. Use git tags and 'git describe' style identifiers directly. (transform-package-source-commit): Adjust accordingly. * tests/transformations.scm ("options->transformation, with-commit, version transformation"): New test. * doc/guix.texi (Package Transformation Options): Mention the 'git describe' style.
* git: 'resolve-reference' handles 'git describe'-style commit IDs.Marius Bakke2021-09-08
| | | | | | * guix/git.scm (resolve-reference): Rewrite tag-or-commit case to recognize 'git describe' style identifiers and resolve them as commits. * doc/guix.texi (origin Reference): Mention it.
* git: Update the mtime of the just-updated checkout.Ludovic Courtès2021-06-12
| | | | | | | | | | Reported by zimoun <zimon.toutoune@gmail.com>. Previously, the mtime of CACHE-DIRECTORY may or may not have been updated after a pull. Thus, 'maybe-remove-expired-cache-entries' could potentially delete CACHE-DIRECTORY right before it's returned. * guix/git.scm (update-cached-checkout): Call 'utime' on CACHE-DIRECTORY.
* git: Honor proxy settings when fetching submodules.Ludovic Courtès2021-04-14
| | | | | | | | Fixes <https://bugs.gnu.org/44593>. * guix/git.scm (update-submodules): Add #:fetch-options and honor it. (update-cached-checkout): Pass #:fetch-options to 'update-submodules'. * doc/guix.texi (Requirements): Adjust comment about Guile-Git.
* git: Update cached checkout to the remote HEAD by default.Kyle Meyer2021-04-10
| | | | | | | | | | | | | | | | | | Fixes <https://bugs.gnu.org/45187>. Reported by Ricardo Wurmus <rekado@elephly.net>. update-cached-checkout hard codes "master" as the default branch, leading to a failure when the clone doesn't have a "master" branch. Instead use the remote HEAD symref as an indicator of what the primary branch is. * guix/git.scm (resolve-reference): Support resolving symrefs. (update-cached-checkout, latest-repository-commit): Change the default for REF to the empty list and translate it to the remote HEAD symref. (<git-checkout>): Change branch field's default to #f. (git-checkout-compiler): When branch and commit fields are both #f, call latest-repository-commit* with the empty list as the ref. Signed-off-by: Ludovic Courtès <ludo@gnu.org>
* git: Remove unused variables.Ludovic Courtès2021-04-02
| | | | | | | | This is a followup to 298f9d29d6c26e408a90d08d147d926aa6f81ab3, which left those variables despite being unnecessary. * guix/git.scm (clone*, update-cached-checkout): Remove unused 'auth-method' variable.
* git: Periodically delete least-recently-used cached checkouts.Ludovic Courtès2021-01-13
| | | | | | | | | | | | This ensures ~/.cache/guix/checkouts is periodically cleaned up. * guix/git.scm (cached-checkout-expiration) (%checkout-cache-cleanup-period): New variables. (delete-checkout): New procedure. (update-cached-checkout)[cache-entries]: New procedure. Add call to 'maybe-remove-expired-cache-entries'. * guix/cache.scm (file-expiration-time): Add optional 'timestamp' parameter and honor it.
* git: 'reference-available?' handles short commit IDs.Ludovic Courtès2020-12-04
| | | | | | | | | | Reported by Simon Tournier on #guix. Until now 'reference-available?' would always return #f when passed a short commit ID. * guix/git.scm (reference-available?): Call 'object-lookup-prefix' when COMMIT is shorter than 40 characters.
* git: Support HTTP and HTTPS proxies.Ludovic Courtès2020-10-22
| | | | | | This allows 'guix pull' and similar to fetch code over a proxy. * guix/git.scm (make-default-fetch-options): Pass #:proxy-url.
* git: Display a progress bar while fetching a repo.Ludovic Courtès2020-10-22
| | | | | | | | | | | | Fixes <https://bugs.gnu.org/39260>. This uses the API of the yet-to-be-released Guile-Git 0.4.0. Using an older version is still possible, but progress report is disabled. * guix/git.scm (show-progress, make-default-fetch-options): New procedures. (clone*, update-cached-checkout): Use it instead of 'make-fetch-options'.
* git: Require Guile-Git 0.3.0 or later.Ludovic Courtès2020-10-22
| | | | | | | | | | | | | | | * guix/git.scm (auth-supported?): Remove. (clone*): Inline code that was dependent on AUTH-SUPPORTED?. (update-cached-checkout): Likewise. (resolve-reference): Remove check for 'object-lookup-prefix' and use it unconditionally. (load-git-submodules): Remove. (update-submodules): Use 'repository-submodules', 'submodule-lookup', etc. unconditionally. (update-cached-checkout): Use 'repository-close!' unconditionally. * m4/guix.m4 (GUIX_CHECK_GUILE_GIT): New macro. * configure.ac: Use it and error out when it fails. * doc/guix.texi (Requirements): Bump to Guile-Git 0.3.0.
* git: Export url-cache-directory.Mathieu Othacehe2020-09-06
| | | | * guix/git.scm (url-cache-directory): Export it.
* git: 'update-cached-checkout' has a new #:check-out? parameter.Ludovic Courtès2020-07-23
| | | | | * guix/git.scm (update-cached-checkout): Add #:check-out? parameter and honor it.
* git: Factorize 'resolve-reference'.Ludovic Courtès2020-07-23
| | | | | * guix/git.scm (resolve-reference): New procedure. (switch-to-ref): Use it.
* git: Add 'with-git-error-handling'.Ludovic Courtès2020-07-11
| | | | | | | * guix/scripts/pull.scm (report-git-error, with-git-error-handling): Move to... * guix/git.scm: ... here. * guix/scripts/time-machine.scm: Adjust accordingly.
* git: 'commit-difference' really excludes the ancestors of #:excluded.Ludovic Courtès2020-06-09
| | | | | | | * guix/git.scm (commit-difference): Initialize VISITED to the closure of OLD and EXCLUDED, as written in the docstring. * tests/git.scm ("commit-difference, excluded commits"): Adjust accordingly.
* git-authenticate: Prevent removal of '.guix-authorizations'.Ludovic Courtès2020-06-07
| | | | | | | | | | | * guix/git-authenticate.scm (commit-authorized-keys) [parents-have-authorizations-file?, assert-parents-lack-authorizations]: New procedures. Use the latter before returning DEFAULT-AUTHORIZATIONS. * guix/git.scm (false-if-git-not-found): Export. * guix/tests/git.scm (populate-git-repository): Add 'remove' clause. * tests/git-authenticate.scm ("signed commits, .guix-authorizations removed"): New test.
* git: 'update-cached-checkout' gracefully handles missing starting commit.Ludovic Courtès2020-06-07
| | | | | | | | | | Fixes <https://bugs.gnu.org/41604> Reported by John Soo <jsoo1@asu.edu> and zimoun <zimon.toutoune@gmail.com>. * guix/git.scm (false-if-git-not-found): New macro. (reference-available?): Use it. (update-cached-checkout): Use it when looking up STARTING-COMMIT. Set RELATION to 'unrelated when OLD is #false.
* git: 'update-cached-checkout' returns the commit relation.Ludovic Courtès2020-05-25
| | | | | | | | | | | * guix/git.scm (update-cached-checkout): Add #:starting-commit parameter. Call 'commit-relation' when #:starting-commit is true. Always return the relation or #f as the third value. (latest-repository-commit): Adjust accordingly. * guix/import/opam.scm (get-opam-repository): Likewise. * tests/channels.scm ("latest-channel-instances includes channel dependencies") ("latest-channel-instances excludes duplicate channel dependencies"): Update mock of 'update-cached-checkout' accordingly.
* git: Add 'commit-relation'.Ludovic Courtès2020-05-25
| | | | | * guix/git.scm (commit-relation): New procedure. * tests/git.scm ("commit-relation"): New test.
* channels: Add mechanism to patch checkouts of the 'guix channel.Ludovic Courtès2020-05-07
| | | | | | | | | | | | | | | * guix/channels.scm (<patch>): New record type. (apply-patches): New procedure. (latest-channel-instance)[dot-git?]: New procedure. Use 'update-cached-checkout' and 'add-to-store' instead of 'latest-repository-commit'. Call 'apply-patches' when CHANNEL is the 'guix channel. (%patches): New variable. * guix/git.scm (url+commit->name): Make public. * tests/channels.scm ("latest-channel-instances includes channel dependencies") ("latest-channel-instances excludes duplicate channel dependencies"): Mock 'update-cached-checkout' instead of 'latest-repository-commit'. Wrap body in 'with-store' and pass the store to 'latest-channel-instances'.
* git: Don't try to resolve tags with 'tag-lookup'.Ludovic Courtès2020-04-02
| | | | | | | | Fixes <https://bugs.gnu.org/40377>. Reported by Brice Waegeneire <brice@waegenei.re>. * guix/git.scm (switch-to-ref): In the 'tag case, remove call to 'tag-lookup'.
* git: Add missing exports for <git-checkout>.Ludovic Courtès2020-02-10
| | | | | * guix/git.scm (<git-checkout>): Export 'git-checkout-commit' and 'git-checkout-recursive?'.
* git: Remove leftover pk call.Mathieu Othacehe2020-02-06
| | | | * guix/git.scm (update-cached-checkout): Remove leftover pk call.
* git: Add ssh authentication support.Mathieu Othacehe2020-02-06
| | | | | | | | | If Guile-Git revision is >= 0.3.0, use SSH agent authentication method for both clone and fetch calls. * guix/git.scm (auth-supported?): New variable, (clone*): set auth-method to ssh-agent if the variable above is true, (update-cached-checkout): ditto.
* download, git: Refer to the right module in 'module-use!' call.Ludovic Courtès2020-01-07
| | | | | | | | | This fixes a regression introduced in 6a7c4636d4dec47eefa03c95da5a1315bd0e0413. * guix/build/download.scm (load-gnutls): Call 'resolve-module' instead of 'current-module'. * guix/git.scm (load-git-submodules): Likewise.