gitinspector icon indicating copy to clipboard operation
gitinspector copied to clipboard

Gather stats from branches and/or sub-directories

Open suhasxavier opened this issue 9 years ago • 13 comments

The current version only reports statistics for the currently active branch. Can I get statistics of all the branches combined?

suhasxavier avatar Dec 16 '15 10:12 suhasxavier

Hi @suhasxavier.

Yes. This could work in a similar way to #24. Gitinspector will support specifying sub directories on the command line when supplying a repository. This has been briefly covered in #67, as well. We can add support for branches as well.

I'm targeting this to be implemented relatively soon, as I believe it's a very useful feature.

adam-waldenberg avatar Dec 16 '15 14:12 adam-waldenberg

Just making a note here.

When implementing this feature, it should also include support for a syntax similar to:

gitinspector.py <options> <repo-location>:*

Which would gather statistics from all branches available. While useless on bigger repositories with an almost infinite number of branches, this would be a nice feature on smaller repos with few branches and would remove the need of having to specify each branch individually.

adam-waldenberg avatar Dec 17 '15 01:12 adam-waldenberg

Hi, any progress on this issue? This would be extremely useful for me!

AndrewC-B avatar Aug 01 '16 19:08 AndrewC-B

@Subject22, Planned to be looked at once I have completed a 0.5.0 release. In the meantime, patches are welcome if anybody feels they would like a crack at it.

In the meantime, you can combine statistics from branches by checking out each branch in a separate repo/location and specifying each individual repo on the command line to gitinspector. Not perfect, but should "work".

adam-waldenberg avatar Aug 02 '16 15:08 adam-waldenberg

Cool, thanks! Haha, neat workaround. I'll see how I go.

On 3/08/2016, at 3:33 AM, Adam Waldenberg [email protected] wrote:

@Subject22, Planned to be looked at once I have completed a 0.5.0 release. In the meantime, patches are welcome if anybody feels they would like a crack at it.

In the meantime, you can combine statistics from branches by checking out each branch in a separate repo/location and specifying each individual repo on the command line to gitinspector. Not perfect, but should "work".

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub, or mute the thread.

AndrewC-B avatar Aug 02 '16 19:08 AndrewC-B

Sorry for the last late comment. I have two folders like you recommend @adam-waldenberg one with the branch master and the other with the branch development but I don't get quite right the command to merge the statistics.

gitinspector -HTlrmw -F html -f axlsx,coffee,css,haml,html,inky-haml,js,rb,scss,txt,xml,yml,erb,rake,xslt,jbuilder folder-master folder-dev > stats.html

Maybe I'm using the wrong command? Any help will be appreciated. Regards

JNajera avatar Nov 12 '18 22:11 JNajera

What’s the output? Your command looks correct to me. I’ve used similar commands in the past without issue.

AndrewC-B avatar Nov 12 '18 22:11 AndrewC-B

@JNajera Looks fine to me. Just make sure you are using a gitinspector version that actually supports specifying multiple repos. Too see when and where it was implemented, take a look at issue #24.

adam-waldenberg avatar Nov 12 '18 22:11 adam-waldenberg

Thanks for your comments! You were right @adam-waldenberg I have version 0.4 instead of 0.5 I will update it and try again. Thanks for the quick response. Regards!

JNajera avatar Nov 12 '18 22:11 JNajera

Out of curiosity, why was #67 closed? I'm looking into using gitinspector to get stats on subfolders within a monorepo. It looks like #67 would have provided that capability.

sidshank avatar Mar 26 '20 20:03 sidshank

Just making a note here.

When implementing this feature, it should also include support for a syntax similar to:

gitinspector.py <options> <repo-location>:*

Which would gather statistics from all branches available. While useless on bigger repositories with an almost infinite number of branches, this would be a nice feature on smaller repos with few branches and would remove the need of having to specify each branch individually.

I know it's been a long time since this issue has been active, but does this syntax work only with remote repositories? I've been trying to figure out how to do this with a local repository without success.

EDIT: Actually I couldn't get this to work even with remote repositories. I'm guessing that's why this issue is still open.

Spacarar avatar May 07 '20 17:05 Spacarar

Still on the todo list @Spacarar. Most likely branches will be checked out to a temporary location and checked once this is implemented - similar to how 0.5.0 supports http(s)// repositories.

adam-waldenberg avatar May 07 '20 22:05 adam-waldenberg

Out of curiosity, why was #67 closed? I'm looking into using gitinspector to get stats on subfolders within a monorepo. It looks like #67 would have provided that capability.

Completely missed your comment @sidshank. But as stated in #67 you can already filter subfolders or target subfolders using regular expressions. For example, -x "^(?!(subdir/))" would only show statistics for files in subdir.

adam-waldenberg avatar May 08 '20 02:05 adam-waldenberg