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

git commit --amend fails #15

Open
gegles opened this issue Jan 24, 2018 · 1 comment
Open

git commit --amend fails #15

gegles opened this issue Jan 24, 2018 · 1 comment
Labels

Comments

@gegles
Copy link

gegles commented Jan 24, 2018

When trying to amend a commit, I see the following error:

Traceback (most recent call last):
  File "/Users/gegles/Workspaces/fasp.io/cmake/git-cmake-format/git-cmake-format.py", line 114, in <module>
    if not isFormattable(FileName):
  File "/Users/gegles/Workspaces/fasp.io/cmake/git-cmake-format/git-cmake-format.py", line 43, in isFormattable
    if '' != Dir and '' != os.path.commonprefix([os.path.relpath(File), os.path.relpath(Dir)]):
  File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/posixpath.py", line 428, in relpath
    raise ValueError("no path specified")
ValueError: no path specified

Probably need to support the script running with no actual files changed..

@kbenzie
Copy link
Owner

kbenzie commented Jan 27, 2018

I tried reproducing this in a simple test repo with the following steps on macOS
but was unsuccessful:

  • git init
  • Create CMakeLists.txt
    cmake_minimum_required(VERSION 3.4.3 FATAL_ERROR)
    project(check)
    add_subdirectory(git-cmake-format)
    add_executable(check check.cpp)
  • Create check.cpp
    int main() { return 0; }
  • git commit -m 'Add check executable'
  • git commit --amend <- worked as expected

Since this does not reproduce the circumstances which caused your error, is
there anything you can see which I have missed in order to be able to reproduce
your failure?

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

No branches or pull requests

2 participants