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

PhpStorm. Show history don't work. #52

Open
zippaaa opened this issue Oct 9, 2018 · 9 comments
Open

PhpStorm. Show history don't work. #52

zippaaa opened this issue Oct 9, 2018 · 9 comments

Comments

@zippaaa
Copy link

zippaaa commented Oct 9, 2018

I do not know where the error or command is not working correctly.
I think phpstorm use "git log".
Video: https://yadi.sk/i/91cu-JL-yzmGyQ
(wgit = wslgit.exe)
Windows 1809. Ubuntu 18.05.

@andy-5
Copy link
Owner

andy-5 commented Oct 10, 2018

So, according to the video, the problem seems to be that git log using wslgit does not work if the (relative) path argument contains backslashes, right?

I recently added support for relative paths but didn't release a new version yet. Can you please test with the current test build of wslgit and report back if this fixes your problem?

@zippaaa
Copy link
Author

zippaaa commented Oct 10, 2018

I recently added support for relative paths but didn't release a new version yet.

Yes, "wgit log -- .\editor" working now,
But "show history" don't work.
Sorry, I don't know cause. (Can be used by another command.)

@andy-5
Copy link
Owner

andy-5 commented Oct 10, 2018

Ok, can you somehow find out the exact command(s) used by PhpStorm for the "show history" function?

@zippaaa
Copy link
Author

zippaaa commented Oct 10, 2018

Ok, can you somehow find out the exact command(s) used by PhpStorm for the "show history" function?

I do not know how.

I found a solution: UPD Link. https://gist.github.com/jmickela/7c383c78af66a37a2446fe7eb733b157#gistcomment-2654557

@andy-5
Copy link
Owner

andy-5 commented Oct 11, 2018

And using this small script the history command works? Because this script basically does the same thing as wslgit, except it does not translate paths, and therefore shows the exact same output for a simple git log.

But you can actually use this script to find the exact commands executed by PhpStorm. Just insert the following line somewhere into the script (e.g. at the end):

echo git %* >> %UserProfile%\git.log

After using it (from PhpStorm), you should find a file git.log in your user directory (i.e. C:\Users\YOU\git.log).

Can you please share the results of this after executing the history command from within PhpStorm?

@zippaaa
Copy link
Author

zippaaa commented Oct 11, 2018

Full log (project)

wsl git -c core.quotepath=false -c log.showSignature=false log HEAD --branches --remotes --max-count=2000 --pretty=format:"%x01%x01%H%x02%x02%ct%x02%x02%an%x02%x02%at%x02%x02%ae%x02%x02%cn%x02%x02%ce%x02%x02%P%x02%x02%s%x02%x02%b%x02%x02%B%x02%x02%d%x03%x03" --encoding=UTF-8 --decorate=full --
wsl git -c core.quotepath=false -c log.showSignature=false tag -l

File history

wsl git -c core.quotepath=false -c log.showSignature=false log -n1 --pretty=format:%x01%x01%H%x02%x02%ct%x03%x03 HEAD -- dir/my_file.php
wsl git -c core.quotepath=false -c log.showSignature=false log --name-status --pretty=format:%x01%x01%H%x02%x02%ct%x02%x02%an%x02%x02%ae%x02%x02%cn%x02%x02%ce%x02%x02%P%x02%x02%s%x02%x02%b%x02%x02%B%x02%x02%at%x03%x03 --encoding=UTF-8 HEAD --full-history --simplify-merges --max-count=1000 -- dir/my_file.php
wsl git -c core.quotepath=false -c log.showSignature=false show -M --name-status --pretty=format:%x01%x01%H%x02%x02%ct%x02%x02%P%x03%x03 --encoding=UTF-8 646fdb5ea77acd3d98f0166527c892665488922c --follow -- dir/my_file.php
wsl git -c core.quotepath=false -c log.showSignature=false log -n1 --pretty=format:%x01%x01%H%x02%x02%ct%x03%x03 HEAD -- dir/my_file.php

Directory history

wsl git -c core.quotepath=false -c log.showSignature=false log -n1 --pretty=format:%x01%x01%H%x02%x02%ct%x03%x03 HEAD -- dir/my_dir
wsl git -c core.quotepath=false -c log.showSignature=false log --name-status --pretty=format:%x01%x01%H%x02%x02%ct%x02%x02%an%x02%x02%ae%x02%x02%cn%x02%x02%ce%x02%x02%P%x02%x02%s%x02%x02%b%x02%x02%B%x02%x02%at%x03%x03 --encoding=UTF-8 HEAD --full-history --simplify-merges --max-count=1000 -- dir/my_dir
wsl git -c core.quotepath=false -c log.showSignature=false show -M --name-status --pretty=format:%x01%x01%H%x02%x02%ct%x02%x02%P%x03%x03 --encoding=UTF-8 20f0a9a3915e12f28f5d2b6ebc1801f69e78c4bd --follow -- dir/my_dir

Project:

|-.git
|-dir
      |-my_dir
      |-my_file.php

@zippaaa
Copy link
Author

zippaaa commented Oct 11, 2018

And using this small script the history command works? Because this script basically does the same thing as wslgit, except it does not translate paths, and therefore shows the exact same output for a simple git log.

https://yadi.sk/i/A8xfzFCzmNeFZg
https://yadi.sk/i/FWs7De6Uq3RKrQ

@andy-5
Copy link
Owner

andy-5 commented Oct 12, 2018

Thank you for the logs. A quick test did not reveal any errors, however. All of these commands seem to work fine using wslgit. I will probably have to compare the output to native Git (or the script mentioned above) to see if there are any differences.

@SvenZhao
Copy link

Ok, can you somehow find out the exact command(s) used by PhpStorm for the "show history" function?

I do not know how.

I found a solution: UPD Link. https://gist.github.com/jmickela/7c383c78af66a37a2446fe7eb733b157#gistcomment-2654557

This script outputs Chinese garbled
I found this:

@echo off
setlocal enabledelayedexpansion
set command=%*
set find=C:\Users\%USERNAME%\AppData\Local\Temp\git-commit-msg-.txt
set replace=/mnt/c/Users/%USERNAME%/AppData/Local/Temp/git-commit-msg-.txt
call set command=%%command:!find!=!replace!%%
If %PROCESSOR_ARCHITECTURE% == x86 (
    C:\Windows\Sysnative\wsl.exe git %command%
) Else (
  wsl git %command%
)

it's work on win10 1809

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