Author Topic: Compare Project with GIT  (Read 5560 times)

jporkkahtc

  • Senior Community Member
  • Posts: 2620
  • Hero Points: 210
  • Text
Compare Project with GIT
« on: July 20, 2016, 06:07:51 PM »

I have a workspace with a bunch of projects. The workspace itself, all of the projects and most of the code are in C:\src\PrimaryRepo The active project is C:\src\PrimaryRepo\ExternalCode.vpj, whose files are all in C:\src\ExternalCode These are separate GIT repos ... C:\src\PrimaryRepo\.git C:\src\ExternalCode\.git In project ExternalCode, I have one Wildcard recursive entry for Files. In project properties, it shows up as ..\ExternalCode\*.cs In list-buffers Project tab I verified all files are in ..\ExternalCode. Yet, when I do version control -> Compare Project with GIT it shows me files under C:\src\ExternalCode and c:\src\MostlyThere. The files under ExternalCode are a figment of Slicks imagination. There are several files which I have modified in both folders. Two example files in ExternalCode: C:\src\ExternalCode\dir1\MyCode.cs C:\src\ExternalCode\dir2\Foobar.txt In the "Git update project" window (BTW, this is an odd name for the dialog that opens from CompareProjectWithGit). I see C:\src\ C:\src\ExternalCode C:\src\ExternalCode\.vs C:\src\ExternalCode\dir1 MyCode.cs C:\src\ExternalCode\dir2 Foobar.txt ExternalCode.sln C:\src\ C:\src\PrimaryRepo C:\src\PrimaryRepo\.vs C:\src\PrimaryRepo\dir1 MyCode.cs C:\src\PrimaryRepo\dir2 Foobar.txt ExternalCode.sln All the files under C:\src\PrimaryRepo Have a little folder icon with a red-x (indicating deleted?) The hover-tooltip for these show "This directory exists locally, but no longer exists in the repo". What directory? This is a FILE. All the files under C:\src\ExternalCode Have a little folder icon. C:\src\ExternalCode\.vs Has a yellow folder with a ? overlay; ToolTip: This directory does not exist in the repo" While C:\src\PrimaryRepo\.vs Has a white folder with a ? overlay;  ToolTip: This FILE does not exist in the repo" Why is it a file here, but a folder above? BUG1: All of the different files in ExternalCode are also figments in C:\src\PrimaryRepo. BUG2: Why is it showing me "Foobar.txt" and "ExternalCode.sln"? These files, while modified, are't in the current project. BUG3: When I click on any of the figments under C:\src\PrimaryRepo, slick complains: --------------------------- SlickEdit Pro --------------------------- File not found --------------------------- OK --------------------------- Of course this file isn't found, it doesn't exist and never has. If slick thinks they are deleted, why would it try to find them? BUG4: All "File not found" type errors should include the full path of the file that it thinks isn't found. BUG5: Why for C:\src\ExternalCode\.vs does it not show the new files, just the folder? BUG6: The results are different depending on Slicks current directory. If I start with a buffer of a file in C:\src\ExternalCode, the results are as above. If I start with a buffer of a file in C:\src\PrimaryRepo, then it shows all the files different in C:\src\PrimaryRepo, but again in both places. Since the active project is ExternalCode.vpj, why should it matter which buffer is active when I issue this command? BUG7: If I start in a buffer that isn't in a GIT repo at all, I get: --------------------------- SlickEdit Pro --------------------------- Could not get status for file 'fatal: Not a git repository (or any of the parent directories): .git fatal: Not a git repository (or any of the parent directories): .git '. --------------------------- OK --------------------------- Bug 7.1: The text of that dialog is messed up. The file is 'fatal: not ....' ??? Bug 7.2: Why should it care which buffer is active?
« Last Edit: July 20, 2016, 09:40:26 PM by Clark »

jporkkahtc

  • Senior Community Member
  • Posts: 2620
  • Hero Points: 210
  • Text
Re: Compare Project with GIT
« Reply #1 on: July 20, 2016, 10:21:12 PM »

Note: Copy-n-paste from Slickedit to Chrome on this forum doesn't work very well :-(
Below I copied it thru Notepad....


I have a workspace with a bunch of projects.
The workspace itself, all of the projects and most of the code are in
C:\src\PrimaryRepo


The active project is C:\src\PrimaryRepo\ExternalCode.vpj, whose files are all in
   C:\src\ExternalCode


These are separate GIT repos ...
   C:\src\PrimaryRepo\.git
   C:\src\ExternalCode\.git


In project ExternalCode, I have one Wildcard recursive entry for Files.
In project properties, it shows up as
   ..\ExternalCode\*.cs


In list-buffers Project tab I verified all files are in ..\ExternalCode.


