Skip to content

Commit

Permalink
wip
Browse files Browse the repository at this point in the history
  • Loading branch information
vdelachaux committed Oct 26, 2023
1 parent d26afd9 commit 9ccc396
Show file tree
Hide file tree
Showing 10 changed files with 58 additions and 20 deletions.
Binary file modified Build/4DPop Git.4dbase.zip
Binary file not shown.
Binary file modified Build/Components/4DPop Git.4dbase/4DPop Git.4DZ
Binary file not shown.
4 changes: 2 additions & 2 deletions Build/Components/4DPop Git.4dbase/Info.plist
Original file line number Diff line number Diff line change
Expand Up @@ -8,13 +8,13 @@
<key>CFBundleShortVersionString</key>
<string>20R4</string>
<key>CFBundleLongVersionString</key>
<string>20R4 (162)</string>
<string>20R4 (164)</string>
<key>CFBundleGetInfoString</key>
<string>20R4</string>
<key>CFBundleDisplayName</key>
<string>4DPop Git</string>
<key>CFBundleVersion</key>
<string>163</string>
<string>165</string>
<key>NSHumanReadableCopyright</key>
<string>©vdl 2020-2023</string>
</dict>
Expand Down
Binary file modified Build/Components/4DPop Git.4dbase/Libraries/lib4d-arm64.dylib
Binary file not shown.
Binary file modified Build/Components/4DPop Git.4dbase/Resources/InfoPlist.strings
Binary file not shown.
5 changes: 0 additions & 5 deletions Build/Components/4DPop Git.4dbase/Resources/onTerminate.json

This file was deleted.

4 changes: 2 additions & 2 deletions Info.plist
Original file line number Diff line number Diff line change
Expand Up @@ -8,13 +8,13 @@
<key>CFBundleShortVersionString</key>
<string>20R4</string>
<key>CFBundleLongVersionString</key>
<string>20R4 (162)</string>
<string>20R4 (164)</string>
<key>CFBundleGetInfoString</key>
<string>20R4</string>
<key>CFBundleDisplayName</key>
<string>4DPop Git</string>
<key>CFBundleVersion</key>
<string>163</string>
<string>165</string>
<key>NSHumanReadableCopyright</key>
<string>©vdl 2020-2023</string>
</dict>
Expand Down
54 changes: 48 additions & 6 deletions Project/Sources/Classes/_GIT_Controller.4dm
Original file line number Diff line number Diff line change
Expand Up @@ -1548,10 +1548,10 @@ Function CreateGithubRepository($token : Text)
//// Try creating the repository
//$GithubAPI.method:="POST"
//$GithubAPI.body:={\
accept: "application/vnd.github+json"; \
name: $GithubAPI.CommpliantRepositoryName(Form.project); \
private: True\
}
accept: "application/vnd.github+json"; \
name: $GithubAPI.CommpliantRepositoryName(Form.project); \
private: True\
}

//$request:=4D.HTTPRequest.new($GithubAPI.URL+"/user/repos"; $GithubAPI)
//$request.wait()
Expand Down Expand Up @@ -1639,7 +1639,7 @@ Function updateCommitList()

$notPushed:=$git.notPushedNumber

$git.execute("log --abbrev-commit --format=%s|%an|%h|%aI|%H|%p|%P|%ae")
$git.execute("log -g --abbrev-commit --format=%s|%an|%h|%aI|%H|%p|%P|%ae|%gd|%D")

/*
0 = message
Expand All @@ -1652,6 +1652,13 @@ Function updateCommitList()
7 = author mail
*/

var $branch; $main : Text
$main:=""
$branch:=""

ARRAY LONGINT:C221($pos; 0x0000)
ARRAY LONGINT:C221($len; 0x0000)

// One commit per line
For each ($line; Split string:C1554($git.result; "\n"; sk ignore empty strings:K86:1))

Expand All @@ -1667,16 +1674,38 @@ Function updateCommitList()

End if

If (Length:C16($c[9])>0)

If (Match regex:C1019("(?m-si)origin/(?!HEAD)([^,$]*)"; $c[9]; 1; $pos; $len))

$branch:=Substring:C12($c[9]; $pos{1}; $len{1})

If ($branch="master") | ($branch="main")

$main:=$branch

End if

End if

Else

$branch:=$main

End if

Form:C1466.commits.push({\
title: $c[0]; \
author: {name: $c[1]; mail: $c[7]; avatar: This:C1470.getAvatar($c[7])}; \
stamp: String:C10(Date:C102($c[3]))+" at "+String:C10(Time:C179($c[3])+?00:00:00?); \
fingerprint: {short: $c[2]; long: $c[4]}; \
parent: {short: $c[5]; long: $c[6]}; \
notPushed: $i<=$notPushed; \
origin: $i=($notPushed+1)\
origin: $i=($notPushed+1); branch: $branch\
})

//; branch: $branch

End if
End for each

Expand Down Expand Up @@ -1883,6 +1912,19 @@ Function getAvatar($mail : Text) : Picture

return Form:C1466[$t]

// === === === === === === === === === === === === === === === === === === === === === === === === === ===
Function metaCommits($item : Object) : Object

If ($item.branch=This:C1470.Git.workingBranch.name)

return {cell: {commitTitle: {fontWeight: "bold"}}}

Else

return {cell: {commitTitle: {fontStyle: "italic"}}}

End if

// === === === === === === === === === === === === === === === === === === === === === === === === === ===
Function meta($item : Object) : Object

Expand Down
11 changes: 6 additions & 5 deletions Project/Sources/Forms/GIT/form.4DForm
Original file line number Diff line number Diff line change
Expand Up @@ -664,13 +664,14 @@
"class": "flat",
"alternateFill": "automatic",
"resizingMode": "rightToLeft",
"metaSource": "formGetInstance.metaCommits(This:C1470)",
"columns": [
{
"header": {
"text": "Header1",
"name": "Header5"
},
"name": "Column5",
"name": "commitTitle",
"footer": {
"name": "Footer5"
},
Expand All @@ -684,7 +685,7 @@
"name": "Header13",
"text": "Header13"
},
"name": "Column13",
"name": "avatar",
"dataSource": "This:C1470.author.avatar",
"resizable": false,
"enterable": false,
Expand All @@ -700,7 +701,7 @@
"name": "Header6",
"text": "Header6"
},
"name": "Column6",
"name": "author",
"dataSource": "This:C1470.author.name",
"footer": {
"name": "Footer6"
Expand All @@ -715,7 +716,7 @@
"name": "Header7",
"text": "Header7"
},
"name": "Column7",
"name": "fingerprint",
"dataSource": "This:C1470.fingerprint.short",
"footer": {
"name": "Footer7"
Expand Down Expand Up @@ -1021,5 +1022,5 @@
"View 1": {}
}
},
"geometryStamp": 366
"geometryStamp": 373
}
Binary file modified Resources/InfoPlist.strings
Binary file not shown.

0 comments on commit 9ccc396

Please sign in to comment.