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

Comments

Projects
None yet
3 participants
@ThiemoVanEngelen

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

This comment has been minimized.

Show comment
Hide comment
@davvid

davvid Jun 27, 2015

Member

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?

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 in 2eca074 Jul 1, 2015

@ThiemoVanEngelen

This comment has been minimized.

Show comment
Hide comment
@ThiemoVanEngelen

ThiemoVanEngelen Jul 1, 2015

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.

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

This comment has been minimized.

Show comment
Hide comment
@davvid

davvid Jul 1, 2015

Member

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

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

This comment has been minimized.

Show comment
Hide comment
@loehnertj

loehnertj Jan 23, 2018

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

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

cmds: handle Windows network paths when rebasing
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 #463
Reported-by: Johannes Loehnert <loehnert.kde@gmx.net>
Signed-off-by: David Aguilar <davvid@gmail.com>
@davvid

This comment has been minimized.

Show comment
Hide comment
@davvid

davvid Jan 24, 2018

Member

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

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