Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Pre-push hook does not work when it has a list as value #193

Closed
2 of 6 tasks
placintaalexandru opened this issue May 20, 2022 · 3 comments
Closed
2 of 6 tasks

Pre-push hook does not work when it has a list as value #193

placintaalexandru opened this issue May 20, 2022 · 3 comments

Comments

@placintaalexandru
Copy link

Environment Details

  • Operating System
    • Linux
    • Mac
    • Windows
  • Rust Version: 1.58.1
  • Rust Release Channel
    • Stable
    • Nightly
    • Beta
  • Cargo Version: 1.58.0
  • rusty-hook Version: 0.11.2

Description

When pre-push hook has as value a list, the hook is rejected with the following message:

Invalid rusty-hook config file
Configured hook command failed
pre-push hook rejected

An example of .rusty-hook.toml that fails is this one:

[hooks]
pre-commit = "echo some pre commit message"
pre-push = ["echo mesg1", "echo msg2"]
post-commit = "echo post commit message"

[logging]
verbose = true

Now, when I use only one command in the pre-push hook, everything works. An example of .rusty-hook.toml that works is this one:

[hooks]
pre-commit = "echo some pre commit message"
pre-push = "echo mesg1"
post-commit = "echo post commit message"

[logging]
verbose = true
@calebcartwright
Copy link
Member

Thanks for using the tool and reaching out! I'm going to close however as this is a duplicate of a few other issues (#181, #168, and #151). I think the best description of the behavior can be found in #151 (comment) but in short you're trying to use an unreleased feature and will instead need to chain your multicommand hooks with &&.

The array syntax support got stuck behind some other larger unreleased changes, including a breaking change that's blocking the ability to release, and unfortunately I haven't been able to carve out enough bandwidth to sit down to rework all of those.

@calebcartwright calebcartwright closed this as not planned Won't fix, can't repro, duplicate, stale May 20, 2022
@knzai
Copy link

knzai commented Jun 12, 2024

Perhaps having an unreleased feature in the main readme is gonna continue tripping people up 2 years later?

@calebcartwright
Copy link
Member

Perhaps having an unreleased feature in the main readme is gonna continue tripping people up 2 years later?

That is possible. Only time will tell 😉

Jokes aside, I still think people should refer to the actual documentation on crates.io and/or docs.rs that reflect the version they are using. Avoiding those and looking at source control is always going to be a recipe for potential issues.

That being said, if someone wants to submit a PR to modify the readme snippet then I'd support it. My bandwidth for open source is limited these days and what little I do have is occupied with the 2024 edition currently

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants