emlun / gws2

Colorful KISS helper for git workspaces
GNU General Public License v3.0
4 stars 1 forks source link

Add option to gws status to print on one line #11

Open JohanSpaedtke opened 5 years ago

JohanSpaedtke commented 5 years ago

Today the output from gws status is on two lines per repo. If you want to do something automatic with the output from gws status it wuold be nice to get only one line per repo

emlun commented 5 years ago

If you want to do something automatic with the output, we should instead add the option to dump the data model in a machine-readable format like JSON :wink:

But for a one-line human-readable format, what would that be for repos with multiple branches?

JohanSpaedtke commented 5 years ago

Well JSON or something like that would also be nice. I just assumed changing

print(repoName);
print(newLine);
print(branch);

could be changed to something like

print(repoName);
print(randomOtherSeparator);
print(branch);

and that that would be a simpler fix.

With that said I havn't looked at the code so it might be even simpler to just dump it as JSON :)

emlun commented 5 years ago

Sure, the code change would probably be quite simple, but I don't want people to script against the human-oriented output format since I don't want to commit to not breaking it. I'd rather add a switch to explicitly print a machine-readable format that I can try harder not to break.