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

Using CLOC for github urls. #798

Open
Tholkappiar opened this issue Dec 28, 2023 · 8 comments
Open

Using CLOC for github urls. #798

Tholkappiar opened this issue Dec 28, 2023 · 8 comments

Comments

@Tholkappiar
Copy link

Feat :

Let's take an example github URL : https://github.com/AlDanial/cloc.git

Cloc can able to count blank lines, comment lines, and physical lines of source code from the direct Github url.

For Example :

cloc git-url https://github.com/AlDanial/cloc.git
      36 text files.
      35 unique files.                              
       7 files ignored.

github.com/AlDanial/cloc v 1.90  T=0.06 s (557.4 files/s, 26324.3 lines/s)
-------------------------------------------------------------------------------
Language                     files          blank        comment           code
-------------------------------------------------------------------------------
PHP                             23            200            149            970
JavaScript                       2             15             11             61
YAML                             1              2             19             15
JSON                             1              2              0              6
CSS                              2              0             10              2
SVG                              2              0              0              2
-------------------------------------------------------------------------------
SUM:                            31            219            189           1056
-------------------------------------------------------------------------------

It would be nice if cloc works with direct Github repo's too !

@AlDanial
Copy link
Owner

AlDanial commented Jan 4, 2024

cloc would have to clone the repo (or download the project's .zip file) to count it. What would you want cloc to do with the download afterwards? Leave it be on your file system? Delete it?

@Tholkappiar
Copy link
Author

We can give a flag to choose the downloaded repo should stay in our file System or not . It gives more versatile options to the users . I think this would be a good choice compared to the deletion of repo and this way the user have some control over it . Thank you for your time and consideration.

@grafst
Copy link

grafst commented Jan 12, 2024

This could be very useful to me.
Just some thoughts from me:
if I wanted to keep the repo i would just clone it. So i think it shouldn't be kept.
But probably it should be kept in a temporary folder for some time so that when rerunning the command it doesn't have to clone it anew...

btw love the tool, its very good!

@AlDanial
Copy link
Owner

If I add a capability to work with git URLs, for example

cloc https://github.com/inducer/pudb.git

that would simply do the same thing as these two commands:

git clone https://github.com/inducer/pudb.git
cloc pudb/

I just don't understand the value in a new cloc capability to replace the two commands with one. What am I not getting? Are there other capabilities or benefits that I'm overlooking?

@Tholkappiar
Copy link
Author

The proposal suggests allowing cloc to analyze GitHub repositories directly from their URLs without the need for manual cloning. This enhancement aims to streamline the process and enhance user efficiency like reduced steps , user flexibility , Efficiency.
And yes , this is not the serious improvement , for the user and tool flexibility it can be done .
Thank you .

@AlDanial
Copy link
Owner

Yes, manual cloning will be avoided-but of course cloc will need to do the clone under the hood. I'm not ruling this out, I just see little value added.

@Tholkappiar
Copy link
Author

yeah I understood the value of this , compared to other feat , it should be in the low priority level . And this is just the idea which might increase the flexibility of the tool , consider this enhancement in lower priority level !

@includesec-erik
Copy link

I agree completely with @AlDanial on this one. Unix commands should do one thing well(TM) as much as possible. Adding capabilities already provide by other tools would bloat cloc and drive dev time away from it's core features.

Just use the two commands folks, it's better that each command do it's own thing well!

git clone https://github.com/inducer/pudb.git
cloc pudb/

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

No branches or pull requests

4 participants