Problem when attempting to checkin files beginning with a '.' #188

Open
perkof opened this Issue Jul 2, 2012 · 20 comments

Comments

Projects
None yet
3 participants
@perkof

perkof commented Jul 2, 2012

Hi,

I am having an issue when I attempt to push a commit to TFS that includes a file with a name beginning with a '.' - such as a .htaccess file.

To test this I have cloned a fresh copy of my repository. Created a single file called '.myFakeDotFile' with no contents and committed the changeset.

When I attempt to push the changes to TFS I see the following output.

Y:\Git\Repo [master +8 ~0 -0 !]> git tfs rcheckin
Fetching changes from TFS to minimize possibility of late conflict...
Starting checkin of 15769641 'DotFileTest'
add Trunk/.myFakeDotFile
Object reference not set to an instance of an object.

The appropriate lines from git tfs rcheckin -d are as follows

git command time: [00:00:00.0498047] cat-file -p 49cc8ef0e116cef009fe0bd72473a964bbd07f9b
 add Trunk/.myFakeDotFile
System.Reflection.TargetInvocationException: Exception has been thrown by the target of an invocation. ---> System.NullR
eferenceException: Object reference not set to an instance of an object.
   at Sep.Git.Tfs.VsCommon.TfsHelperBase.NonFatalError(Object sender, ExceptionEventArgs e)
   at Microsoft.TeamFoundation.VersionControl.Client.ExceptionEventHandler.Invoke(Object sender, ExceptionEventArgs e)
   at Microsoft.TeamFoundation.VersionControl.Client.Client.OnNonFatalError(ExceptionEventArgs e)
   at Microsoft.TeamFoundation.VersionControl.Client.Client.OnNonFatalError(Exception exception, Workspace workspace)
   at Microsoft.TeamFoundation.VersionControl.Client.FileSystemWalker.CheckNoFileMatches()
   at Microsoft.TeamFoundation.VersionControl.Client.FileSystemWalker.NextFileSpec()
   at Microsoft.TeamFoundation.VersionControl.Client.FileSystemWalker.<GetEnumerator>d__0.MoveNext()
   at Microsoft.TeamFoundation.VersionControl.Client.Workspace.PendAdd(String[] paths, Boolean isRecursive, String fileT
ype, LockLevel lockLevel, Boolean treatMissingItemsAsFiles, Boolean silent)
   at Microsoft.TeamFoundation.VersionControl.Client.Workspace.PendAdd(String path, Boolean isRecursive)
   at Sep.Git.Tfs.VsCommon.WrapperForWorkspace.PendAdd(String path)
   at Sep.Git.Tfs.Core.TfsWorkspace.Add(String path) in c:\Users\matt\dev\github\git-tfs\GitTfs\Core\TfsWorkspace.cs:lin
e 123
   at Sep.Git.Tfs.Core.Changes.Git.Add.Apply(ITfsWorkspace workspace) in c:\Users\matt\dev\github\git-tfs\GitTfs\Core\Ch
anges\Git\Add.cs:line 18
   at Sep.Git.Tfs.Core.GitTfsRemote.PendChangesToWorkspace(String head, String parent, ITfsWorkspace workspace) in c:\Us
ers\matt\dev\github\git-tfs\GitTfs\Core\GitTfsRemote.cs:line 469
   at Sep.Git.Tfs.Core.GitTfsRemote.<>c__DisplayClass26.<Checkin>b__25(ITfsWorkspace workspace) in c:\Users\matt\dev\git
hub\git-tfs\GitTfs\Core\GitTfsRemote.cs:line 477
   at Sep.Git.Tfs.VsCommon.TfsHelperBase.WithWorkspace(String localDirectory, IGitTfsRemote remote, TfsChangesetInfo ver
sionToFetch, Action`1 action)
   at Sep.Git.Tfs.Core.GitTfsRemote.Checkin(String head, TfsChangesetInfo parentChangeset) in c:\Users\matt\dev\github\g
it-tfs\GitTfs\Core\GitTfsRemote.cs:line 476
   at Sep.Git.Tfs.Commands.Rcheckin.PerformRCheckin(TfsChangesetInfo parentChangeset) in c:\Users\matt\dev\github\git-tf
s\GitTfs\Commands\Rcheckin.cs:line 149
   at Sep.Git.Tfs.Core.TfsWriter.Write(String refToWrite, Func`2 write) in c:\Users\matt\dev\github\git-tfs\GitTfs\Core\
