wslgit
wslgit copied to clipboard
PhpStorm. Show history don't work.
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.
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?
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.)
Ok, can you somehow find out the exact command(s) used by PhpStorm for the "show history" function?
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
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?
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
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 simplegit log
.
https://yadi.sk/i/A8xfzFCzmNeFZg https://yadi.sk/i/FWs7De6Uq3RKrQ
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.
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