go-mtree
go-mtree copied to clipboard
feat: implement mutate command
@vbatts This is a pretty gross version of implementing the update command. Looking for feedback. I wish there was an API that would allow me to mutate the tree and understand the semantics of a mtree more.
@vbatts I'm interested in getting this released so Bazel users have a strip_prefix
feature, have any time to give some feedback on this one? 🙇🏻
@vbatts This is a pretty gross version of implementing the update command. Looking for feedback. I wish there was an API that would allow me to mutate the tree and understand the semantics of a mtree more.
understood. I'm trying to understand if the output of the --strip-prefix
is acting as expected.
As a first feedback on the experience, perhaps if you would update this OP message to describe the expected behaviour.
Additionally, in likeness to the validate
command, can we default to output the mutated hierarchy to os.Stdout
, and maybe add a flag to write to a file if provided? (it's a bit unexpected that it just in-place modifies the file provided.
And I'm brainstorming about your comment on how to help understand the semantics of the mtree better.
Ping! @thesayyn I think it's your turn here :)
Sorry this slipped away.
I think @thesayyn is too underwater to get back to this at any point. Also the maintainer of bazel's rules_pkg found a new spot at Google so it's not going away. That means the urgency here got lower.
I've tried to sell @rickvanprim on the idea of picking up the PR, but I know it's an obscure hobby project.
Maybe we should just close this and open an issue or discussion to suggest the feature without "licking the cookie" of attempting an implementation.
ah sorry. things have been so busy on my side as well, else I would've taken this over
Sahin suggested that maybe on the Bazel side we can just hook up a fixture to run hermetic awk interpreter, then write the mtree mutations in awk scripts
doing things with awk sounds involved...
looking again, and this branch builds fine locally, and all the checks pass with act
. I'm not see a way to rerun the checks on GH.
I may carry this to a new PR to check again.
If you imagine an engineer is equally comfortable coding in AWK and Go, then I think the former is the more expressive language that's purpose-built for basic manipulation of lines in a file. The problem for us is simply that we want to be hermetic in Bazel, and don't already have a toolchain to get a specific release of awk we can rely on everywhere.