TfsWriter.cs:line 29
   at Sep.Git.Tfs.Commands.Rcheckin.Run() in c:\Users\matt\dev\github\git-tfs\GitTfs\Commands\Rcheckin.cs:line 45
   --- End of inner exception stack trace ---
   at System.RuntimeMethodHandle._InvokeMethodFast(IRuntimeMethodInfo method, Object target, Object[] arguments, Signatu
reStruct& sig, MethodAttributes methodAttributes, RuntimeType typeOwner)
   at System.RuntimeMethodHandle.InvokeMethodFast(IRuntimeMethodInfo method, Object target, Object[] arguments, Signatur
e sig, MethodAttributes methodAttributes, RuntimeType typeOwner)
   at System.Reflection.RuntimeMethodInfo.Invoke(Object obj, BindingFlags invokeAttr, Binder binder, Object[] parameters
, CultureInfo culture, Boolean skipVisibilityChecks)
   at System.Reflection.RuntimeMethodInfo.Invoke(Object obj, BindingFlags invokeAttr, Binder binder, Object[] parameters
, CultureInfo culture)
   at Sep.Git.Tfs.Util.GitTfsCommandRunner.Run(GitTfsCommand command, IList`1 args) in c:\Users\matt\dev\github\git-tfs\
GitTfs\Util\GitTfsCommandRunner.cs:line 36
   at Sep.Git.Tfs.GitTfs.Main(GitTfsCommand command, IList`1 unparsedArgs) in c:\Users\matt\dev\github\git-tfs\GitTfs\Gi
tTfs.cs:line 56
   at Sep.Git.Tfs.GitTfs.Run(IList`1 args) in c:\Users\matt\dev\github\git-tfs\GitTfs\GitTfs.cs:line 40
   at Sep.Git.Tfs.Program.Main(String[] args) in c:\Users\matt\dev\github\git-tfs\GitTfs\Program.cs:line 24
Object reference not set to an instance of an object.
@sc68cal

This comment has been minimized.

Show comment Hide comment
@sc68cal

sc68cal Jul 16, 2012

Contributor

The exception is being thrown inside the TFS library. It may not like files that are zero length, since other files with a period (such as .gitignore) usually go in just fine.

Contributor

sc68cal commented Jul 16, 2012

The exception is being thrown inside the TFS library. It may not like files that are zero length, since other files with a period (such as .gitignore) usually go in just fine.

@SchallerJe

This comment has been minimized.

Show comment Hide comment
@SchallerJe

SchallerJe Aug 9, 2012

@sc68cal I am experiencing the same problem with the ".gitignore" and I seem to be the only one. The git repository resides on a network share. Could that be a problem? (All files not starting with a '.' work as expected.)

@sc68cal I am experiencing the same problem with the ".gitignore" and I seem to be the only one. The git repository resides on a network share. Could that be a problem? (All files not starting with a '.' work as expected.)

@sc68cal

This comment has been minimized.

Show comment Hide comment
@sc68cal

sc68cal Aug 9, 2012

Contributor

Let's take the decidedly low-tech approach - could you copy it to your local drive and give it a shot?

Contributor

sc68cal commented Aug 9, 2012

Let's take the decidedly low-tech approach - could you copy it to your local drive and give it a shot?

@SchallerJe

This comment has been minimized.

Show comment Hide comment
@SchallerJe

SchallerJe Aug 9, 2012

@sc68cal I tried that with strange results:

$ git tfs checkintool
Access to the path 'c:_data\bla\dev.git\tfs\default\workspace.gitignore' is denied.

Which is not true. Access rights are correct.
When setting up a new repo locally, adding a ".gitignore" file works.

It maybe my setup:
I am using git on a mac sharing the repo into windows using Parallels Desktop, since git-tfs only works on Windows.

Any ideas?

@sc68cal I tried that with strange results:

$ git tfs checkintool
Access to the path 'c:_data\bla\dev.git\tfs\default\workspace.gitignore' is denied.

Which is not true. Access rights are correct.
When setting up a new repo locally, adding a ".gitignore" file works.

It maybe my setup:
I am using git on a mac sharing the repo into windows using Parallels Desktop, since git-tfs only works on Windows.

Any ideas?

@sc68cal

This comment has been minimized.

Show comment Hide comment
@sc68cal

sc68cal Aug 9, 2012

Contributor

c:_data\bla\dev.git\tfs\default\workspace.gitignore

There is a lot wrong with that path. Is that the exact output you get?!

Contributor

sc68cal commented Aug 9, 2012

c:_data\bla\dev.git\tfs\default\workspace.gitignore

There is a lot wrong with that path. Is that the exact output you get?!

@SchallerJe

This comment has been minimized.

Show comment Hide comment
@SchallerJe

SchallerJe Aug 9, 2012

Yep, that the copied output. I will try again cloning from TFS to a local folder.
You say a lot is wrong? Is it the .gitignore inside the workspace for example?

Yep, that the copied output. I will try again cloning from TFS to a local folder.
You say a lot is wrong? Is it the .gitignore inside the workspace for example?

@sc68cal

This comment has been minimized.

Show comment Hide comment
@sc68cal

sc68cal Aug 9, 2012

Contributor

Well - there's no slash after workspace and also the c:_data should be c:\data

Contributor

sc68cal commented Aug 9, 2012

Well - there's no slash after workspace and also the c:_data should be c:\data

@SchallerJe

This comment has been minimized.

Show comment Hide comment
@SchallerJe

SchallerJe Aug 9, 2012

Oops, I didn't see that. That was a strange copy and paste error, which I can't reproduce. The correct line is:
c:_data\bla\dev.git\tfs\default\workspace.gitignore

Oops, I didn't see that. That was a strange copy and paste error, which I can't reproduce. The correct line is:
c:_data\bla\dev.git\tfs\default\workspace.gitignore

@sc68cal

This comment has been minimized.

Show comment Hide comment
@sc68cal

sc68cal Aug 9, 2012

Contributor

That is still strange. c:_data

Contributor

sc68cal commented Aug 9, 2012

That is still strange. c:_data

@SchallerJe

This comment has been minimized.

Show comment Hide comment
@SchallerJe

SchallerJe Aug 9, 2012

Dang, again: When I publish the comment it strips out the backslashes after "c:" and "workspace". So there are normal backslashes, but I can't seem to post them. Sorry for spamming.

Dang, again: When I publish the comment it strips out the backslashes after "c:" and "workspace". So there are normal backslashes, but I can't seem to post them. Sorry for spamming.

@sc68cal

This comment has been minimized.

Show comment Hide comment
@sc68cal

sc68cal Aug 9, 2012

Contributor

OK. There is a tfs\default\workspace, yes?

Contributor

sc68cal commented Aug 9, 2012

OK. There is a tfs\default\workspace, yes?

@SchallerJe

This comment has been minimized.

Show comment Hide comment
@SchallerJe

SchallerJe Aug 9, 2012

Strangely the TFS URL contains tfs\DMS. The tfs\default\workspace seems to be created by git-tfs. Or am I getting that wrong?
Or do you mean the folder? Yes, the folder exists.

Strangely the TFS URL contains tfs\DMS. The tfs\default\workspace seems to be created by git-tfs. Or am I getting that wrong?
Or do you mean the folder? Yes, the folder exists.

@perkof

This comment has been minimized.

Show comment Hide comment
@perkof

perkof Aug 9, 2012

This matches my setup exactly.

Sent from my iPhone.

On 10/08/2012, at 4:54, SchallerJe notifications@github.com wrote:

@sc68cal I tried that with strange results:
$ git tfs checkintool
Access to the path 'c:_data\bla\dev.git\tfs\default\workspace.gitignore' is denied.
Which is not true. Access rights are correct.
When setting up a new repo locally, adding a ".gitignore" file works.

It maybe my setup:
I am using git on a mac sharing the repo into windows using Parallels Desktop, since git-tfs only works on Windows.

Any ideas?


Reply to this email directly or view it on GitHub.

perkof commented Aug 9, 2012

This matches my setup exactly.

Sent from my iPhone.

On 10/08/2012, at 4:54, SchallerJe notifications@github.com wrote:

@sc68cal I tried that with strange results:
$ git tfs checkintool
Access to the path 'c:_data\bla\dev.git\tfs\default\workspace.gitignore' is denied.
Which is not true. Access rights are correct.
When setting up a new repo locally, adding a ".gitignore" file works.

It maybe my setup:
I am using git on a mac sharing the repo into windows using Parallels Desktop, since git-tfs only works on Windows.

Any ideas?


Reply to this email directly or view it on GitHub.

@SchallerJe

This comment has been minimized.

Show comment Hide comment
@SchallerJe

SchallerJe Aug 9, 2012

@perkof And I guess you haven't fixed it, right?

@perkof And I guess you haven't fixed it, right?

@SchallerJe

This comment has been minimized.

Show comment Hide comment
@SchallerJe

SchallerJe Aug 9, 2012

OK, here is what I could find so far:

  • When creating the git repo directly on the Parallels share the problem occurs.
  • When creating the git repo on the Windows machine, copying it over to the Mac, committing some changes and copying it back to the Windows machine, the git-tfs checkin works fine.

So it seems to be some kind of weird Parallels Share/networking issue.
Since Parallels support is "quite awesome", I guess it's no use contacting them.

Any ideas would really be great.

OK, here is what I could find so far:

  • When creating the git repo directly on the Parallels share the problem occurs.
  • When creating the git repo on the Windows machine, copying it over to the Mac, committing some changes and copying it back to the Windows machine, the git-tfs checkin works fine.

So it seems to be some kind of weird Parallels Share/networking issue.
Since Parallels support is "quite awesome", I guess it's no use contacting them.

Any ideas would really be great.

@sc68cal

This comment has been minimized.

Show comment Hide comment
@sc68cal

sc68cal Aug 10, 2012

Contributor

My suggestion is to not use Parallels' share feature - it apparently has a bug in path translation, or something. If you are developing on the mac - commit your changes to a local git repository, then pull them into a repository in the Windows VM. Then, from the Windows VM push them into the TFS server with Git-Tfs.

Contributor

sc68cal commented Aug 10, 2012

My suggestion is to not use Parallels' share feature - it apparently has a bug in path translation, or something. If you are developing on the mac - commit your changes to a local git repository, then pull them into a repository in the Windows VM. Then, from the Windows VM push them into the TFS server with Git-Tfs.

@SchallerJe

This comment has been minimized.

Show comment Hide comment
@SchallerJe

SchallerJe Aug 10, 2012

That's exactly what I set up this morning and it works like a charm. Thank you for confirming that it's the right way!
And thanks so much for your awesome work!

That's exactly what I set up this morning and it works like a charm. Thank you for confirming that it's the right way!
And thanks so much for your awesome work!

@sc68cal

This comment has been minimized.

Show comment Hide comment
@sc68cal

sc68cal Aug 11, 2012

Contributor

@perkof You mentioned that your setup is similar. Has this resolved your issue?

Contributor

sc68cal commented Aug 11, 2012

@perkof You mentioned that your setup is similar. Has this resolved your issue?

@perkof

This comment has been minimized.

Show comment Hide comment
@perkof

perkof Aug 13, 2012

hi @sc68cal I will investigate this today and let you know.

perkof commented Aug 13, 2012

hi @sc68cal I will investigate this today and let you know.

@sc68cal

This comment has been minimized.

Show comment Hide comment
@sc68cal

sc68cal Aug 24, 2012

Contributor

@perkof Ping?

Contributor

sc68cal commented Aug 24, 2012

@perkof Ping?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment