Page 1 of 1
WDX and GIT Plugins
Posted: 2015-04-10, 19:01 UTC
by Khaj
Hello!
Iam currently creating my own plugin for displaying GIT information (using C++ to not use java wrapper).
And two ideas came to my mind -
1) The column "extension" is a nice place to add a "branch" information for folders (that dont have extension but can be a git repository cos folders).
Unfortunately there is no way to edit it in custom columns.
Yes I have read Your (Mr. Ghisler) opinion, that there needs to be name and extension - I just propose to allow the user to add custom string to the extension column (that would mean that when the extension returned is empty, the string will get displayed). Resulting in something like
"[=Extension][=gitsys.branch]", where the editbox in configuration will check if the beginning of the setting string begin with "[=Extension]".
Easy.
If you have any hacks (ini files magic, development options just You know about) that I could use, to do these things by myself, please do tell. I want these things just for myself and my company

But I will post resulting wdx and sources for everybody ofc.
Posted: 2015-04-10, 19:22 UTC
by MVV
I think separate column with branch information is better than merged with extensions because files need it too. And it is much easier to locate it in separate column, also this case will allow sorting by branch name.
Don't forget that branch information may also be shown in tooltips for files/folders.
Posted: 2015-04-10, 23:17 UTC
by Khaj
Thanks for your opinion, just to get more deeper - I want to show the current branch only if directory contains ".git".
For files it is useless (for me, so I will do the plugin in a way that will output nothing for files), because the local branch is the same for all of them.
If you mean it differently, tell me.
About tooltips for files and folders - please which functions do iplement this functionality in TC wdx? I do not know about it and that can be nice place to show a lot of git information.
Posted: 2015-04-11, 19:05 UTC
by MVV
Well, if your folders always contain files of the same branch, you probably don't need branches for folders.
Tooltips may be set up via configuration using WDX fields: Configuration - Display - User-defined.
Posted: 2015-04-11, 23:22 UTC
by Khaj
Thanks about the tooltip tip
Well if I have a git repository in a folder, then I want to know at which branch the repository (= folder) is. The point is, that more git-folders-repositories in another folder means different branches, but for a file the branches are the same (because are the same for the folder iam in).
Or to say it another way - branch is a special quality of a folder if a folder is a git repository ("contains subfolder .git"). Otherwise never display branch.
Posted: 2015-04-12, 07:37 UTC
by MVV
It seems that I forgot something because single repository really can't contail files and folders from different branches, when you swihch branch, git completely replaces folder tree.
BTW .git folder may not always present in a repository folder, it may be only in root repository folder.
Also, I think you can create tooltip template with a rule like this:
gitsys.branch is not equal to "" or maybe separate field may be added with repository address or with just boolean answer that this item is in repository. So git tooltips won't be shown for folders and files that are not within repository folders.
Posted: 2015-04-12, 08:08 UTC
by Khaj
Yep about that .git

and thanks for the tooltipy tricks
>It seems that I forgot something...
Well if I have a view from TC (of a normal folder) containing more folders ("contained folder") that are differen git repository each of them, then they can be different current branches.
But when Iam actually in the repository, then the current branch is the same all the time.
So my intent is to display name of branch in the free space for extension exactly in the case when folder (in a view of TC) contains subfolder .git (and not when the .git is actually listed). Can do it with wdx ofc, but now to the display thingie.
Example - dir tree:
C:\GitProjects\
C:\GitProjects\a
C:\GitProjects\a\.git
C:\GitProjects\b
C:\GitProjects\b\.git
C:\GitProjects\c
When with TC viewing C:\GitProjects\, display curent branches for C:\GitProjects\a,C:\GitProjects\b and nothing for c.
(When inside C:\GitProjects\a it is different matter)