flaviostutz / gitwho

Inspects a git repository and gives insights about developers around code ownership, churn, refactorings, new codes and people that help others.
MIT License
5 stars 1 forks source link

ownership command: add option to export results in csv format #16

Closed flaviostutz closed 11 months ago

flaviostutz commented 1 year ago

Problem being solved

Sometimes this utility is used by scripts that extracts data to be used elsewhere, so a CSV output is more suitable for parsing and processing

Proposal

Add --format "csv" to output results in csv format

Mihai22125 commented 1 year ago

Hi @flaviostutz, I'd like to work on this issue. Can you assign it to me, please?

flaviostutz commented 1 year ago

Assigned! I think it's good to discuss a bit the requirement details here before starting to develop, because the issue description is not enough I guess :)

Mihai22125 commented 1 year ago

Thank you for assigning the issue to me! To clarify the CSV output format feature, could you please provide details on the expected CSV structure? Additionally, do you have any specific preferences or suggestions for implementing the --format "csv" option in relation to existing options like 'full' and 'short'?

flaviostutz commented 1 year ago

Yes, you would add another option besides "full", "short" and (more recently) "graph". We are trying to make "format" available in all commands so it creates a kind of uniformity, but for now you can add this only to the "ownership" command and later on we think about the others.

Looking at the ownership results from the API, it looks like:

image

We could then export as CSV only the fields present in "AuthorLines", which structure is

image

In this case, the exported fields in CSV would be: AuthorName; AuthorMail; OwnedLinesTotal; OwnedLinesAgeDaysSum; OwnedLinesDuplicate; OwnedLinesDuplicateOriginal; OwnedLinesDuplicateOriginalOthers

(in the future we might create another format "json" for exporting all structured info from results, because fitting in a CSV makes us lose a lot of info from the results)

Mihai22125 commented 1 year ago

Hi @flaviostutz,

Thank you for providing the additional information. Unfortunately, I won't be able to work on it this week. If anyone else is available and interested in taking this on, please feel free to assign it to them.

Otherwise, I'm looking forward to working on this when I regain access to my laptop.

flaviostutz commented 1 year ago

Ok, I will reserve this issue for you for the next two weeks then 😃Sent from my iPhoneOn 11 Sep 2023, at 09:24, Mihai Țimbota-Belin @.***> wrote: Hi @flaviostutz, Thank you for providing the additional information. Unfortunately, I won't be able to work on it this week. If anyone else is available and interested in taking this on, please feel free to assign it to them. Otherwise, I'm looking forward to working on this when I regain access to my laptop.

—Reply to this email directly, view it on GitHub, or unsubscribe.You are receiving this because you were mentioned.Message ID: @.***>