Commit Graph
13 Commits
Author SHA1 Message Date
Fintan Halpenny d45d63b7ce git-ref-format: remove link-literals feature
Since this package is not intended for radicle-link anymore, the
feature flag and the literals are removed.

Signed-off-by: Fintan Halpenny <fintan.halpenny@gmail.com>
X-Clacks-Overhead: GNU Terry Pratchett
2022-11-18 15:45:08 +00:00
Fintan Halpenny 2b5a34a703 git-ref-format: add well-known refspec components
Add constants for well-known refspec component names.

Signed-off-by: Fintan Halpenny <fintan.halpenny@gmail.com>
X-Clacks-Overhead: GNU Terry Pratchett
2022-11-18 10:49:22 +00:00
Fintan Halpenny a4fc3db933 git-ref-format: fix typo in documentation
Fixes small typo in documentation of `and` function.

Signed-off-by: Fintan Halpenny <fintan.halpenny@gmail.com>
X-Clacks-Overhead: GNU Terry Pratchett
2022-11-18 10:49:22 +00:00
Fintan Halpenny cf1594cf43 git-ref-format: DoubleEndedIterator for Components
Add DoubleEndedIterator implementations for the two Components
iterators.

Signed-off-by: Fintan Halpenny <fintan.halpenny@gmail.com>
X-Clacks-Overhead: GNU Terry Pratchett
2022-11-18 10:49:22 +00:00
Fintan Halpenny 6479ba091f git-ref-format: add QualifiedPattern and NamespacedPattern
There was no mechanism for building refspec patterns that included
namespaces.

To get around this limitation, QualifiedPattern and NamespacedPattern
are added to the refspec module.

Signed-off-by: Fintan Halpenny <fintan.halpenny@gmail.com>
X-Clacks-Overhead: GNU Terry Pratchett
2022-11-18 10:49:22 +00:00
Fintan Halpenny d6c7bb29ab git-ref-format: Component::from_refstr
Improve Component::from_refstring by redefining it as
Component::from_refstr. This allows the use of `RefStr` or `RefString`
instead of just RefString.

Signed-off-by: Fintan Halpenny <fintan.halpenny@gmail.com>
X-Clacks-Overhead: GNU Terry Pratchett
2022-11-16 13:47:22 +00:00
Fintan Halpenny 629191f55a git-ref-format: import Qualified within macro
If the `qualified` macro was used, the compiler would complain that it
required an import of `Qualified`.

Fixed by importing Qualified within the unsafe block of the definition
of `qualified`.

Signed-off-by: Fintan Halpenny <fintan.halpenny@gmail.com>
X-Clacks-Overhead: GNU Terry Pratchett
2022-11-16 13:40:48 +00:00
Han Xu 35b9598a29 Remove Ref, RefGlob and Rev, add Glob that uses git-ref-format.
- Refactored branches(), tags(), namespaces().
- Added filtering for revision_branches().

Signed-off-by: Han Xu <keepsimple@gmail.com>
2022-11-07 14:33:16 -08:00
Fintan Halpenny 1c8a501be1 git-ref-format: prepare git-ref-format crates for publishing
Attempting to publish these crates results in errors that the
`description` field is missing and that the path dependencies do not
specify versions.

Add the `description` and `keywords` fields to `git-ref-format-core`,
`git-ref-format-macro` and `git-ref-format`.

Add the versions for the dependent crates.

Signed-off-by: Fintan Halpenny <fintan.halpenny@gmail.com>
2022-10-14 10:25:42 +01:00
Fintan Halpenny daffac4101 git-ref-format: rename namespace functions
The namespace functions can read confusingly:
* `namespaced` - the naming sounds like it is namespacing the input,
when in fact it is ensuring that the input is namespaced.
* `add_namespace` - can be read as adding the namespace to the end of
a ref, when in fact it is placed at the beginning.

Change the naming, respectively, to:
* `to_namespaced` - this uses the conversion naming convention
detailed here[0].
* `with_namespace` - reads as plainly namespacing the ref string.

[0]: https://rust-lang.github.io/api-guidelines/naming.html#ad-hoc-conversions-follow-as_-to_-into_-conventions-c-conv

Signed-off-by: Fintan Halpenny <fintan.halpenny@gmail.com>
2022-10-13 09:21:53 +01:00
Fintan Halpenny 339d7fc097 git-ref-format: qualified macro
Add a `qualified!` macro to the set of git-ref-format macros. This
allows the construction of a `refs/<cat>/<name>` reference from a
string literal.

Signed-off-by: Fintan Halpenny <fintan.halpenny@gmail.com>
2022-10-12 17:00:05 +01:00
Fintan Halpenny 32902d0174 nix: rust-1.64
rust-1.64 was announced[0].

Update the nix sources to pick up the latest stable. This update
requires some fixes suggested by clippy.

[0]: https://blog.rust-lang.org/2022/09/22/Rust-1.64.0.html

Signed-off-by: Fintan Halpenny <fintan.halpenny@gmail.com>
2022-09-23 08:45:15 +01:00
Fintan Halpenny 70b571b67b radicle-git init
Port over all git relevant parts of the radicle-link repository[0].
The packages that are kept are:
* git-ext
* git-ref-format
* git-trailers
* link-git
* macros
* std-ext
* test -- only the portions that test the above

The development and testing scripts are also added for local and CI
testing.

[0]: https://github.com/radicle-dev/radicle-link/
Signed-off-by: Fintan Halpenny <fintan.halpenny@gmail.com>
2022-09-08 12:07:51 +01:00