Column: Git Status

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".

Columns:

  • Branch
  • Status
  • Status (native)
  • Name
  • Type

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

Column.Generic_Git.js.txt v0.3 (52.5 KB)

3 Likes

I can't download it. Clicking the link has no effect.

Have you tried right clicking and selecting "Save link As"? Both methods work for me FWIW.

That worked. Thanks!

I don't know why normal clicks don't have an effect.

1 Like

Thanks that's very useful!

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:

 2022-01-28 12:12 GIT :  SCRIPT REINIT
 2022-01-28 12:12 GIT :  Column_OnGitColumn(Status): Column.Generic_Git.js.txt
 2022-01-28 12:12 GIT :      Path: R:\Settings\Directory Opus\Script AddIns
 2022-01-28 12:12 GIT :      Repo.lastTime: 0
 2022-01-28 12:12 GIT :      RepoRoot: R:\Settings
 2022-01-28 12:12 GIT :      Reload needed (first)
 2022-01-28 12:12 GIT :      FetchRepoStatus(Status)
 2022-01-28 12:12 GIT :  Fetching repo [R:\Settings]..
 2022-01-28 12:12 GIT :          RunHiddenAdvanced():
 2022-01-28 12:12 GIT :                  CMD: %comspec% /c ""Git.exe"  -C "R:\Settings\Directory Opus\Script AddIns" status --ignored --porcelain >"C:\Users\Reyhn\AppData\Local\Temp\DO.GitColumn.radC9594.tmp.txt" 2>"C:\Users\Reyhn\AppData\Local\Temp\DO.GitColumn.radC9594.tmp.txt.err.txt""
 2022-01-28 12:12 GIT :              Return: 0
 2022-01-28 12:12 GIT :              ReadFile():
 2022-01-28 12:12 GIT :                  ReadFile(), opening [C:\Users\Reyhn\AppData\Local\Temp\DO.GitColumn.radC9594.tmp.txt]..
 2022-01-28 12:12 GIT :              ReadFile():
 2022-01-28 12:12 GIT :                  ReadFile(), opening [C:\Users\Reyhn\AppData\Local\Temp\DO.GitColumn.radC9594.tmp.txt.err.txt]..
 2022-01-28 12:12 GIT :  Column_OnGitColumn(Status): Git-branch.js
 2022-01-28 12:12 GIT :      Repo.lastTime: 1643368327284
 2022-01-28 12:12 GIT :      RepoRoot: R:\Settings
 2022-01-28 12:12 GIT :      Skipping reload, column [Status].
 2022-01-28 12:12 GIT :  Column_OnGitColumn(Status): ReadMe.txt
 2022-01-28 12:12 GIT :      Repo.lastTime: 1643368327284
 2022-01-28 12:12 GIT :      RepoRoot: R:\Settings
 2022-01-28 12:12 GIT :      Skipping reload, column [Status].

Since the logs mention the column named Status, which is SVN, I guess there is a conflict causing it to not reload the Git-status.

In a directory which is only a Git-repository, this script works.

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)

Is this tool still working?
I have Git and TortoiseGit (I do use TortoiseSVN) installed:

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.

Yes, still works for me, using..
image

Is git.exe in your %PATH%? If not, set the path to git.exe in the settings of the script.

Just checked again with DO v13 (post above was still using v12) and
image

And does fine on this setup as well..

Update to v0.3.3:

  • 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 had git.exe in my %PATH%
image
so this is not the cause. I am going to try your latest version

I have tested your latest update and it works :blush: 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.

I have update to v0.3.4

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)

Just for fun.. o)

1 Like

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?