Yet, when I do version control -> Compare Project with GIT it shows me files under C:\src\ExternalCode and c:\src\MostlyThere.
The files under ExternalCode are a figment of Slicks imagination.


There are several files which I have modified in both folders.
Two example files in ExternalCode:
    C:\src\ExternalCode\dir1\MyCode.cs
    C:\src\ExternalCode\dir2\Foobar.txt


In the "Git update project" window (BTW, this is an odd name for the dialog that opens from CompareProjectWithGit).
I see
   C:\src\
      C:\src\ExternalCode
        C:\src\ExternalCode\.vs
        C:\src\ExternalCode\dir1
         MyCode.cs
        C:\src\ExternalCode\dir2
         Foobar.txt


       ExternalCode.sln


   C:\src\
      C:\src\PrimaryRepo
        C:\src\PrimaryRepo\.vs
        C:\src\PrimaryRepo\dir1
         MyCode.cs
        C:\src\PrimaryRepo\dir2
         Foobar.txt
       ExternalCode.sln


All the files under
   C:\src\PrimaryRepo
Have a little folder icon with a red-x (indicating deleted?)
The hover-tooltip for these show "This directory exists locally, but no longer exists in the repo".
What directory? This is a FILE.


All the files under
   C:\src\ExternalCode
Have a little folder icon.
        C:\src\ExternalCode\.vs
Has a yellow folder with a ? overlay; ToolTip: This directory does not exist in the repo"
While
        C:\src\PrimaryRepo\.vs
Has a white folder with a ? overlay;  ToolTip: This FILE does not exist in the repo"
Why is it a file here, but a folder above?










BUG1: All of the different files in ExternalCode are also figments in C:\src\PrimaryRepo.


BUG2: Why is it showing me "Foobar.txt" and "ExternalCode.sln"?
These files, while modified, are't in the current project.




BUG3: When I click on any of the figments under C:\src\PrimaryRepo, slick complains:
   ---------------------------
   SlickEdit Pro
   ---------------------------
   File not found
   ---------------------------
   OK   
   ---------------------------
Of course this file isn't found, it doesn't exist and never has.
If slick thinks they are deleted, why would it try to find them?




BUG4: All "File not found" type errors should include the full path of the file that it thinks isn't found.


BUG5: Why for
        C:\src\ExternalCode\.vs
does it not show the new files, just the folder?




BUG6: The results are different depending on Slicks current directory.
If I start with a buffer of a file in C:\src\ExternalCode, the results are as above.
If I start with a buffer of a file in C:\src\PrimaryRepo, then it shows all the files different in C:\src\PrimaryRepo, but again in both places.


Since the active project is ExternalCode.vpj, why should it matter which buffer is active when I issue this command?




BUG7: If I start in a buffer that isn't in a GIT repo at all, I get:
   ---------------------------
   SlickEdit Pro
   ---------------------------
   Could not get status for file 'fatal: Not a git repository (or any of the parent directories): .git
   fatal: Not a git repository (or any of the parent directories): .git
   '.
   ---------------------------
   OK   
   ---------------------------
Bug 7.1: The text of that dialog is messed up. The file is 'fatal: not ....' ? ? ?


Bug 7.2: Why should it care which buffer is active?








Clark

  • SlickEdit Team Member
  • Senior Community Member
  • *
  • Posts: 6862
  • Hero Points: 528
Re: Compare Project with GIT
« Reply #2 on: July 20, 2016, 11:08:04 PM »
I use chrome (only chrome on Windows) and never have any problems when I paste from SlickEdit. I do this all the time for longer posts. What are you doing?

jporkkahtc

  • Senior Community Member
  • Posts: 2620
  • Hero Points: 210
  • Text
Re: Compare Project with GIT
« Reply #3 on: July 20, 2016, 11:28:48 PM »

 
(The CL7 files are clipboard data from "Free clipboard viewer 3.0")
OK, so I did file->New, default encoding, default line format.
I typed phrase "the quick...", which each word on a new line.
Select-all, copy.
Repros with HTML clips enabled or not in slick.
In slick, hex view, the file has CRLF endings.
Paste into here, and this is what I get:

 the quick brown fox jumped over the lazy dog
NOTE though: In the edit window here, the text looks fine -- its all on separate lines

Clark

  • SlickEdit Team Member
  • Senior Community Member
  • *
  • Posts: 6862
  • Hero Points: 528
Re: Compare Project with GIT
« Reply #4 on: July 20, 2016, 11:57:53 PM »
This works for me with or without HTML clipboards. I can only guess that your Chrome is configured differently than mine.

It looks like the only difference between the .cl7 files is that SlickEdit has an extra clipboard format type. Is that what you saw?

