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

'wc' is not recognized on Windows (have to use cygwin to use gitstats) #53

Open
KarolKaczmarek opened this issue Jul 15, 2015 · 4 comments

Comments

@KarolKaczmarek
Copy link

Hi,

I was unable to use gitstats on Windows (unless I run it through cygwin).

It complains that wc command is unrecognized, which is expected as it's not present on Windows:

C:\Program Files>python C:\git\gitstats\gitstats C:\git\DscPublisher C:\git\GitS
tatsOutputDscPublisher
[0.03100] >> gnuplot --version
Output path: C:\git\GitStatsOutputDscPublisher
Git path: C:\git\DscPublisher
Collecting data...
'wc' is not recognized as an internal or external command,
operable program or batch file.
[0.03100] >> git shortlog -s HEAD | wc -l
Traceback (most recent call last):
  File "C:\git\gitstats\gitstats", line 1490, in <module>
    g.run(sys.argv[1:])
  File "C:\git\gitstats\gitstats", line 1465, in run
    data.collect(gitpath)
  File "C:\git\gitstats\gitstats", line 289, in collect
    self.total_authors += int(getpipeoutput(['git shortlog -s %s' % getlogrange(
), 'wc -l']))
ValueError: invalid literal for int() with base 10: ''

One of the lines which uses wc is:

        self.total_authors += int(getpipeoutput(['git shortlog -s %s' % getlogrange(), 'wc -l']))

When I tried running gitstats through cygwin, everything worked, but I don't see it listed as requirement anywhere, so I'd assume it should be running on Windows without it as well.

@MatthiasKauer
Copy link

wc is present on my machine. I believe msysgit brought it.
Ok it didn't. Anaconda is a Python distribution and I'm not sure how it came in through that. Might be an option for you nevertheless.

C:\latex\phd-thesis-kauer>where wc
C:\Anaconda\Scripts\wc.exe

[edit: I'm not associated w/ this project]

@lensmartProject
Copy link

how to resolve this issue on windows

@dtwk2
Copy link

dtwk2 commented May 11, 2022

how to resolve this issue on windows

the steps for resolving this issue - as well as for resolving others that can arise with attempting to run gitstats- i found here.

They are

  • find your git installation e.g Program Files\Git or \AppData\Local\Programs\Git
  • go to the child folder, usr\bin (where wc.exe can be found)
  • add the complete path of the folder e.g Program Files\Git\usr\bin to the Path Environmental Variable
  • restart command prompt

@jackxu2046
Copy link

Thanks, it works using your way

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

6 participants