Plugin - Git Commander - Git and total commander!

Discuss and announce Total Commander plugins, addons and other useful tools here, both their usage and their development.

Moderators: white, Hacker, petermad, Stefan2

hi5
Power Member
Power Member
Posts: 551
Joined: 2012-11-03, 11:35 UTC
Contact:

Re: Plugin - Git Commander - Git and total commander!

Post by *hi5 »

Well, when you enter you can automatically switch to the git view mode, so any sub dirs you enter will have to that view as well - only when you leave a source folder (level above) you would have to change it - you can assign an easy shortcut to the default view e.g. F1 or something -

Or put all your sources on a virtual folder/drive e.g. s:\ - you can use a tool such as XSubst ( see https://www.ghisler.com/tools.htm#other ) or do it yourself https://winaero.com/create-virtual-drive-from-a-folder-in-windows-10/ - now you can use "L: with drive letter" as rule)

Edit: statement was incorrect, "path" might be better, see below
Last edited by hi5 on 2021-06-27, 07:50 UTC, edited 1 time in total.
F4MiniMenu (Forum) - Open selected file(s) from TC in defined editor(s) - A (minimalistic) clone of F4Menu
Source at GitHub (AutoHotkey). TCSyncComments (copy file comments)
User avatar
petermad
Power Member
Power Member
Posts: 14739
Joined: 2003-02-05, 20:24 UTC
Location: Denmark
Contact:

Re: Plugin - Git Commander - Git and total commander!

Post by *petermad »

2jmwap
that would work, but now that I think of it, only for the git top level folder.
Something like this should do it for both top level and subfolders: https://madsenworld.dk/tcmd/gitview.png


2hi5
so any sub dirs you enter will have to that view as well
That is not true if the rule is based on filenames and not on directory name
License #524 (1994)
Danish Total Commander Translator
TC 11.03 32+64bit on Win XP 32bit & Win 7, 8.1 & 10 (22H2) 64bit, 'Everything' 1.5.0.1371a
TC 3.50b4 on Android 6 & 13
Try: TC Extended Menus | TC Languagebar | TC Dark Help | PHSM-Calendar
hi5
Power Member
Power Member
Posts: 551
Joined: 2012-11-03, 11:35 UTC
Contact:

Re: Plugin - Git Commander - Git and total commander!

Post by *hi5 »

petermad wrote: 2021-06-26, 15:32 UTC
so any sub dirs you enter will have to that view as well
That is not true if the rule is based on filenames and not on directory name
You're correct, I hadn't tried it but was thinking about "Autorun commands" so you could use the "|cm_SrcViewMode??" and keep the view set.

I don't think your solution does the trick either. The folder structure for .git is like this
F4MiniMenu\.git
F4MiniMenu\lib\
F4MiniMenu\res\
F4MiniMenu\F4MiniMenu.ahk
F4MiniMenu\changelog.md
F4MiniMenu\.gitignore
F4MiniMenu\.gitattributes
so when I enter the "F4MiniMenu\lib\" sub-folder of my source folder it no longer matches a criteria. (no .git* files and no .git in path)
.git is a folder you simply don't "go to" as there is little to do there (and it doesn't hold any git commit data for the files and folders in .git so the view columns would be empty as far as I know)

So the solution would be:
* move all sources on a separate (virtual) drive - see above, or:
* all sources must be moved to a subfolder e.g. c:\MySources\source1, c:\MySources\source2 etc so you can use use *\MySources\* as a filter and it should work (if all sources have a common "part" in their path already that can be used as well of course eg. "-src" as in c:\data\proj-src\ and z:\newproject\work-src)

So as usual, the simple solution might be best :)
F4MiniMenu (Forum) - Open selected file(s) from TC in defined editor(s) - A (minimalistic) clone of F4Menu
Source at GitHub (AutoHotkey). TCSyncComments (copy file comments)
User avatar
petermad
Power Member
Power Member
Posts: 14739
Joined: 2003-02-05, 20:24 UTC
Location: Denmark
Contact:

Re: Plugin - Git Commander - Git and total commander!

Post by *petermad »

2hi5

Sure, if the folder structure for git it like you describe, my solution will not work for other subfolders than the .git folder.
License #524 (1994)
Danish Total Commander Translator
TC 11.03 32+64bit on Win XP 32bit & Win 7, 8.1 & 10 (22H2) 64bit, 'Everything' 1.5.0.1371a
TC 3.50b4 on Android 6 & 13
Try: TC Extended Menus | TC Languagebar | TC Dark Help | PHSM-Calendar
jmwap
Member
Member
Posts: 121
Joined: 2008-03-23, 12:40 UTC

Re: Plugin - Git Commander - Git and total commander!

Post by *jmwap »

petermad wrote: 2021-06-26, 15:32 UTC 2jmwap
that would work, but now that I think of it, only for the git top level folder.
Something like this should do it for both top level and subfolders: https://madsenworld.dk/tcmd/gitview.png


2hi5
so any sub dirs you enter will have to that view as well
That is not true if the rule is based on filenames and not on directory name

thanks petermad.

That works when entering the top level one (one that has .git), but if I enter directly one below that (from instance from the history etc, without going through top level git dir first), it does not work for me.

I have a bunch of different soure directories, so mapping something to a letter etc does not work, I want to create an automatic way to move to git view whenever I am inside (or below) a git repo, and to the normal view otherwise (so I need a rule that moves me to the normal view, one that is run any other time than the git one, and with fewer priority, do we have the concept of 'priority'? or does a rule being lower do that already?)
User avatar
petermad
Power Member
Power Member
Posts: 14739
Joined: 2003-02-05, 20:24 UTC
Location: Denmark
Contact:

Re: Plugin - Git Commander - Git and total commander!

Post by *petermad »

That works when entering the top level one (one that has .git), but if I enter directly one below that (from instance from the history etc, without going through top level git dir first), it does not work for me.
I realize thta, see above, my solution only works if you go into the .git subfolder, but not into other folders. You would need a rule for each of those other folders.

The only way is to put all your folders with git stuff in a common base folder (like c:\mygit\ ), and then make a rule for that base folder ( *\mygit\* in the Directory field).
License #524 (1994)
Danish Total Commander Translator
TC 11.03 32+64bit on Win XP 32bit & Win 7, 8.1 & 10 (22H2) 64bit, 'Everything' 1.5.0.1371a
TC 3.50b4 on Android 6 & 13
Try: TC Extended Menus | TC Languagebar | TC Dark Help | PHSM-Calendar
Post Reply