Skip to content

Display graphical interfaces to see who is the last that modify a line (ie git blame)

License

Notifications You must be signed in to change notification settings

mesopelagique/Blame4D

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

54 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Blame4D

language language-top code-size build release license discord

Get git blame information for methods and classes, by code or by launching a graphical interface on current file in method editor using macro.

Install component

To install this component into your 4D, download it, rename it with .4dbase extension and move it manually to the Components folder of your 4D app or into your database.

or use kaluza command line interface and do kaluza install -g mesopelagique/Blame4D

or v19 component DeployComponent

Macro

This component add two macro to display blame result on current method or class.

menu macro

Blame GUI

This macro launch the native git gui blame graphical interface on current method.

git-gui blame

On macOs to upgrade git you could use brew install git-gui with brew

Blame Form

This macro launch the a 4D form with blame result on current method.

blame form

This form have not all functionnalities of git blame gui, but this do the job for most cases.

Limitation

4D macro system seems to not allow me to get selected lines, so I cannot limit blame to selected lines.

How to by code

From command output

$blame:=blame($blameOut)

with $blameOut the result of the git blame operation using -p (porcelain) option.

For instance git blame -p 'Project/Sources/Classes/Blame.4dm'

You could launch git command with LAUNCH EXTERNAL PROCESS

Get lines and commit data

// Get the commit data object
$commitData = $blame.commitData

// Get the line data object
// each item containing a reference(the hash) to commits that can be then referenced in commitData
$lineData = $blame.lineData

Get data for a specific line

$lineData = $blame.data(5) 

It's equivalient to $lineData["5"] merged with $commitData[$lineData["5"].hash]

From method path in current database

$blame:=blameMethod($methodPath) // for instance blameMethod(Current method path)

Acknowledgement

Code to parse blame output converted from Javascript project blamejs with Mesopotamia

Other components

mesopelagique

About

Display graphical interfaces to see who is the last that modify a line (ie git blame)

Topics

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages