radicle-dev / radicle-git

Everything Radicle growing around Git
Other
35 stars 5 forks source link

move git-ref-format to under radicle-git-ext #119

Closed keepsimple1 closed 1 year ago

keepsimple1 commented 1 year ago

This is one possible way to move git-ref-format crate to under radicle-git-ext, as proposed in issue #114 . The changes are:

Why did I keep git-ref-format as a (internal) crate instead of merging into radicle-git-ext completely? The reason is that git-ref-format-macro is a proc-macro crate that cannot easily merge into a regular crate.

On the other hand, this means we would still need to publish more than one crate. So the benefit of this patch is debatable. Please let me know what you think.

keepsimple1 commented 1 year ago

Can we not make the proc-macro for radicle-git-ext instead? Or did you explore that route already?

I tried but it didn't work. To demonstrate such errors, I added a test pub fn in git-ref-format-macro crate, and got this error message:

error: `proc-macro` crate types currently cannot export any items other than functions tagged with `#[proc_macro]`, `#[proc_macro_derive]`, or `#[proc_macro_attribute]`
   --> git-ref-format/macro/src/lib.rs:170:1
    |
170 | pub fn this_is_a_test() {
    | ^^^^^^^^^^^^^^^^^^^^^^^