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

Interactive rebase does not work under windows #463

Closed
ThiemoVanEngelen opened this issue Jun 8, 2015 · 5 comments
Closed

Interactive rebase does not work under windows #463

ThiemoVanEngelen opened this issue Jun 8, 2015 · 5 comments

Comments

@ThiemoVanEngelen
Copy link

This is caused by the fact that git-cola sets GIT_SEQUENCE_EDITOR to git-xbase in cmds.py, but it is set to the windows path while the variable is used inside a shell script in git which requires linux style paths.

I got it to work by setting GIT_SEQUENCE_EDITOR in my global windows environment and removing the compat.setenv('GIT_SEQUENCE_EDITOR',...) and the compat.unsetenv('GIT_SEQUENCE_EDITOR') from cmds.py.

@davvid
Copy link
Member

davvid commented Jun 27, 2015

Thanks for the careful diagnosis. Can you show me an example of what the windows path looks like, and what the linux path should look like? is it,

C:\Program Files\share\git-cola\bin\git-xbase

which should instead be

/c/Program Files/share/git-cola/bin/git-xbase

? If so, we can probably do a platform check there and have a function that tweaks the variable we emit into the environment. what do you think?

@davvid davvid closed this as completed in 2eca074 Jul 1, 2015
@ThiemoVanEngelen
Copy link
Author

Tested by including the merging the changes to cmds.py into my installed version of git-cola.
It now seems to work, although my git-cola is not installed in "Program Files (x86)" and I don't know for sure if these spaces give problems.

@davvid
Copy link
Member

davvid commented Jul 1, 2015

Thanks.. I'm not actually hard-coding any paths, just doing a conversion :-) thanks for testing, and thanks for the report.

@loehnertj
Copy link

Fails with network paths!

Cure: in cmds.py:

def unix_path(path, is_win32=utils.is_win32):
    """Git for Windows requires unix paths, so force them here
    """
    unix_path = path
    if is_win32():
        first = path[0]
        second = path[1]
        if second == ':':  # sanity check, this better be a Windows-style path
            unix_path = '/' + first + path[2:].replace('\\', '/')
+        else:
+            unix_path = path.replace('\\', '/')

    return unix_path

davvid added a commit to davvid/git-cola that referenced this issue Jan 24, 2018
We need to always replace "\\" with "/" on Windows.
Adjust unix_path() so that the backslash-to-forward-slash
replacement is done before any other munging is performed.

Closes git-cola#463
Reported-by: Johannes Loehnert <loehnert.kde@gmx.net>
Signed-off-by: David Aguilar <davvid@gmail.com>
@davvid
Copy link
Member

davvid commented Jan 24, 2018

Nice catch @loehnertj I just pushed up a fix. Let me know if that works for you.

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

3 participants