Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

Windows issues #20

Closed
ghost opened this issue Jan 18, 2017 · 7 comments
Closed

Windows issues #20

ghost opened this issue Jan 18, 2017 · 7 comments
Labels
enhancement User-facing feature enhancements windows Windows related issues

Comments

@ghost
Copy link

ghost commented Jan 18, 2017

When trying to install on windows 7 with python 2.7.11 - I got following error trace:

Collecting gitlint
  Using cached gitlint-0.8.0-py2.py3-none-any.whl
Collecting sh==1.11 (from gitlint)
  Using cached sh-1.11.tar.gz
    Complete output from command python setup.py egg_info:
    Traceback (most recent call last):
      File "<string>", line 1, in <module>
      File "c:\users\admin\appdata\local\temp\pip-build-q_3wmy\sh\setup.py", line 4, in <module>
        import sh
      File "sh.py", line 37, in <module>
        support." % __version__)
    ImportError: sh 1.11 is currently only supported on linux and osx. please install pbs 0.110 (http://pypi.python.org/pypi/pbs) for windows support.
    ----------------------------------------
Command "python setup.py egg_info" failed with error code 1 in c:\users\admin\appdata\local\temp\pip-build-q_3wmy\sh\

Installation of pbs 0.110 did not help to resolve the issue - same error occurs

@ghost ghost changed the title Installation on windows fail Installation on windows fails Jan 18, 2017
@jorisroovers
Copy link
Owner

gitlint currently doesn't support Windows. No concrete plans either, might be something for the future.

@jorisroovers jorisroovers added the enhancement User-facing feature enhancements label Jan 19, 2017
@jorisroovers jorisroovers changed the title Installation on windows fails Windows not supported Mar 11, 2017
jorisroovers pushed a commit that referenced this issue Mar 14, 2017
Users can now install gitlint on Windows, but will get an error when they try
executing it. While there is no direct roadmap for supporting gitlint on
Windows, this commit does already get rid of any errors at installation time.

This commit is part of #20.
jorisroovers pushed a commit that referenced this issue Mar 16, 2017
The 0.8.1 release brings minor tweaks and some experimental features.
Special thanks to tommyip for his contributions.

- Experimental: Linting a range of commits. Known Caveats: #23, #24.
  Thanks to tommyip for implementing this!
- Experimental: Python 3.6 support
- Improved Windows error messaging: gitlint will now show a more
  descriptive error message when ran on windows.
  See #20 for details on the lack of Windows support.

Full Release details in CHANGELOG.md.
@ghost
Copy link
Author

ghost commented May 24, 2017

thanks

@ghost ghost closed this as completed May 24, 2017
@jorisroovers
Copy link
Owner

Keeping this open, as we might still consider this in the future.

@jorisroovers jorisroovers reopened this May 24, 2017
jorisroovers pushed a commit that referenced this issue Jul 15, 2017
This commit introduces the gitlint.git._git(...) convenience function for
executing git commands.

The main benefit of this is that all error and unicode handling of git commands
is now uniform as it's done in a single place.

In addition, this refactor has the effect of the 'sh' library only being invoked
in a single place in the entire gitlint codebase. This will make it easier to
replace it in the future, for example when we'd consider adding Windows support
(see #20).

This commit also fixes some unit tests related to custom comment chars as
introduced by #34.
@Kristinita
Copy link

gitlint currently doesn't support Windows.

@jorisroovers , I think, it would be nice, if you will show it at the beginning of README and documentation, that Windows users do not waste their time.

Thanks.

@byrney byrney mentioned this issue Jul 11, 2018
jorisroovers added a commit that referenced this issue Jun 18, 2019
- Replaced all open() statements with io.open(), this improves unicode file
  handling
- Removed a bunch of hard-coded forward slashes to use os.path.join instead,
  this is more OS agnostic
- Replaced os.path.abspath with os.path.realpath for improved symlink handling

This commit relates to #20
@jorisroovers jorisroovers added the windows Windows related issues label Jul 5, 2019
jorisroovers added a commit that referenced this issue Jul 8, 2019
Experimental support for Windows (known issues can be found on the issue
tracker).

Related to #20 and heavily influenced by #71.
jorisroovers added a commit that referenced this issue Jul 8, 2019
Experimental support for Windows (known issues can be found on the issue
tracker).

Related to #20 and heavily influenced by #71.
jorisroovers added a commit that referenced this issue Jul 8, 2019
Experimental support for Windows (known issues can be found on the issue
tracker).

Related to #20 and heavily influenced by #71.
jorisroovers added a commit that referenced this issue Jul 8, 2019
Experimental support for Windows (known issues can be found on the issue
tracker).

Related to #20 and heavily influenced by #71.
@jorisroovers
Copy link
Owner

Made some time to work on this a bit. Relevant commits: cc5e6d8 and 20ac439.

I'm not a Windows user myself, but from the basic testing I did on a Windows 10 VM using Python 2.7 and Python 3.7, basic linting functionality seems to work. I'd appreciate anyone doing additional testing to confirm its working and report any bugs they find. I've already merged this work into master.

Things that work:

# lint latest commit
gitlint
gitlint -v --ignore T3,T5 # Options seem to work too

# Pass a message via stdin
echo "WIP: foöbar" > gitlint
git log -1 --pretty=%B | gitlint

# Commit ranges
gitlint --commits HEAD~2^..HEAD

However, I've also found a number of issues (some worse than others):
https://github.com/jorisroovers/gitlint/issues?q=is%3Aissue+is%3Aopen+label%3Awindows

I'll be releasing this (marked as experimental) as part of the 0.12.0 release later this week.

@ttwister
Copy link

ttwister commented Sep 16, 2019

edit(jorisroovers): Moved this comment to a new issue - see #107

Hello,

I tried creating user-defined rules on a Windows host (using Git-Bash) and those are not discovered.
I have created a CommitRule UC1 based on one of your examples.

Do you experience the same behavior?

$ gitlint --debug --extra-path myextensions/rules.py
DEBUG: gitlint.cli To report issues, please visit https://github.com/jorisroovers/gitlint/issues
DEBUG: gitlint.cli Platform: Windows-10-10.0.17763
DEBUG: gitlint.cli Python version: 2.7.16 (v2.7.16:413a49145e, Mar  4 2019, 01:37:19) [MSC v.1500 64 bit (AMD64)]
DEBUG: gitlint.cli Git version: git version 2.18.0.windows.1
DEBUG: gitlint.cli Gitlint version: 0.12.0
DEBUG: gitlint.cli GITLINT_USE_SH_LIB: [NOT SET]
DEBUG: gitlint.cli Configuration
config-path: C:\Users\xyz\path\.gitlint
[GENERAL]
extra-path: C:\Users\xyz\path\myextensions\rules.py
contrib: [u'contrib-title-conventional-commits']
ignore:
ignore-merge-commits: True
ignore-fixup-commits: True
ignore-squash-commits: True
ignore-stdin: True
verbosity: 3
debug: True
target: C:\Users\xyz\path
[RULES]
  I1: ignore-by-title
     ignore=all
     regex=^Release(.*)
  I2: ignore-by-body
     ignore=all
     regex=None
  T1: title-max-length
     line-length=70
[...]
  CT1: contrib-title-conventional-commits
     types=build,ci,doc,feat,fix,perf,refactor,style,test
[...]

@jorisroovers jorisroovers changed the title Windows not supported Windows issues Oct 18, 2020
@jorisroovers
Copy link
Owner

Since gitlint supports windows now and this issue is about nothing specific, I'm closing it

# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
enhancement User-facing feature enhancements windows Windows related issues
Projects
None yet
Development

No branches or pull requests

3 participants