The sound distributed version control system

#136 #[clap(name = "xxx")] is redundant

Closed on November 30, 2020
danieleades on November 29, 2020

The SubCommand enum in the main.rs file uses an attribute to name each command. Since Clap already converts the enum variant name to kebab case for the command name, this attribute is only required if a different name is required.

There are no examples in this enum where the manually configured name doesn’t match the generated one.

pmeunier on November 29, 2020

I didn’t know that. Do you want to push a change to this discussion?

pijul push danieleades@nest.pijul.com:pijul/pijul --to-channel :136

danieleades on November 29, 2020

i would love to. As soon as I can get any release of pijul to clone, build, or install I will be happy to do so!

I got this far by using curl to download a tarball from crates.io

pmeunier on November 29, 2020

Can you use cargo install pijul --version 1.0.0-alpha.9?

danieleades on November 29, 2020

i had tried alphas 5-8, but it seems 9 was the magic number!

danieleades on November 29, 2020
  • unable to clone using ssh - key is rejected while cloning, and it’s asking for a password.
  • was able to clone using http
  • i can’t record the changes (pijul record)- it claims there’s a syntax error in the generated file when I try to save it

any ideas?

incidentally, I can’t exit the file without saving either, I get stuck in a loop where I either have to kill the terminal or manually delete every line in the file before re-saving.

danieleades on November 29, 2020

i see also that you have-

    /// Unrecords all changes upto the given hash
    #[clap(alias = "unrec", alias = "un")]
    Unrecord(Unrecord),

would you consider instead using the Clap setting InferSubcommands? I think this might do what you’re after

danieleades on November 29, 2020

I’ve also noticed that pijul -h, pijul --help, and pijul help don’t work in this release

i think this block here might be breaking it?-

    for arg in std::env::args().skip(1) {
        if cmd.is_empty() {
            if app
                .get_subcommands()
                .any(|sub| sub.get_name() == arg || sub.get_all_aliases().any(|al| al == arg))
            {
                return Ok(false);
            }
            cmd.push_str("pijul-");
            cmd.push_str(&arg)
        } else {
            args.push(arg)
        }
    }
danieleades on November 29, 2020

also these app settings-

#[clap(version = crate_version!(), author = crate_authors!(),...]

shouldn’t be required, as these are each the default behaviour if they’re not supplied.

at least that’s the case with structopt, i’ve not actually used the Clap beta, but I can’t imagine why they would have changed the behaviour.

I can’t confirm locally, since the help string seems to be broken

danieleades on November 30, 2020

managed to record changes. now attempting to push them.

  • pijul doesn’t like using SSH. Have tried generating a new key
  • nest website crashes when I attempt to save the new public key
pmeunier on November 30, 2020

There was a problem with SSH keys, I just fixed it.

danieleades added a change on November 30, 2020
62XVBWPYCBULZ2IUWF36JVHAPMKCGQC53PQQ53AAGZGC2KT7VQRQC
main
pmeunier on November 30, 2020

Thanks! And sorry again about the hiccups of the Nest.

danieleades added a change on November 30, 2020
QRZF7GJM4ML4M3QN757F37F5E7XDD6GEJ2LZT4OZCZT7VG7W4ORAC
danieleades added a change on November 30, 2020
XJYD5MY2WVWSBCER53GOZ246HYTIAMM2PFG4LSYV3O7FC27WHGSQC
danieleades on November 30, 2020

the “use ‘InferSubcommands’ instead of aliases” patch might be slightly controversial as this could interfere with external subcommands (depending on how this is being used)

danieleades on November 30, 2020

Thanks! And sorry again about the hiccups of the Nest.

no, thankyou for the quick fixes! I think there’s a lot of us out here who really want this project to succeed.

pmeunier on November 30, 2020

It’s ok. If we let external subcommands use names that look like shortcuts to standard commands, things might be super confusing (I can already imagine some StackOverflow questions).

danieleades on November 30, 2020

would you consider using the native external subcommand support instead of the hand-rolled one?

https://docs.rs/structopt/0.3.20/structopt/#external-subcommands

pmeunier on November 30, 2020

Yes, absolutely. I tried to look for this in Clap’s documentation, and couldn’t find it.

danieleades on November 30, 2020

clap’s documentation is pretty terrible, but you can use the structopt docs as a reference

danieleades added a change on November 30, 2020
SNZ3OAMCPUGFYON5SZHQQQK46ZZMVMJECJYEUCMG657UVLY2PNBQC
main
pmeunier on November 30, 2020

Thanks!

danieleades on November 30, 2020

i’ve got a feeling that the crate version and author are not pulled by default in Clap anymore. I think maybe you were right to add these manually…

pmeunier on November 30, 2020

Alright, I unrecorded the change (QRZ…) from the main channel, but change XJY… depended on it, so I had to unrecord it too.

Would you mind either:

  • unrecording XJY and QRZ (pijul unrec XJY QRZ), recording again and pushing
  • or, alternatively, pijul unrec XJY, and then pijul record --amend XJY.
danieleades added a change on November 30, 2020
DZ6NYEP7LNWY5V7BZWLTZOA4ZFJOWS6GR6RB5JUG73JI5P7IW2YQC
danieleades on November 30, 2020

does that seem about right? still very new with these workflows!

pmeunier on November 30, 2020

Perfect! I’m testing it right now. We’re actually all new to these workflows ;-)

pmeunier on November 30, 2020

It complains about settings, which should be setting, actually.

danieleades added a change on November 30, 2020
UIQELRQ6QBZMTHPKKN2EMLXM3IOTIRX4SD5BL4JTDBFRWTKT774AC
danieleades added a change on November 30, 2020
UTDZKZGPHLL2MK5FFP6ANYCX2PZYTKXIQ2RNWBG2WGDJNVYLLWLQC
main
danieleades on November 30, 2020

apologies. have amended the change

pmeunier on November 30, 2020

Thanks! I believe we can close this, feel free to reopen if not (people can still comment and push changes after the discussion is closed, it just doesn’t appear in the list anymore).

pmeunier closed this discussion on November 30, 2020