WDX and GIT Plugins

Here you can propose new features, make suggestions etc.

Moderators: Hacker, petermad, Stefan2, white

Post Reply
Khaj
Junior Member
Junior Member
Posts: 10
Joined: 2015-04-10, 12:28 UTC

WDX and GIT Plugins

Post 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.
User avatar
MVV
Power Member
Power Member
Posts: 8711
Joined: 2008-08-03, 12:51 UTC
Location: Russian Federation

Post 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.
Khaj
Junior Member
Junior Member
Posts: 10
Joined: 2015-04-10, 12:28 UTC

Post 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.
User avatar
MVV
Power Member
Power Member
Posts: 8711
Joined: 2008-08-03, 12:51 UTC
Location: Russian Federation

Post 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.
Khaj
Junior Member
Junior Member
Posts: 10
Joined: 2015-04-10, 12:28 UTC

Post 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.
User avatar
MVV
Power Member
Power Member
Posts: 8711
Joined: 2008-08-03, 12:51 UTC
Location: Russian Federation

Post 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. :D

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.
Khaj
Junior Member
Junior Member
Posts: 10
Joined: 2015-04-10, 12:28 UTC

Post 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)
Post Reply