I haven't done anything fancy with my chrome configuration. I use chrome on 3 different windows machines. I only tested this on one of them. It was running Windows 10. One of my Windows machines is Windows 7.

Dan

  • SlickEdit Team Member
  • Senior Community Member
  • *
  • Posts: 2897
  • Hero Points: 153
Re: Compare Project with GIT
« Reply #5 on: July 21, 2016, 01:47:19 PM »

Note: Copy-n-paste from Slickedit to Chrome on this forum doesn't work very well :-(
Below I copied it thru Notepad....


I have a workspace with a bunch of projects.
The workspace itself, all of the projects and most of the code are in
C:\src\PrimaryRepo


The active project is C:\src\PrimaryRepo\ExternalCode.vpj, whose files are all in
   C:\src\ExternalCode


These are separate GIT repos ...
   C:\src\PrimaryRepo\.git
   C:\src\ExternalCode\.git


In project ExternalCode, I have one Wildcard recursive entry for Files.
In project properties, it shows up as
   ..\ExternalCode\*.cs


In list-buffers Project tab I verified all files are in ..\ExternalCode.


Yet, when I do version control -> Compare Project with GIT it shows me files under C:\src\ExternalCode and c:\src\MostlyThere.
The files under ExternalCode are a figment of Slicks imagination.


There are several files which I have modified in both folders.
Two example files in ExternalCode:
    C:\src\ExternalCode\dir1\MyCode.cs
    C:\src\ExternalCode\dir2\Foobar.txt


In the "Git update project" window (BTW, this is an odd name for the dialog that opens from CompareProjectWithGit).
I see
   C:\src\
      C:\src\ExternalCode
        C:\src\ExternalCode\.vs
        C:\src\ExternalCode\dir1
         MyCode.cs
        C:\src\ExternalCode\dir2
         Foobar.txt


       ExternalCode.sln


   C:\src\
      C:\src\PrimaryRepo
        C:\src\PrimaryRepo\.vs
        C:\src\PrimaryRepo\dir1
         MyCode.cs
        C:\src\PrimaryRepo\dir2
         Foobar.txt
       ExternalCode.sln


All the files under
   C:\src\PrimaryRepo
Have a little folder icon with a red-x (indicating deleted?)
The hover-tooltip for these show "This directory exists locally, but no longer exists in the repo".
What directory? This is a FILE.


All the files under
   C:\src\ExternalCode
Have a little folder icon.
        C:\src\ExternalCode\.vs
Has a yellow folder with a ? overlay; ToolTip: This directory does not exist in the repo"
While
        C:\src\PrimaryRepo\.vs
Has a white folder with a ? overlay;  ToolTip: This FILE does not exist in the repo"
Why is it a file here, but a folder above?









Thanks for posting this again reformatted.  It was hard to read before.  I'm going to have to work on setting up a similar scenario.  It'll take a little doing.  I don't suppose these are public repositories?

BUG1: All of the different files in ExternalCode are also figments in C:\src\PrimaryRepo.


BUG2: Why is it showing me "Foobar.txt" and "ExternalCode.sln"?
These files, while modified, are't in the current project.

We take anything in the project's working directory.  We don't actually verify that the files are in the current project, because it's usually right.  You're one of the first to ask about this





BUG3: When I click on any of the figments under C:\src\PrimaryRepo, slick complains:
   ---------------------------
   SlickEdit Pro
   ---------------------------
   File not found
   ---------------------------
   OK   
   ---------------------------
Of course this file isn't found, it doesn't exist and never has.
If slick thinks they are deleted, why would it try to find them?




BUG4: All "File not found" type errors should include the full path of the file that it thinks isn't found.


BUG5: Why for
        C:\src\ExternalCode\.vs
does it not show the new files, just the folder?




BUG6: The results are different depending on Slicks current directory.
If I start with a buffer of a file in C:\src\ExternalCode, the results are as above.
If I start with a buffer of a file in C:\src\PrimaryRepo, then it shows all the files different in C:\src\PrimaryRepo, but again in both places.


Since the active project is ExternalCode.vpj, why should it matter which buffer is active when I issue this command?




BUG7: If I start in a buffer that isn't in a GIT repo at all, I get:
   ---------------------------
   SlickEdit Pro
   ---------------------------
   Could not get status for file 'fatal: Not a git repository (or any of the parent directories): .git
   fatal: Not a git repository (or any of the parent directories): .git
   '.
   ---------------------------
   OK   
   ---------------------------
Bug 7.1: The text of that dialog is messed up. The file is 'fatal: not ....' ? ? ?


Bug 7.2: Why should it care which buffer is active?

I think we maybe working on the current working directory here when we should not.  Do you have SlickEdit set up so that the current working directory matches that of the current file?

jporkkahtc

  • Senior Community Member
  • Posts: 2620
  • Hero Points: 210
  • Text
Re: Compare Project with GIT
« Reply #6 on: July 21, 2016, 05:28:29 PM »
They are not public repos, but I don't suppose there is anything special about the repos themselves, just the project configuration.

I figured that the CompareProjectWithGit would filter by the projects files. I haven't used this option before - mostly because it didn't seem to work right and I never investigated. I usually use CompareDirWithGit.

WRT CD: I have Slick to make track the buffer working directory.
I suppose the project directory is C:\src\PrimaryRepo even though all of the projects files are in ..\ExternalCode\....

I'm not using Slick to build at all here - I just created a bunch of projects, each with wildcard files.
All the projects live at the top level in C:\src\PrimaryRepo.
For most projects their files are in one of the directories directly under C:\src\PrimaryRepo
So, C:\src\PrimaryRepo\Proj1.vpj has one wildcard entry for C:\src\PrimaryRepo\Sources\Proj1\*.* (with an exclusion pattern for things like *.obj;*.lib;*.exe;*.ilk;.....

I have a couple of projects for external libraries that are also used, but aren't part of the main repo - these projects are also in C:\src\PrimaryRepo, but their files are elsewhere.

I have found that "Compare Directory With Git" will fail if the current directory isn't in a git repo.
CASE A: In V20.0.3, I could do a CompareDirWithGit, where the current buffer is under
     C:\src\AnyValidGitRepo\sub1\sub2\....
But then I enter C:\src\SomeOtherRepo

CASE B: In 20.0.3, if the current buffer was not in a repo, like C:\users\joe\documents\foo.txt, then CompareDirWithGit where I enter C:\src\SomeOtherRepo it fails
---------------------------
SlickEdit Pro
---------------------------
Could not get status for file 'fatal: Not a git repository (or any of the parent directories): .git
fatal: Not a git repository (or any of the parent directories): .git
'.
---------------------------
OK   
---------------------------


V21 has the duplicate files issue as described above for CASE A here, where V20 didn't do this.

V21 has the same failure in CASE B.


V20, CompareProjectWithGit seems to behave much like V21 does - described in detail above.



If CompareProjectWithGit is really CompareProjectDirWithGit, I suppose that is OK, but it would be more helpful if the menu text would say as much, and possibly include the actual project dir name, like "Compare With Project Dir C:\src\SomePlaceElse", "Compare With Workspace Dir C:\src\Primary", etc.

Dan

  • SlickEdit Team Member
  • Senior Community Member
  • *
  • Posts: 2897
  • Hero Points: 153
Re: Compare Project with GIT
« Reply #7 on: July 21, 2016, 05:31:10 PM »
It actually does a little more than that.  It finds directories that the project uses.  So it's not just the project's working directory.

There's definitely a problem based on current buffer. Let me tackle that and we'll see how much that fixes.

Dan

  • SlickEdit Team Member
  • Senior Community Member
  • *
  • Posts: 2897
  • Hero Points: 153
Re: Compare Project with GIT
« Reply #8 on: July 21, 2016, 07:45:03 PM »
I have a fix for one of the problems.  Can you PM me an email address and I'll send it to you?

Thanks,

Dan

jporkkahtc

  • Senior Community Member
  • Posts: 2620
  • Hero Points: 210
  • Text
Re: Compare Project with GIT
« Reply #9 on: August 01, 2016, 06:53:32 PM »
Clark, WRT editing forum posts in Chrome.
What is your setting for "Toggle View"?

When I have it ON, Chrome editing is weird.
When off, it behaves much better - though I don't get WYSIWYG formatting as I type.

Clark

  • SlickEdit Team Member
  • Senior Community Member
  • *
  • Posts: 6862
  • Hero Points: 528
Re: Compare Project with GIT
« Reply #10 on: August 01, 2016, 10:14:24 PM »
I can't find that option.

Is it a plugin? I haven't added anything to my chrome.

jporkkahtc

  • Senior Community Member
  • Posts: 2620
  • Hero Points: 210
  • Text
Re: Compare Project with GIT
« Reply #11 on: August 01, 2016, 10:28:46 PM »
Right near the top of the message editor, at the end of the row of buttons.


Clark

  • SlickEdit Team Member
  • Senior Community Member
  • *
  • Posts: 6862
  • Hero Points: 528
Re: Compare Project with GIT
« Reply #12 on: August 01, 2016, 11:00:26 PM »
I've never used that before. I tried pasting from SlickEdit with that on and off and it doesn't seem to make a difference.

I pasted from SlickEdit into a post and did a preview to see what it would look like. No difference.