-
Notifications
You must be signed in to change notification settings - Fork 19
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
Implementing filtering on output #238
Comments
This is a great idea. To answer your question...
No, that being said, that's partially why I added the JSON feature: to give folks a workaround in the event that I didn't have time to implement a display-related feature right away. I think an ability to filter would be great! Do you have a preference on how the flag would/could work? |
My use case is quite straight-forward: I want to find all those repos where I "messed up", where there is a whiff of unfinished business in that something is "here" that should probably be remote (too). I believe that, generally, this is what At first look, and purely based on instinct, this would suggest a flag "--ignore-clean" or "--skip-clean", possibly Similarly, I might also be interested in local repositories which contain stashes (which, I believe, is not covered by So a nicely named "--ignore" flag to remove data from the results could perhaps work best ? I'd agree that for more complex use cases filtering through jq would be the way to go. I am not sure whether it should be more complex than that? |
Thanks for the detailed explanation. The context for why you want it is helpful too. I could see individual flags working, but I'm curious if we could get something ergonomic for a variety of inputs too. Would something like this work for you too?
So then you could run the following to see only gfold --filter "unclean,unpushed" Thoughts? P.S. the stashes idea is also a great one. It can likely work with whatever ignore/filter feature is added, though we'll need to investigate working with stashes in general independently of this issue. Filed #241 for it. |
Many thanks for making the stashes idea trackable! I see where you are coming from, with having a generic I'd like to approach these decisions from a - my - usability point of view, too:
With that, I can see adding What I am looking for is a way to convert the local state of working copies (AKA "my mess") into something actionable - be it (re-)reviewing, discarding, upstreaming, forking, ... Here, I am not all that interested in the specific status, more in the resulting action, e.g.
The ultimate goal would always be to not have things linger locally. It must go somewhere, eventually, either remote or into the dustbin. So, basically, I see two outcome-based actions,
that I'd want to filter on, but I don't know how well my actions translate generally into everybody's individual workflow? An asideOf course this is all within the constraints currently imposed by pub struct RepositoryView {
/// The directory name of the Git repository.
pub name: String,
/// The name of the current, open branch.
pub branch: String,
/// The [`Status`] of the working tree.
pub status: Status,
/// The parent directory of the `path` field. The value will be `None` if a parent is not found.
pub parent: Option<String>,
/// The remote origin URL. The value will be `None` if the URL cannot be found.
pub url: Option<String>,
pub email: Option<String>,
pub submodules: Vec<SubmoduleView>,
} In any future iteration of
This would also still be within local discovery, with no expectation for With such an extension into a vNext, Having filters built into So, in such a future end,
|
@shoffmeister no problem on making the stashes idea trackable.
Those are really helpful for helping me get a grasp on what is desired here. I've never written tab completion logic, to be honest. However, I'd be open to investigate! Sounds like a fun dive. It might not be part of solving this specific issue though. As far as the "stashes present" and "bare" statuses go, the former is something that would be considered as part of the other issue and the latter is purely a reflection of a state that Totally agree that using
That's 100% the mentality of In fact, that's partially why I split I have more thoughts here, and have thought on it on and off when I've had free time, but that's some immediate thoughts that come to mind. I think you're on the money overall and I'll take them into consideration. |
I'd like to take a stab at implementing this. I dislike |
@uncenter I agree that the "filter" keyword can be a bit ambiguous. Two mutually exclusive options works for me, so long as we ensure the resulting configuration is valid and what a user would expect. I'll label the issue accordingly. |
I am trying to use
gfold
to answer a question for a (very large) tree of git repositories: "Is there anything that has not been pushed to the authoritative origin?"The default output of
gfold
allows me to determine an answer ("unclean", "unpushed") - but, alas, the default output is very large.I am unable to locate a built-in means to filter
gfold
output such that only those repositories are listed where the status is not "clean". I do see an option to emit JSON and then filter on that using, say,but the output from that is JSON and ... I am still human and prefer nice(r) output.
Is there any means to accomplish natively within
gfold
what the above tries to do?The text was updated successfully, but these errors were encountered: