Author Topic: Git workfolders  (Read 1539 times)

jporkkahtc

  • Senior Community Member
  • Posts: 2620
  • Hero Points: 210
  • Text
Git workfolders
« on: October 28, 2021, 07:15:10 PM »
So I usually have several clones of a repo that I'm actively working in.
For example:
Code: [Select]
C:\src\projects1\NiftyTool\...
C:\src\projects2\NiftyTool\...
C:\src\projects3\NiftyTool\...
or sometimes
Code: [Select]
C:\src1\projects\NiftyTool\...
C:\src2\projects\NiftyTool\...
C:\src3\projects\NiftyTool\...

Then I bounce around between the different copies.
I primarily work in copy "1", but then I have extra copies for keeping other branches checked out for reference.
Or sometimes I have a couple of different changes in progress in the extra copies.

It would be great if Slickedit would know about this!
Some things Slickedit could do if it knew about this:
  • Use the same workspace/project files across all copies
  • Cycle between the copies of workspaces
  • Cycle between multiple copies of a given file.
  • Diff two versions of a given file/directory

Example:
Often I want to view copy "1" and copy "2" of some file side-by-side. I manually have to
Get the full path of the current file.
On the slick cmd line I do "e <path>", and manually edit the path to get copy 2.
Editing: C:\src\projects1\NiftyTool\src\lib\subdir\blah\ImportantFile.cs
Open 2nd copy: e C:\src\projects2\NiftyTool\src\lib\subdir\blah\ImportantFile.cs


One way slickedit could "know" about this is via git worktrees.
If slick knows it is a git repo, it can query for worktrees and immediately has good information on the multiple copies of the source code.
There are drawbacks to using worktrees, but still - this could be pretty handy.

Dan

  • SlickEdit Team Member
  • Senior Community Member
  • *
  • Posts: 2899
  • Hero Points: 153
Re: Git workfolders
« Reply #1 on: October 28, 2021, 07:42:09 PM »
That is interesting.  We use worktrees here.

Dennis

  • Senior Community Member
  • Posts: 3965
  • Hero Points: 517
Re: Git workfolders
« Reply #2 on: October 29, 2021, 12:37:51 PM »
The "diff-with" command is handy for comparing a file you have open in your current source tree with the version in another source tree.  Suppose your current files is " C:\src\projects1\NiftyTool\src\lib\subdir\blah\ImportantFile.cs".  Use it from the SlickEdit command line:

Code: [Select]
diff-with C:\src\projects2\
For me, workspace history works well for bouncing between different working trees.  In what way does that come up short for you?