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

Provide porcelain output for scripts. #176

Closed
wants to merge 1 commit into from

Conversation

siedentop
Copy link

This provides an option --porcelain=(local|remote|json)

Options:

  • local branches
  • remote branches
  • JSON output.

The first two options print the to-be-deleted branches (either local or remote). This can be piped into further
scripts. The second output provides all available information in the form of JSON output. This can then be filtered with gron or jq, or nushell.

#138

Options:
* local branches
* remote branches
* JSON output.

\foriequal0#138
@siedentop
Copy link
Author

@foriequal0 what do you think of this? I'm not sure if the JSON output is sufficient (and needs one test).

@foriequal0
Copy link
Owner

Thank you for the contribution!
But I'm really sorry to say that I want to postpone this feature after v1.0, or at least after there is serious request of this with some kind of formal specifications since providing a machine-readible interface is much harder to maintain/break/fix than an interface that requires human intervention.
This is a small side project for me who has a full-time job. I want you to understand that I want git-trim as small as I can maintain.

@siedentop siedentop closed this Nov 14, 2020
@siedentop
Copy link
Author

Thank you for the contribution!
But I'm really sorry to say that I want to postpone this feature after v1.0, or at least after there is serious request of this with ...

Fully understood. This wasn’t much work, no harm done :) As there was an open ticket, I thought to give it a try.

... some kind of formal specifications since providing a machine-readible interface is much harder to maintain/break/fix than an interface that requires human intervention.

Yes, that is something I considered. Let me give my thoughts on the specifications (but please do not read this as me trying to argue for merging this):

  • I believe that the list of local branches (—porcelain=local) could be considered stable. There is only one way to format the output (IMO). Some minor discussion could be made whether to treat Stray branches as to-be-deleted or report them in a second category. I would say that this could best be done by providing an option to formalize how the output should look.
  • Remote branches is similarly stable. However the output format could be done in multiple different ways.
  • JSON output could be given an additional field “version: 1” to allow consumer programs to handle changing versions in the future. However, it might be too easy not to check this version.

Again, just my thoughts and not an attempt to merge this.

This is a small side project for me who has a full-time job. I want you to understand that I want git-trim as small as I can maintain.

It’s a nice project! — 🙏

@siedentop siedentop deleted the feature/porcelain-138 branch November 16, 2020 03:22
@foriequal0
Copy link
Owner

foriequal0 commented Nov 16, 2020

Thank you for understanding me. I didn't mean to be overly defensive. I'm sorry if I made you feel uncomfortable. I should learn English more.

@siedentop
Copy link
Author

Thank you for understanding me. I didn't mean to be overly defensive. I'm sorry if I made you feel uncomfortable. I should learn English more.

All good 🙂 you were not overly defensive. You did not make me feel uncomfortable. And your English is very good! I understand everything you say.

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

Successfully merging this pull request may close these issues.

2 participants