Author Topic: [SOLVED in 25.0.0.9]File not found when adding to version control after creation  (Read 2145 times)

patrickkox

  • Senior Community Member
  • Posts: 117
  • Hero Points: 6
  • Debian GNU/Linux user
I just noticed this after I enabled the option "Prompt when files are added to project" and I created a new file through:File -> New -> Automatic -> main.cpp
After the file is created there is a question to add the file to version control, but I guess the file only exists in the buffer and not in the filesystem since there is a "file not found" error after that.
I've also noticed that when I manually add the file to Git (right-click on the file -> Version Control (Git) -> add main.cpp) there is a "Slick-C" Error:
Quote
file=svx.ex offset=9287
and the Stack shows:
Quote
Stack trace written to file: /tmp/vsstack.patrick
This property or method is not allowed on this object
svc.ex 9287 svc_add()   p_window_id: 91   p_object: OI_TREE_VIEW   p_name: _proj_tooltab_tree
When I add an existing file to the project, the same question to add the file to version control is asked, and then it works without problems.
And to end on a positive note; I like the new "color icons", the previous set didn't look good on the light theme but these are a lot better.
« Last Edit: October 24, 2020, 08:19:03 am by patrickkox »

Dan

  • SlickEdit Team Member
  • Senior Community Member
  • *
  • Posts: 2545
  • Hero Points: 141
Re: File not found when adding to version control after creation.
« Reply #1 on: August 22, 2020, 03:52:37 pm »
That probably is because the file does not exist yet, I will have a look at that.  I think I just have to remove the prompt.

I'll have a look at the stack.  We fixed one issue like that for beta 3 already, it is may be the same issue, but I will double check to be sure.

patrickkox

  • Senior Community Member
  • Posts: 117
  • Hero Points: 6
  • Debian GNU/Linux user
Re: File not found when adding to version control after creation.
« Reply #2 on: August 23, 2020, 12:05:14 pm »
Hi Dan,
I just checked and the new file is not added to version control, so I think removing the error message is not enough.I had to manually add the file (from the CLI) to be able to use it with the Version Control system in VSE.
I'm running Debian Testing in case that's important to know.

patrickkox

  • Senior Community Member
  • Posts: 117
  • Hero Points: 6
  • Debian GNU/Linux user
Re: File not found when adding to version control after creation.
« Reply #3 on: August 23, 2020, 03:48:44 pm »
Another quick update:
When I select "No" when asked to add the file to VCS (after adding a new file)  and manually add it later (after editing and saving) I experience the following:

when I right-click on the filename in the projects browser and select : Version Control (Git) -> Add main.cpp I get the Slick-C Stack error message

But when I go to the top menu and select : Tools -> Version Control (Git) -> Add main.cpp there is no error message and the file seems to be correctly added to git.

Dan

  • SlickEdit Team Member
  • Senior Community Member
  • *
  • Posts: 2545
  • Hero Points: 141
Re: File not found when adding to version control after creation.
« Reply #4 on: August 23, 2020, 04:34:09 pm »
Hi Dan,
I just checked and the new file is not added to version control, so I think removing the error message is not enough.I had to manually add the file (from the CLI) to be able to use it with the Version Control system in VSE.
I'm running Debian Testing in case that's important to know.

I was talking about removing the whole prompt to add to version control from the File->New dialog because the file is not on disk yet.

Dan

  • SlickEdit Team Member
  • Senior Community Member
  • *
  • Posts: 2545
  • Hero Points: 141
Re: File not found when adding to version control after creation.
« Reply #5 on: August 23, 2020, 04:36:26 pm »
Another quick update:
When I select "No" when asked to add the file to VCS (after adding a new file)  and manually add it later (after editing and saving) I experience the following:

when I right-click on the filename in the projects browser and select : Version Control (Git) -> Add main.cpp I get the Slick-C Stack error message

But when I go to the top menu and select : Tools -> Version Control (Git) -> Add main.cpp there is no error message and the file seems to be correctly added to git.

Yes, this is an issue with the window it is being run from.  What happens if you run another operation from there (like history on a file that is already in version control)?

patrickkox

  • Senior Community Member
  • Posts: 117
  • Hero Points: 6
  • Debian GNU/Linux user
Re: File not found when adding to version control after creation.
« Reply #6 on: August 23, 2020, 05:35:11 pm »
Quote
I was talking about removing the whole prompt to add to version control from the File->New dialog because the file is not on disk yet.
Ah, I thought you were talking about removing just the error message, my bad  ;D
However having new files automatically added to version control would be a great feature (I keep forgetting to manually add them.

Quote
Yes, this is an issue with the window it is being run from.  What happens if you run another operation from there (like history on a file that is already in version control)?

This results in a similar error message:
Quote
This property or method is not allowed on this pbject
 file=svc.ex offset=6156


and the Slick-C stack shows
Quote
Stack trace written to file: /tmp/vsstack.patrick



This property or method is not allowed on this object



svc.ex 6156 svc_history(,1,,0,)   p_window_id: 32   p_object: OI_TREE_VIEW   p_name: _proj_tooltab_tree

Dan

  • SlickEdit Team Member
  • Senior Community Member
  • *
  • Posts: 2545
  • Hero Points: 141
Re: File not found when adding to version control after creation.
« Reply #7 on: August 23, 2020, 05:46:30 pm »
The problem is that File>New does not actually write the new file to disk, it merely creates a buffer in the editor.  So there is nothing to add (thus the error message).  Trying to detect the first save has a number of issues.

It's not much of a work around, but if you use Version Control->Compare workspace with git before doing commits etc, you will see the files that show up with a '?' icon that means Git does not know what they are, and you can then select them and add them (the ? is small, but you will be able to tell it from a modified file, and files that are not in "some sort of status" will not show up).  We use this tool a lot - and because the repository is local in git it comes up really fast.

The Slick-C stack does indeed seem to be fixed for beta 3.

patrickkox

  • Senior Community Member
  • Posts: 117
  • Hero Points: 6
  • Debian GNU/Linux user
Re: File not found when adding to version control after creation.
« Reply #8 on: August 23, 2020, 06:08:55 pm »
It's not much of a work around, but if you use Version Control->Compare workspace with git before doing commits etc, you will see the files that show up with a '?' icon that means Git does not know what they are, and you can then select them and add them (the ? is small, but you will be able to tell it from a modified file, and files that are not in "some sort of status" will not show up).  We use this tool a lot - and because the repository is local in git it comes up really fast.
Then I must be doing something wrong since they don't show up when I do this on my system:After I've manually added a file (like main.cpp) to version control from Tools -> Version Control (Git) -> add main.cpp They show up correctly when I select "Compare workspace with Git" but not before I added them.

For example, at the moment I have A project called "Example 4.15" which has it's main.cpp added to Git (and it's modified) so it shows a red dot at the top left and a green plus at the bottom right of the icon (I think) but there is no mentioning of a directory "Example 4.16" or any file contained in that folder.
Maybe I first need to add 1 file to Git so that it's aware of the directory ?

Or (now that I think of it), maybe it's because I have a .gitignore file that contains the following:
Code: [Select]
# Created by https://www.toptal.com/developers/gitignore/api/slickedit
# Edit at https://www.toptal.com/developers/gitignore?templates=slickedit

### SlickEdit ###
# SlickEdit workspace and project files are ignored by default because
# typically they are considered to be developer-specific and not part of a
# project.
*.vpw
*.vpj

# SlickEdit workspace history and tag files always contain user-specific
# data so they should not be stored in a repository.
*.vpwhistu
*.vpwhist
*.vtg

# End of https://www.toptal.com/developers/gitignore/api/slickedit

I use this .gitignore file because I've had problems in the past with conflicting workspace files.
I would basically edit a few projects on my desktop, push to git, do some other projects on my laptop, but because the workspace files are newer (because I forget to pull the repo before I start VSE, well actually I just autostart VSE on my laptop since that's basically all I use it for)  there are issues with pushing, pulling and merging

Dan

  • SlickEdit Team Member
  • Senior Community Member
  • *
  • Posts: 2545
  • Hero Points: 141
Re: File not found when adding to version control after creation.
« Reply #9 on: August 23, 2020, 06:18:15 pm »
So Example4.16 is not added to git?

What happens if from the base git directory, you run "git status --porcelain" from a console?

patrickkox

  • Senior Community Member
  • Posts: 117
  • Hero Points: 6
  • Debian GNU/Linux user
Re: File not found when adding to version control after creation.
« Reply #10 on: August 23, 2020, 06:31:16 pm »
That show the following message :

?? Chapter 04/Example 4.16/


Dan

  • SlickEdit Team Member
  • Senior Community Member
  • *
  • Posts: 2545
  • Hero Points: 141
Re: File not found when adding to version control after creation.
« Reply #11 on: August 23, 2020, 06:40:19 pm »
I'm not sure why we are not picking that up.

If you run "git rev-parse --show-toplevel" does it show the directory you expect it to?

patrickkox

  • Senior Community Member
  • Posts: 117
  • Hero Points: 6
  • Debian GNU/Linux user
Re: File not found when adding to version control after creation.
« Reply #12 on: August 23, 2020, 06:44:53 pm »
Yes, it shows the top-level directory : /home/patrick/Projects/course/

Dan

  • SlickEdit Team Member
  • Senior Community Member
  • *
  • Posts: 2545
  • Hero Points: 141
Re: File not found when adding to version control after creation.
« Reply #13 on: August 23, 2020, 06:46:29 pm »
I would expect it to pick that up.  Do you have files from that directory in the workspace?

patrickkox

  • Senior Community Member
  • Posts: 117
  • Hero Points: 6
  • Debian GNU/Linux user
Re: File not found when adding to version control after creation.
« Reply #14 on: August 23, 2020, 06:51:30 pm »
No, my setup is like this:
/home/patrick/Projects/Course (top level Git directory)
  |- Chapter 01 (Workspace called chapter 01)
  |- Chapter 02
...
  |- Chapter 04 (My current workspace)



So every chapter of my course is a different workspace inside a subdirectory of the main Git repository