Migrating from Subversion to Git with svn2git on Windows - ruby

I am using ruby installer to migrate from svn to git.I have encountered with an error like
C:\Ruby22-x64\bin>svn2git http://[Domain Name]/svn/trunk/Projname
1 [main] perl 2296 cygwin_exception::open_stackdumpfile: Dumping stack tra
ce to perl.exe.stackdump
1 [main] perl 2296 cygwin_exception::open_stackdumpfile: Dumping stack tra
ce to perl.exe.stackdump
[svn-remote "svn"] unknown
command failed:
git svn fetch
C:\Ruby22-x64\bin>
Can anyone pls help me to resolve this.

I don't know why git svn init (which this script was supposed to call) didn't do this, but you can do it yourself; put this in your .git/config:
[svn-remote "svn"]
fetch = trunk:refs/remotes/svn/master
url = http://[Domain Name]/svn/trunk/Projname

Related

push to Azure DevOps git repo: GCM: NullReferenceException

I installed GCM (Git Credential Manager) on my Windows OS. Using it I can push to GitLab and Bitbucket repositories, successfully. But about Azure DevOps:
>git push Azure master
fatal: NullReferenceException encountered.
Object reference not set to an instance of an object.
Then prompt for username (independent of GCM).
With trace:
>SET GIT_TRACE=1
>SET GCM_TRACE=1
>git push Azure master
17:34:02.362309 exec-cmd.c:236 trace: resolved executable dir: C:/Program Files/Git/mingw64/bin
17:34:02.364307 git.c:415 trace: built-in: git push Azure master
17:34:02.370303 run-command.c:637 trace: run_command: GIT_DIR=.git git remote-https Azure https://mirismaili.visualstudio.com/OpenLib/_git/Android
17:34:02.382598 exec-cmd.c:236 trace: resolved executable dir: C:/Program Files/Git/mingw64/libexec/git-core
17:34:02.383601 git.c:671 trace: exec: git-remote-https Azure https://mirismaili.visualstudio.com/OpenLib/_git/Android
17:34:02.384601 run-command.c:637 trace: run_command: git-remote-https Azure https://mirismaili.visualstudio.com/OpenLib/_git/Android
17:34:02.399961 exec-cmd.c:236 trace: resolved executable dir: C:/Program Files/Git/mingw64/libexec/git-core
17:34:03.391539 run-command.c:637 trace: run_command: 'git credential-manager get'
17:34:03.613232 exec-cmd.c:236 trace: resolved executable dir: C:/Program Files/Git/mingw64/libexec/git-core
17:34:03.615233 git.c:671 trace: exec: git-credential-manager get
17:34:03.615233 run-command.c:637 trace: run_command: git-credential-manager get
17:34:03.698676 ...\Common.cs:744 trace: [Main] git-credential-manager (v1.18.0) 'get'
17:34:03.793588 ...\Git\Where.cs:348 trace: [FindGitInstallations] found 1 Git installation(s).
17:34:03.802579 ...Configuration.cs:222 trace: [LoadGitConfiguration] git All config read, 38 entries.
17:34:03.809873 ...\Common.cs:543 trace: [LoadOperationArguments] useHttpPath = ''.
17:34:03.879804 ...\Common.cs:85 trace: [CreateAuthentication] detecting authority type for 'https://mirismaili.visualstudio.com/OpenLib/_git/Android'.
17:34:04.749863 ...uthentication.cs:229 trace: [DetectAuthority] detected 'https://mirismaili.visualstudio.com/' as Azure DevOps from GET response.
17:34:04.757022 ...\Program.cs:601 trace: [Run] ! error: 'Object reference not set to an instance of an object.'.
17:34:04.760018 ...\Common.cs:709 trace: [LogEvent] System.NullReferenceException: Object reference not set to an instance of an object.
at AzureDevOps.Authentication.Authentication.<DetectAuthority>d__34.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
at AzureDevOps.Authentication.Authentication.<GetAuthentication>d__35.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
at Microsoft.Alm.Cli.CommonFunctions.<CreateAuthentication>d__1.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
at Microsoft.Alm.Cli.CommonFunctions.<QueryCredentials>d__10.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
at Microsoft.Alm.Cli.Program.<<Get>b__24_0>d.MoveNext()
17:34:04.769048 ...\Program.cs:601 trace: [Run] fatal: NullReferenceException encountered.
Object reference not set to an instance of an object.
fatal: NullReferenceException encountered.
Object reference not set to an instance of an object.
17:34:04.793392 run-command.c:637 trace: run_command: bash -c 'test "a$SHELL" '\!'= "a${SHELL%.exe}" || exit 127; cat >/dev/tty && read -r line </dev/tty && echo "$line"'
Other useful information:
>git remote -v
Azure https://mirismaili.visualstudio.com/OpenLib/_git/Android (fetch)
Azure https://mirismaili.visualstudio.com/OpenLib/_git/Android (push)
BitBucket https://mirismaili#bitbucket.org/mirismaili/androidopenlib.git (fetch)
BitBucket https://mirismaili#bitbucket.org/mirismaili/androidopenlib.git (push)
GitLab https://mirismaili#gitlab.com/OpenLib/android.git (fetch)
GitLab https://mirismaili#gitlab.com/OpenLib/android.git (push)
>git version
git version 2.19.1.windows.1
>git credential-manager version
Git Credential Manager for Windows version 1.18.0
>git config -l
core.symlinks=false
core.autocrlf=true
core.fscache=true
color.diff=auto
color.status=auto
color.branch=auto
color.interactive=true
help.format=html
rebase.autosquash=true
http.sslbackend=schannel
diff.astextplain.textconv=astextplain
filter.lfs.clean=git-lfs clean -- %f
filter.lfs.smudge=git-lfs smudge -- %f
filter.lfs.process=git-lfs filter-process
filter.lfs.required=true
core.editor='C:\Program Files\Notepad++\notepad++.exe' -multiInst -notabbar -nosession -noPlugin
user.name=S. Mahdi Mir-Ismaili
user.email=s.m.mirismaili#gmail.com
gui.recentrepo=D:/I/Documents/CryptoCurrenciesSimulator
credential.usehttppath=true
credential.helper=manager
core.repositoryformatversion=0
core.filemode=false
core.bare=false
core.logallrefupdates=true
core.symlinks=false
core.ignorecase=true
remote.Azure.url=https://mirismaili.visualstudio.com/OpenLib/_git/Android
remote.Azure.fetch=+refs/heads/*:refs/remotes/Azure/*
branch.master.remote=BitBucket
branch.master.merge=refs/heads/master
remote.BitBucket.url=https://mirismaili#bitbucket.org/mirismaili/androidopenlib.git
remote.BitBucket.fetch=+refs/heads/*:refs/remotes/BitBucket/*
remote.GitLab.url=https://mirismaili#gitlab.com/OpenLib/android.git
remote.GitLab.fetch=+refs/heads/*:refs/remotes/GitLab/*
Another note is that I can push to Azure remote, with Visual Studio Team Services plugin for IntelliJ IDEs.
I updated GCM from v1.18.0 to v1.18.2 and the problem solved:
I think it was relevant to this BugFix on v1.18.1:
Fixes Null Reference exceptions when parameters or contentType are not populated
Hy
I had the same problem with all of my Azure-DevOps-Repos since today.
I believe this refers to the change from Visual Studio Team Services to DevOps.
My workaround was following:
I reconfigured GIT to save credentials:
git config --global credential.helper store
I signed in my DevOps-Account and created a new personal access token
I opened one of my repos and executed another fetch
After the NullReferenceException prompt, I entered my username and pasted the created access token inside the password prompt.
Now, on each interaction with the remote i get two NullReferenceException-Prompts but it works now for all of my Azure-DevOps-Repos...
I don't know how this will behave with other Repo-Services like GitHub and so on. I do only use Azure...
This is only a quik and dirty workaround. So I would appreciate if someone could share a better solution.
Thanks

Haskell on Windows - Stack fails to fetch package index

I'm trying to install Haskell on Windows. Downloaded the installer and just clicked through everything, then tried to use Stack to install a package, ran it from a temporary folder in which everything has write access:
C:\t>stack install hfmt
Using latest snapshot resolver: lts-8.3
Writing implicit global project config file to: C:\sr\global-project\stack.yaml
Note: You can change the snapshot via the resolver field there.
Downloaded lts-8.3 build plan.
Fetching package index ...=.git""=="gui" was unexpected at this time.
C:\sr\indices\Hackage\git-update\all-cabal-hashes>#if ""--git-dir=.git""=="gui" #goto gui
Process exited with ExitFailure 255: C:\Program Files (x86)\Git\cmd\git.CMD --git-dir=.git fetch --tags
Failed to fetch package index, retrying.
removeDirectoryRecursive: permission denied (Access is denied.)
What's going wrong, and how can I fix it? Or should I forget about Stack and just use Cabal instead?
Tried rerunning the command as administrator. This time the response was instant:
C:\t>stack install hfmt
Fetching package index ...=.git""=="gui" was unexpected at this time.
C:\sr\indices\Hackage\git-update\all-cabal-hashes>#if ""--git-dir=.git""=="gui" #goto gui
Process exited with ExitFailure 255: C:\Program Files (x86)\Git\cmd\git.CMD --git-dir=.git fetch --tags
Failed to fetch package index, retrying.
removeDirectoryRecursive: permission denied (Access is denied.)

Git for windows: fatal: early EOF

Yesterday I installed a new Git windows server 2.6.4 that was working fine with a Mac git client (git protocol)
Today I am struggling to get a 2nd client (Windows 7) to work. In the process of trying to make it work I have upgraded both the Windows server and client to the recently released git 2.7.0
I have tried disabling compression...I have tried both wireless and wired networks (the Windows client and server are sitting on the same desk). I have disabled AV on the client. I have tried tweaking the memory settings as suggested here
Here is the client output:
bash> git clone git://server.fqdn/repo.git
Cloning into 'repo'...
remote: 08:56:10.972997 git.c:348 trace: built-in: git 'pack-objects' '--revs' '--thin' '--stdout' '--progress' '--delta-base-offset'
remote: Counting objects: 76, done.
remote: Compressing objects: 100% (38/38), done.
Receiving objects: 100% (76/76), 8.31 KiB | 0 bytes/s, done.
fatal: read error: Invalid argument
fatal: early EOF
fatal: index-pack failed
bash>
Here is the server output:
bash> ./gitd.bat
D:\tools\gitd>set GIT_TRACE=1
D:\tools\gitd>D:\tools\Git\bin\git.exe daemon --reuseaddr --verbose --base-path=D:\git --export-all --enable=receive-pack
08:59:49.023778 git.c:561 trace: exec: 'git-daemon' '--reuseaddr' '--verbose' '--base-path=D:\git' '--export-all' '--enable=receive-pack'
08:59:49.023778 run-command.c:343 trace: run_command: 'git-daemon' '--reuseaddr' '--verbose' '--base-path=D:\git' '--export-all' '--enable=receive-pack'
[7376] Ready to rumble
09:00:03.056268 run-command.c:343 trace: run_command: 'D:\tools\Git\mingw64\libexec\git-core\git-daemon.exe' '--serve' '--reuseaddr' '--verbose' '--base-path=D:\git' '--export-all' '--enable=receive-pack'
[6492] Connection from 10...:54729
[6492] Extended attributes (27 bytes) exist
[6492] Request upload-pack for '/repo.git'
09:00:03.087469 run-command.c:343 trace: run_command: 'upload-pack' '--strict' '--timeout=0' '.'
[6492] 09:00:03.134269 git.c:561 trace: exec: 'git-upload-pack' '--strict' '--timeout=0' '.'
[6492] 09:00:03.134269 run-command.c:343 trace: run_command: 'git-upload-pack' '--strict' '--timeout=0' '.'
[6492] 09:00:03.617872 run-command.c:343 trace: run_command: 'pack-objects' '--revs' '--thin' '--stdout' '--progress' '--delta-base-offset'
What else can I try?
Git daemon is known to work on Windows only when some text is selected
in git daemon's console window (e.g., see
git clone fails with "index-pack" failed?).
This text selection delays daemon's output, which somehow helps (!). As
soon as text selection is cleared (with Escape key), cloning/fetching
fails most of the time. Select text again, and cloning/fetching resumes
to work. The problem can be easily reproduced on Windows 10 using git
2.11.0.windows.1 by cloning locally via
git clone git://127.0.0.1/my-repo.
I have found another solution, only start the **git-daemon.exe directly** e.g.
For the 64bit git:
"C:\Program Files\Git\mingw64\libexec\git-core\git-daemon.exe"
--> with the same paramters as git.exe.
Then it works without the selection text.

SVN repo migration from server to another server

I tried to migrated my repo without success. My original repository is on an old Windows server and the new server is a Windows server (2012).
Steps I follow:
1/ On the old server, I create a dump.
svnadmin dump PathtoMyOldRepo > MyOldRepo.svn_dump
Here, I see all revision diplayed like
* Revision 0 déchargée.
* Révision 1 déchargée.
* Rév...
All look ok
2/ I created a Repo on the new server with the follow command line:
svnadmin create --fs-type=bdb \NewRepoName
All look ok
3/ I tried to dump the old repo to the new repo and here, nothing work! Following command lines don't work:
svnadmin load /MyNewRepoName < //MyOldRepoPath
Here I've got an error message:
L'opérateur « < » est réservé à une utilisation futures
Traduction: Operator « < » is reserved to futur application
So, I tried to replacer the < with | or cat without success.
The command line svnadmin load /MyNewRepoName cat //MyOldRepoPath generated nothing. I press enter and the following message appear : Ent^te de fichier de sauvegarde malform'e traduction File Header malformed
Like you can see, I'n not very familiar with command lines and if you have a solution, I'll be very happy.
Try describe problem more accurately.
You dump data to file MyOldRepo.svn_dump and then what with this file? Nothing?
Then you try load data from misterious MyOldRepoPath. What is this?
And error subversion messages usually prefrixed with Enumber. It is valuable information.
Use full paths
PC1:
svnadmin dump c:\PathtoMyOldRepo > c:\MyOldRepo.svn_dump
PC2:
svnadmin load c:\PathtoMyNewRepo < c:\MyOldRepo.svn_dump
Just a little thing: dump and load are ok. But I can't checkout the new repo created with svnadmin create /NameOfNewRepo

How to debug Errno::EIO error in Chef recipe using Chef::Provider::Git

I'm trying to use chef to check out a git repo to a windows client node.
This seems simple enough and I've got the following resource definition:
git "C:\\pathtocheckout" do
repo "https://gitserver/repo.git"
action [ :checkout, :sync]
end
But when this is reached by chef-client I get:
Errno::EIO: git[C:\pathtocheckout] (cookbook_name::test line 21) had an error: Errno::EIO: Input/output error - CreateProcessW
I've had a look at the stacktrace produced and it appears to be something to do with creating a process to run the git command - but this is the limit of my knowledge.
I've made sure git is installed on on Path, removed all other recipes from the run list, running as a different admin user and I've tried different repositories but all with the same error.
So I'm pretty stumped - anyone got a way I can dig into this error and see what is going on?

Resources