Git-Status column(s) for experimental purposes.. o)
The columns use a regular git.exe somewhere in your %PATH% or from the settings of the script. A special output mode of "git status" is used to get information for all the items in the current folder of the git repo. There also is some caching and some magic logic involved to also show you the old name or location of items, when these were renamed or moved within the repo e.g., which is something you don't get to see with every git "integration".
Column.Generic_Git.js.txt v0.3.6 (64.6 KB)
// v0.3.6 - 2025-06-08
// - move some functions into global context (for better performance)
// - fixed an issue with blanks in file folder names
// - focus on subfolder only when running "git status" (added path to "status" param as well)
// - added basic icon status column (work in progress)
Column.Generic_Git.js.txt v0.3.4 (56.7 KB)
// v0.3.4 - 2025-06-06
// - fixed "out of range" script errors (for ".git" folder i think)
// - use more sensible "default" value handling for column values and ".git" folder
// - new setting for custom status of ".git" data folder
// - flip change log order
Column.Generic_Git.js.txt v0.3.3 (54.4 KB)
// v0.3.3 - some branch column value fix
// v0.3.2 - added branch column
// v0.3.1 - small change regarding "modified" status detection
How do you use this?
I have added it to Settings -> Preferences -> Toolbars -> Scripts and checked the checkbox. Then I right-clicked the column headers in the file lister, and checked Columns -> Script -> Column.Generic: Git -> Git.Status, but when I browse a Git-repository, the column only displays a dash for all files (regardless of actual status).
This might be a conflict with Subversion.
My folder is both a Git-repo and a SVN-repo at the same time.
The column Status (found via Columns -> General -> Status icons) displays the status for Subversion (which always works fine, without any scripts). But the logs from this script shows the following:
From the log it looks like you are using these git columns in "R:\Settings\Directory Opus\Script AddIns", as it runs "git status" in there. If you have the feeling, that the columns do not work, if the git-repo is also a SNV-repo, then please try "git status" in that repo on its own first. The script behind these columns does nothing else than to run "git status" and parse the output.
Maybe also check content of temporary files "C:\Users\Reyhn\AppData\Local\Temp\DO.GitColumn..*.txt".
The script still runs fine for me every day.. I do not use SVN though. o)
So I have installed this script (Column.Generic_Git.js.txt v0.3) and I have added the 4 columns this script is adding (Git-status, Git-status (native), Type, Name):
'Git-status' and 'Git-status (native)', but they are empty for all files and all repositories.
'Type' and 'Name' have something, there is something inside but I do not understand which value they bring compared to the built-in 'Type' and 'Name' columns of Windows/Directory Opus.
v0.3.1 - small change regarding "modified" status detection
v0.3.2 - added branch column
v0.3.3 - some branch column value fix
Uploaded the version I use, just to make sure we are on the same page. My version here had just minor changes (I assume), but who knows, maybe they make the difference.
I have tested your latest update and it works thank you.
The 'Git-Status' column is currently using text to indicate status: for example "modified".
To look more like a status column, how can this be replaced with icons like:
Updated to v0.3.4:
// - fixed "out of range" script errors (for ".git" folder i think)
// - use more sensible "default" value handling for column values and ".git" folder
// - new setting for custom status of ".git" data folder
// - flip change log order
Glad to hear, pushed another update, found some script errors while looking at the current situation, might work even better now.
Regarding the icons, well.. yes, there are inline icons available in DO, these could be used I guess. Maybe read this post and follow the other threads, I just recently came across these type of icons. If the status "strings" get their own script setting, people could use whatever text / icon they would like, maybe I add this when I find the time, but I already spent too much time on this one today already! o))
Just in case you feel like implementing this yourself, please use a separate (new) set of columns (in this script), I will stick to the textual representation (I don't like icons with no text, it always involves some kind of guessing o) and I think it make sense to have both available (a text based column and one using an icon) at the same time. The text value columns can also be searched through with DO, which you won't really be able to when there are specific icon-identifiers in use you would have to search for.
Great to hear icons could be used for the status, it would make it even more readable!
If I understand it well, thanks to your icon finding, you can have DO automatically render text (ex: <%error> <%update> ) as an icon. So with a map between Git status and these icons it could be used in the 'Git-status' column.
Column.Generic_Git.js.txt v0.3.6 (64.6 KB)
// v0.3.6 - 2025-06-08
// - added basic icon status column (work in progress)
// - fixed an issue with blanks in file folder names
// - move some functions into global context (for better performance)
// - focus on subfolder only when running "git status" (added path to "status" param as well)
I have tested your v0.3.6 update. It works great, thank you.
Is there a way to automatically add the Git Status column as soon as there is a '.git' folder in the folder or any parent folder?